On 02/05/2018 10:28 AM, Daniel P. Berrangé wrote:
Currently the QEMU driver will call directly into the network driver
impl to modify resolve the atual type of NICs with type=network. It
has todo this before it has allocated the actual NIC. This introduces
a callback system to allow us to decouple the QEMU driver from the
network driver.
This is a short term step, as it ought to be possible to achieve the
same end goal by simply querying XML via the public network API. The
QEMU code in question though, has no virConnectPtr conveniently
available at this time.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/conf/domain_conf.c | 17 ++++++++++++++++-
src/conf/domain_conf.h | 15 ++++++++++++++-
src/libvirt_private.syms | 1 +
src/network/bridge_driver.c | 10 +++++-----
src/network/bridge_driver.h | 5 -----
src/qemu/qemu_alias.c | 3 +--
src/qemu/qemu_domain_address.c | 3 +--
tests/Makefile.am | 11 +++++++++--
tests/qemuxml2argvtest.c | 4 ++++
9 files changed, 51 insertions(+), 18 deletions(-)
I realized while reviewing Andrea's changes just now that the
xml2argvtest is missing! and I think I know why...
[...]
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 497bd21a25..d013aed5eb 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -280,7 +280,7 @@ test_libraries += virmocklibxl.la
endif WITH_LIBXL
if WITH_QEMU
-test_programs += qemuxml2argvtest qemuxml2xmltest \
^^^^^^^^^^^^^^^^
hmmm...
+test_programs += qemuxml2xmltest \
qemuargv2xmltest qemuhelptest domainsnapshotxml2xmltest \
qemumonitortest qemumonitorjsontest qemuhotplugtest \
qemuagenttest qemucapabilitiestest qemucaps2xmltest \
@@ -288,6 +288,11 @@ test_programs += qemuxml2argvtest qemuxml2xmltest \
qemucommandutiltest \
qemublocktest \
$(NULL)
+if WITH_NETWORK
+# Dep on the network driver callback for resolving NIC
+# actual type. XXX remove this dep.
+test_programs += qemuxml2xmltest
Was this supposed to be += qemuxml2argvtest ??
John
+endif WITH_NETWORK
test_helpers += qemucapsprobe
test_libraries += libqemumonitortestutils.la \
libqemutestdriver.la \
@@ -582,7 +587,9 @@ qemucpumock_la_LIBADD = $(MOCKLIBS_LIBS)
qemuxml2argvtest_SOURCES = \
qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
testutils.c testutils.h
-qemuxml2argvtest_LDADD = libqemutestdriver.la $(LDADDS) $(LIBXML_LIBS)
+qemuxml2argvtest_LDADD = libqemutestdriver.la \
+ ../src/libvirt_driver_network_impl.la \
+ $(LDADDS) $(LIBXML_LIBS)
qemuxml2argvmock_la_SOURCES = \
qemuxml2argvmock.c