qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [Qemu-devel] [PATCH v1 2/2] qemu-nbd: convert to use th


From: Eric Blake
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH v1 2/2] qemu-nbd: convert to use the QAPI SocketAddress object
Date: Wed, 16 Sep 2015 08:08:35 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0

On 09/16/2015 07:52 AM, Daniel P. Berrange wrote:
> The qemu-nbd program currently uses a QemuOpts objects
> when setting up sockets. Switch it over to use the
> QAPI SocketAddress objects instead.
> 
> Signed-off-by: Daniel P. Berrange <address@hidden>
> ---
>  qemu-nbd.c | 102 
> +++++++++++++++++++++++--------------------------------------
>  1 file changed, 38 insertions(+), 64 deletions(-)
> 

> +static SocketAddress *nbd_build_socket_address(const char *sockpath,
> +                                               const char *bindto,
> +                                               const char *port)
> +{
> +    SocketAddress *saddr;
> +
> +    saddr = g_new0(SocketAddress, 1);
> +    if (sockpath) {
> +        saddr->kind = SOCKET_ADDRESS_KIND_UNIX;

More minor conflicts with my qapi cleanups.  Not a show-stopper.

> +        saddr->q_unix = g_new0(UnixSocketAddress, 1);
> +        saddr->q_unix->path = g_strdup(sockpath);
> +    } else {
> +        saddr->kind = SOCKET_ADDRESS_KIND_INET;
> +        saddr->inet = g_new0(InetSocketAddress, 1);
> +        saddr->inet->host = g_strdup(bindto);
> +        if (port) {
> +            saddr->inet->port = g_strdup(port);
> +        } else  {
> +            saddr->inet->port = g_strdup_printf("%d", NBD_DEFAULT_PORT);

The qapi type is gross for requiring port as a string. But we have plans
to clean that up, not a showstopper for this patch.

Reviewed-by: Eric Blake <address@hidden>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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