From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LN7lJ-0005lN-Sq for qemu-devel@nongnu.org; Wed, 14 Jan 2009 10:34:33 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LN7lH-0005jT-Uw for qemu-devel@nongnu.org; Wed, 14 Jan 2009 10:34:32 -0500 Received: from [199.232.76.173] (port=50732 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LN7lH-0005jA-Do for qemu-devel@nongnu.org; Wed, 14 Jan 2009 10:34:31 -0500 Received: from g4t0015.houston.hp.com ([15.201.24.18]:28989) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LN7lH-0003la-4L for qemu-devel@nongnu.org; Wed, 14 Jan 2009 10:34:31 -0500 From: Alex Williamson In-Reply-To: <496DB8D1.2070101@redhat.com> References: <1231881829.9095.191.camel@bling> <496DB8D1.2070101@redhat.com> Content-Type: text/plain Date: Wed, 14 Jan 2009 08:34:58 -0700 Message-Id: <1231947298.7109.262.camel@lappy> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 1/5] virtio-net: Allow setting the MAC address via set_config Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: dlaor@redhat.com Cc: Mark McLoughlin , qemu-devel , kvm On Wed, 2009-01-14 at 12:05 +0200, Dor Laor wrote: > Alex Williamson wrote: > > +static void virtio_net_set_config(VirtIODevice *vdev, const uint8_t *config) > > +{ > > + VirtIONet *n = to_virtio_net(vdev); > > + struct virtio_net_config netcfg; > > + > > + memcpy(&netcfg, config, sizeof(netcfg)); > > + > > + if (memcmp(netcfg.mac, n->mac, 6)) { > > + memcpy(n->mac, netcfg.mac, 6); > > + qemu_format_nic_info_str(n->vc, n->mac); > > + } > > +} > > + > > > > What if the guest will chose the host's mac? > Thinking about it, I don't think we should test that. > A concerned host mgmt app can add ebtables roles for such a case. > > Maybe we can optionally allow/deny it? What's the topology you're thinking of that the virtio-net MAC is also the host MAC? I typically use a bridge with a tap device, so the virtio-net MAC is isolated from the host. Thanks, Alex -- Alex Williamson HP Open Source & Linux Org.