On 29.03.2016 15:45, Maxim Nestratov wrote:
Make it possible to build vz driver as a module and don't link it
with
libvirt.so statically.
Remove registering it on client's side as far as we start relying on daemon
Signed-off-by: Maxim Nestratov <mnestratov(a)virtuozzo.com>
---
daemon/Makefile.am | 4 ++++
daemon/libvirtd.c | 9 +++++++++
src/Makefile.am | 21 ++++++++++++++++-----
src/libvirt.c | 7 -------
src/vz/vz_driver.c | 27 +++++++++++++++++++++++++--
5 files changed, 54 insertions(+), 14 deletions(-)
...
diff --git a/src/Makefile.am b/src/Makefile.am
index dad7bab..b26be1b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -629,6 +629,7 @@ DRIVER_SOURCE_FILES = \
$(NULL)
STATEFUL_DRIVER_SOURCE_FILES = \
+ $(VZ_DRIVER_SOURCES) \
$(BHYVE_DRIVER_SOURCES) \
$(INTERFACE_DRIVER_SOURCES) \
$(LIBXL_DRIVER_SOURCES) \
@@ -885,7 +886,9 @@ HYPERV_DRIVER_EXTRA_DIST = \
hyperv/hyperv_wmi_generator.py \
$(HYPERV_DRIVER_GENERATED)
-VZ_DRIVER_SOURCES = \
+VZ_DRIVER_SOURCES = \
+ datatypes.c \
+ util/vircommand.c \
looks like should not be here
...
diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index 9de88cd..d3dcf3d 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -1561,6 +1561,26 @@ static virConnectDriver vzConnectDriver = {
.hypervisorDriver = &vzDriver,
};
+static int
+vzStateCleanup(void)
+{
+ return 0;
+}
+
+static int
+vzStateInitialize(bool privileged ATTRIBUTE_UNUSED,
+ virStateInhibitCallback callback ATTRIBUTE_UNUSED,
+ void *opaque ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+static virStateDriver vzStateDriver = {
+ .name = "vz",
+ .stateInitialize = vzStateInitialize,
+ .stateCleanup = vzStateCleanup,
+};
+
/* Parallels domain type backward compatibility*/
static virHypervisorDriver parallelsDriver;
static virConnectDriver parallelsConnectDriver;
@@ -1588,10 +1608,13 @@ vzRegister(void)
parallelsDriver.name = "Parallels";
parallelsConnectDriver = vzConnectDriver;
parallelsConnectDriver.hypervisorDriver = ¶llelsDriver;
- if (virRegisterConnectDriver(¶llelsConnectDriver, false) < 0)
+ if (virRegisterConnectDriver(¶llelsConnectDriver, true) < 0)
+ return -1;
+
+ if (virRegisterConnectDriver(&vzConnectDriver, true) < 0)
return -1;
- if (virRegisterConnectDriver(&vzConnectDriver, false) < 0)
+ if (virRegisterStateDriver(&vzStateDriver) < 0)
return -1;
return 0;
i would move this hunk to the patch that adds cleanup and init the essense.
Nikolay