On Tue, Nov 24, 2009 at 10:38:48AM +0100, Gerhard Stenzel wrote: > On Tue, 2009-11-10 at 13:28 +0100, Gerhard Stenzel wrote: > > This patch removes the port filter if the network device is detached > > via virDomainDetachDevice. > > > > Signed-off-by: Gerhard Stenzel <gerhard.stenzel@xxxxxxxxxx> > > Index: libvirt/src/qemu/qemu_driver.c > > =================================================================== > > --- libvirt.orig/src/qemu/qemu_driver.c > > +++ libvirt/src/qemu/qemu_driver.c > > @@ -4829,6 +4829,7 @@ qemudDomainDetachNetDevice(virConnectPtr > > { > > int i, ret = -1; > > virDomainNetDefPtr detach = NULL; > > + struct qemud_driver *driver = qemu_driver; > > > > for (i = 0 ; i < vm->def->nnets ; i++) { > > virDomainNetDefPtr net = vm->def->nets[i]; > > @@ -4863,6 +4864,15 @@ qemudDomainDetachNetDevice(virConnectPtr > > if (qemuMonitorRemoveHostNetwork(vm, detach->vlan, > > detach->hostnet_name) < 0) > > goto cleanup; > > > > + if ((driver->macFilter) && (detach->ifname != NULL)) { > > + if ((errno = networkDisallowMacOnPort(conn, driver, > > detach->ifname, > > + detach->mac))) { > > + virReportSystemError(conn, errno, > > + _("failed to remove ebtables rule on '%s'"), > > + detach->ifname); > > + } > > + } > > + > > if (vm->def->nnets > 1) { > > memmove(vm->def->nets + i, > > vm->def->nets + i + 1, > > > This was probably overlooked. Resending for 0.7.5. > > This patch removes the port filter if the network device is detached > via virDomainDetachDevice > > Signed-off-by: Gerhard Stenzel <gerhard.stenzel@xxxxxxxxxx> > Index: libvirt/src/qemu/qemu_driver.c > =================================================================== > --- libvirt.orig/src/qemu/qemu_driver.c > +++ libvirt/src/qemu/qemu_driver.c > @@ -5284,6 +5284,17 @@ qemudDomainDetachNetDevice(virConnectPtr > } > qemuDomainObjExitMonitorWithDriver(driver, vm); > > + if ((driver->macFilter) && (detach->ifname != NULL)) { > + if ((errno = networkDisallowMacOnPort(conn, > + driver, > + detach->ifname, > + detach->mac))) { > + virReportSystemError(conn, errno, > + _("failed to remove ebtables rule on '%s'"), > + detach->ifname); > + } > + } > + > if (vm->def->nnets > 1) { > memmove(vm->def->nets + i, > vm->def->nets + i + 1, > > Oops, I though I had pushed it ... it's in now, thanks ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@xxxxxxxxxxxx | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/ -- Libvir-list mailing list Libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list