]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Remove use of virState apis from openvz driver
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 27 Aug 2008 11:19:45 +0000 (11:19 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 27 Aug 2008 11:19:45 +0000 (11:19 +0000)
ChangeLog
src/Makefile.am
src/openvz_driver.c

index d398f32b22aaa015adf952c8a65b4e7fbf77db88..90f2ae797ffc80b2eb4bcfb4971036a46189a23a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,13 @@
+Wed Aug 27 12:14:00 EST 2008 Daniel P. Berrange <berrange@redhat.com>
+
+       * src/openvz_driver.c: Remove incorrect usage of virState
+       driver internal apis only intended for drivers within the
+       daemon.
+       * src/Makefile.am: No need to disable openvz if the
+       daemon is disabled.
+
 Fri Aug 22 08:30:00 PDT 2008 Dan Smith <danms@us.ibm.com>
+
        * src/lxc_driver.c: Make sure we cleanup veth devices at shutdown
 
 Fri Aug 22 11:49:42 BST 2008 Daniel P. Berrange <berrange@redhat.com>
index a659214e30953f6444899ac4cf50dec5d21df709..2d06c8514bed485bae8141dfb0b330486aaa4adc 100644 (file)
@@ -159,6 +159,10 @@ if WITH_XEN
 libvirt_la_SOURCES += $(XEN_DRIVER_SOURCES)
 endif
 
+if WITH_OPENVZ
+libvirt_la_SOURCES += $(OPENVZ_DRIVER_SOURCES)
+endif
+
 
 # Drivers usable inside daemon context
 if WITH_LIBVIRTD
@@ -173,10 +177,6 @@ if WITH_LXC
 libvirt_la_SOURCES += $(LXC_DRIVER_SOURCES)
 endif
 
-if WITH_OPENVZ
-libvirt_la_SOURCES += $(OPENVZ_DRIVER_SOURCES)
-endif
-
 if WITH_STORAGE_LVM
 libvirt_la_SOURCES += $(STORAGE_DRIVER_LVM_SOURCES)
 endif
index 03c10f1b612adc7dfa6d953ce82a689e1c8a10e0..ef0d0e053e87e3df6519711cdae867f8ca6cc1ff 100644 (file)
@@ -79,10 +79,6 @@ static int openvzListDomains(virConnectPtr conn, int *ids, int nids);
 static int openvzNumDomains(virConnectPtr conn);
 static int openvzListDefinedDomains(virConnectPtr conn, char **const names, int nnames);
 static int openvzNumDefinedDomains(virConnectPtr conn);
-static int openvzStartup(void);
-static int openvzShutdown(void);
-static int openvzReload(void);
-static int openvzActive(void);
 
 static virDomainPtr openvzDomainDefineXML(virConnectPtr conn, const char *xml);
 static virDomainPtr openvzDomainCreateLinux(virConnectPtr conn, const char *xml,
@@ -760,7 +756,8 @@ static virDrvOpenStatus openvzOpen(virConnectPtr conn,
 
    conn->privateData = &ovz_driver;
 
-   virStateInitialize();
+   openvzAssignUUIDs();
+
    vms = openvzGetVPSInfo(conn);
    ovz_driver.vms = vms;
 
@@ -807,7 +804,8 @@ static int openvzListDomains(virConnectPtr conn, int *ids, int nids) {
     char *endptr;
     const char *cmd[] = {VZLIST, "-ovpsid", "-H" , NULL};
 
-    ret = virExec(conn, cmd, NULL, &pid, -1, &outfd, &errfd, VIR_EXEC_NONE);
+    ret = virExec(conn, cmd, NULL, NULL,
+                  &pid, -1, &outfd, &errfd, VIR_EXEC_NONE);
     if(ret == -1) {
         openvzError(conn, VIR_ERR_INTERNAL_ERROR,
                _("Could not exec %s"), VZLIST);
@@ -844,7 +842,8 @@ static int openvzListDefinedDomains(virConnectPtr conn,
     const char *cmd[] = {VZLIST, "-ovpsid", "-H", "-S", NULL};
 
     /* the -S options lists only stopped domains */
-    ret = virExec(conn, cmd, NULL, &pid, -1, &outfd, &errfd, VIR_EXEC_NONE);
+    ret = virExec(conn, cmd, NULL, NULL,
+                  &pid, -1, &outfd, &errfd, VIR_EXEC_NONE);
     if(ret == -1) {
         openvzError(conn, VIR_ERR_INTERNAL_ERROR,
                _("Could not exec %s"), VZLIST);
@@ -916,27 +915,6 @@ static int openvzNumDefinedDomains(virConnectPtr conn ATTRIBUTE_UNUSED) {
     return ovz_driver.num_inactive;
 }
 
-static int openvzStartup(void) {
-    openvzAssignUUIDs();
-
-    return 0;
-}
-
-static int openvzShutdown(void) {
-
-    return 0;
-}
-
-static int openvzReload(void) {
-
-    return 0;
-}
-
-static int openvzActive(void) {
-
-    return 1;
-}
-
 static virDriver openvzDriver = {
     VIR_DRV_OPENVZ,
     "OPENVZ",
@@ -999,17 +977,8 @@ static virDriver openvzDriver = {
     NULL, /* nodeGetFreeMemory */
 };
 
-static virStateDriver openvzStateDriver = {
-    openvzStartup,
-    openvzShutdown,
-    openvzReload,
-    openvzActive,
-    NULL, /* sigHandler */
-};
-
 int openvzRegister(void) {
     virRegisterDriver(&openvzDriver);
-    virRegisterStateDriver(&openvzStateDriver);
     return 0;
 }