diff --git a/ChangeLog b/ChangeLog index d398f32b22..90f2ae797f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,13 @@ +Wed Aug 27 12:14:00 EST 2008 Daniel P. Berrange + + * 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 + * src/lxc_driver.c: Make sure we cleanup veth devices at shutdown Fri Aug 22 11:49:42 BST 2008 Daniel P. Berrange diff --git a/src/Makefile.am b/src/Makefile.am index a659214e30..2d06c8514b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 diff --git a/src/openvz_driver.c b/src/openvz_driver.c index 03c10f1b61..ef0d0e053e 100644 --- a/src/openvz_driver.c +++ b/src/openvz_driver.c @@ -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; }