[libvirt] [PATCH 2/6] qemuxml2argvtest: Don't spawn session daemon

Michal Privoznik mprivozn at redhat.com
Mon Jul 9 09:56:10 UTC 2018


After f14c37ce4c2ccd111 the cleanup path for
qemuBuildInterfaceCommandLine() and qemuBuildNetCommandLine()
tries to connect to nwfilter driver in order to tear down any
NWFilter that was brought up during cmd line construction. Since
we also have negative test cases where errors during cmd line
build are expected the cleanup paths are executed and NWFilter
removal is attempted.

Fortunately, there is another bug that by pure luck prevented us
from actually spawning the daemon and thus modifying actual user
data. See next commit for explanation.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/driver.h             | 2 +-
 tests/qemuxml2argvmock.c | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/driver.h b/src/driver.h
index 0b1f7a2269..0a0d8facee 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -113,7 +113,7 @@ int virDriverLoadModule(const char *name,
 
 virConnectPtr virGetConnectInterface(void);
 virConnectPtr virGetConnectNetwork(void);
-virConnectPtr virGetConnectNWFilter(void);
+virConnectPtr virGetConnectNWFilter(void) ATTRIBUTE_NOINLINE;
 virConnectPtr virGetConnectNodeDev(void);
 virConnectPtr virGetConnectSecret(void);
 virConnectPtr virGetConnectStorage(void);
diff --git a/tests/qemuxml2argvmock.c b/tests/qemuxml2argvmock.c
index 4df92cf396..13ccfb855d 100644
--- a/tests/qemuxml2argvmock.c
+++ b/tests/qemuxml2argvmock.c
@@ -233,3 +233,10 @@ qemuOpenChrChardevUNIXSocket(const virDomainChrSourceDef *dev ATTRIBUTE_UNUSED)
         abort();
     return 1729;
 }
+
+
+virConnectPtr
+virGetConnectNWFilter(void)
+{
+    return NULL;
+}
-- 
2.16.4




More information about the libvir-list mailing list