qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v5 16/16] nbd: enable use of TLS with nbd-server


From: Daniel P. Berrange
Subject: Re: [Qemu-devel] [PATCH v5 16/16] nbd: enable use of TLS with nbd-server-start command
Date: Thu, 4 Feb 2016 16:30:05 +0000
User-agent: Mutt/1.5.24 (2015-08-30)

On Thu, Feb 04, 2016 at 09:25:10AM -0700, Eric Blake wrote:
> On 02/04/2016 06:50 AM, Daniel P. Berrange wrote:
> > This modifies the nbd-server-start QMP command so that it
> > is possible to request use of TLS. This is done by adding
> > a new optional parameter "tls-creds" which provides the ID
> > of a previously created QCryptoTLSCreds object instance.
> > 
> > TLS is only supported when using an IPv4/IPv6 socket listener.
> > 
> > Signed-off-by: Daniel P. Berrange <address@hidden>
> > ---
> 
> > +static QCryptoTLSCreds *nbd_get_tls_creds(const char *id, Error **errp)
> > +{
> > +    Object *obj;
> > +    QCryptoTLSCreds *creds;
> > +
> > +    obj = object_resolve_path_component(
> > +        object_get_objects_root(), id);
> > +    if (!obj) {
> > +        error_setg(errp, "No TLS credentials with id '%s'",
> > +                   id);
> > +        return NULL;
> > +    }
> > +    creds = (QCryptoTLSCreds *)
> > +        object_dynamic_cast(obj, TYPE_QCRYPTO_TLS_CREDS);
> 
> Do we really need the C cast alongside an object_dynamic_cast()?

Yes, afraid so - object_dynamic_cast() still returns 'Object *'.
There's probably a case to be made that object_dynamic_cast()
should be returning 'void *', but I won't change that here.

> > +++ b/qapi/block.json
> > @@ -146,13 +146,15 @@
> >  # QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
> >  #
> >  # @addr: Address on which to listen.
> > +# @tls-creds: (optional) ID of the TLS credentials object. Since 2.6
> 
> Worth a comment that it only works with IPv4/6?

Sure, we could do.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|



reply via email to

[Prev in Thread] Current Thread [Next in Thread]