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

Re: [libvirt] [PATCH 1/2] nwfilter: Pass the VM's UUID into the nwfilter subsystem

On 12/08/2011 06:32 PM, Eric Blake wrote:
On 11/28/2011 11:32 AM, Stefan Berger wrote:
A preparatory patch for DHCP snooping where we want to be able to
differentiate between a VM's interface using the tuple of
<VM UUID, Interface MAC address>. We assume that MAC addresses could
possibly be re-used between different networks (VLANs) thus do not only
want to rely on the MAC address to identify an interface.

At the current 'final destination' in virNWFilterInstantiate I am leaving
the vmuuid parameter as ATTRIBUTE_UNUSED until the DHCP snooping patches arrive.
(we may not post the DHCP snooping patches for 0.9.8, though)
You may want to tweak the commit message, now that 0.9.8 is out :)

Mostly this is a pretty trivial patch. On the lowest layers, in lxc_driver
and uml_conf, I am passing the virDomainDefPtr around until I am passing
only the VM's uuid into the NWFilter calls.
This patch applied cleanly after your return status cleanup, and does
indeed look straight-forward.

  src/conf/domain_nwfilter.c             |    3 ++-
  src/conf/domain_nwfilter.h             |    2 ++
  src/lxc/lxc_driver.c                   |    5 ++++-
  src/nwfilter/nwfilter_driver.c         |    6 ++++--
  src/nwfilter/nwfilter_gentech_driver.c |   27 +++++++++++++++++++--------
  src/nwfilter/nwfilter_gentech_driver.h |    5 ++++-
  src/nwfilter/nwfilter_learnipaddr.c    |    3 ++-
  src/qemu/qemu_command.c                |    2 +-
  src/qemu/qemu_process.c                |    2 +-
  src/uml/uml_conf.c                     |   11 +++++++----
  10 files changed, 46 insertions(+), 20 deletions(-)

Index: libvirt-acl/src/nwfilter/nwfilter_learnipaddr.c
--- libvirt-acl.orig/src/nwfilter/nwfilter_learnipaddr.c
+++ libvirt-acl/src/nwfilter/nwfilter_learnipaddr.c
@@ -704,7 +704,8 @@ learnIPAddressThread(void *arg)
                            "cache for interface %s"), inetaddr, req->ifname);

-            ret = virNWFilterInstantiateFilterLate(req->ifname,
+            ret = virNWFilterInstantiateFilterLate(NULL,
+                                                   req->ifname,
Is this going to bite us later?  Obviously, with the ATTRIBUTE_UNUSED in
It shouldn't. The DHCP snooping code is the final recipient of the UUID. If the above filter instantiation function was to call into the DHCP snooping code we'd have a different type of problem.
this patch, it won't, but I'm wondering if you need to pass the uuid
through a few more calls (but that can be a separate patch).

Thanks for the review.


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