lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJSP0QVmrDC5S5+QmadEGN8GPT3WtC7RvO12sN3Fr5KMvp+SAA@mail.gmail.com>
Date:	Tue, 25 Oct 2011 23:19:29 -0700
From:	Stefan Hajnoczi <stefanha@...il.com>
To:	Jason Wang <jasowang@...hat.com>
Cc:	aliguori@...ibm.com, quintela@...hat.com, jan.kiszka@...mens.com,
	mst@...hat.com, qemu-devel@...gnu.org, blauwirbel@...il.com,
	pbonzini@...hat.com, rusty@...tcorp.com.au, kvm@...r.kernel.org,
	netdev@...r.kernel.org
Subject: Re: [Qemu-devel] [RFC v2 PATCH 4/4] virtio-net: notify guest to
 annouce itself

On Fri, Oct 21, 2011 at 10:39 PM, Jason Wang <jasowang@...hat.com> wrote:
> diff --git a/hw/virtio-net.c b/hw/virtio-net.c
> index 8c2f460..7f844e7 100644
> --- a/hw/virtio-net.c
> +++ b/hw/virtio-net.c
> @@ -95,6 +95,10 @@ static void virtio_net_set_config(VirtIODevice *vdev, const uint8_t *config)
>         memcpy(n->mac, netcfg.mac, ETH_ALEN);
>         qemu_format_nic_info_str(&n->nic->nc, n->mac);
>     }
> +
> +    if (memcmp(&netcfg.status, &n->status, sizeof(n->status))) {
> +        memcpy(&n->status, &netcfg.status, sizeof(n->status));
> +    }

The memcpy() can be done unconditionally.

>  }
>
>  static bool virtio_net_started(VirtIONet *n, uint8_t status)
> @@ -227,7 +231,7 @@ static uint32_t virtio_net_get_features(VirtIODevice *vdev, uint32_t features)
>  {
>     VirtIONet *n = to_virtio_net(vdev);
>
> -    features |= (1 << VIRTIO_NET_F_MAC);
> +    features |= (1 << VIRTIO_NET_F_MAC | 1 << VIRTIO_NET_F_GUEST_ANNOUNCE);
>
>     if (peer_has_vnet_hdr(n)) {
>         tap_using_vnet_hdr(n->nic->nc.peer, 1);
> @@ -983,6 +987,19 @@ static void virtio_net_cleanup(VLANClientState *nc)
>     n->nic = NULL;
>  }
>
> +static int virtio_net_announce(VLANClientState *nc)
> +{
> +    VirtIONet *n = DO_UPCAST(NICState, nc, nc)->opaque;
> +
> +    if (n->vdev.guest_features & (0x1 << VIRTIO_NET_F_GUEST_ANNOUNCE)) {
> +        n->status |= VIRITO_NET_S_ANNOUNCE;

Typo, should be VIRTIO_NET_S_ANNOUNCE.

Stefan
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ