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

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

 



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@xxxxxxxxxx>
---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux