From: Roopa Prabhu Date: Thu, 17 Nov 2011 02:34:32 +0000 (-0800) Subject: qemu: don't release network actual device twice X-Git-Tag: v0.9.8-rc1~119 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=334c539ba0178c7b71253c19e92999267386678e;p=thirdparty%2Flibvirt.git qemu: don't release network actual device twice For direct attach devices, in qemuBuildCommandLine, we seem to be freeing actual device on error path (with networkReleaseActualDevice). But the actual device is not deleted. qemuProcessStop eventually deletes the direct attach device and releases actual device. But by the time qemuProcessStop is called qemuBuildCommandLine has already freed actual device, leaving stray macvtap devices behind on error. So the simplest fix is to remove the networkReleaseActualDevice in qemuBuildCommandLine. This patch does just that. Signed-off-by: Roopa Prabhu --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 267358899d..85b34bb0ed 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5432,8 +5432,6 @@ qemuBuildCommandLine(virConnectPtr conn, virReportOOMError(); error: /* free up any resources in the network driver */ - for (i = 0 ; i < def->nnets ; i++) - networkReleaseActualDevice(def->nets[i]); for (i = 0; i <= last_good_net; i++) virDomainConfNWFilterTeardown(def->nets[i]); virCommandFree(cmd);