qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v1 4/4] vhost-user: Add new option to specify vh


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v1 4/4] vhost-user: Add new option to specify vhost-user backend features
Date: Mon, 15 Jun 2015 14:58:07 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

On Fri, May 29, 2015 at 01:42:30PM +0900, Tetsuya Mukawa wrote:
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index 3af6faf..7fbb306 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -366,6 +366,17 @@ static int peer_has_ufo(VirtIONet *n)
>      return n->has_ufo;
>  }
>  
> +static uint64_t peer_backend_features(VirtIONet *n)
> +{
> +    if (!peer_has_vnet_hdr(n))
> +        return 0;

QEMU coding style always uses {} even for single statement if bodies:

if (!peer_has_vnet_hdr(n)) {
    return 0;
}

> diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
> index 4d7e3ba..d847ea5 100644
> --- a/hw/virtio/vhost-user.c
> +++ b/hw/virtio/vhost-user.c
> @@ -307,6 +307,13 @@ static int vhost_user_call(struct vhost_dev *dev, 
> unsigned long int request,
>                  error_report("Received bad msg size.");
>                  goto close;
>              }
> +            if (dev->backend_features != (dev->backend_features & msg.u64)) {
> +                    error_report("Lack of backend features. "
> +                                 "Expected 0x%llx, but receives 0x%lx",

Please use PRIx64 for msg.u64 to avoid compiler errors on 32-bit hosts.

> +                                 dev->backend_features, msg.u64);
> +                    goto close;

QEMU uses 4-space indentation.

Attachment: pgpSuSPH3Ttf2.pgp
Description: PGP signature


reply via email to

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