diff --git a/configure.ac b/configure.ac index eff36ce..14d53cd 100644 --- a/configure.ac +++ b/configure.ac @@ -2815,26 +2815,26 @@ AC_MSG_NOTICE([=====================]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Drivers]) AC_MSG_NOTICE([]) -AC_MSG_NOTICE([ Xen: $with_xen]) -AC_MSG_NOTICE([ QEMU: $with_qemu]) -AC_MSG_NOTICE([ UML: $with_uml]) -AC_MSG_NOTICE([ OpenVZ: $with_openvz]) -AC_MSG_NOTICE([ VMware: $with_vmware]) -AC_MSG_NOTICE([ VBox: $with_vbox]) -AC_MSG_NOTICE([ XenAPI: $with_xenapi]) -AC_MSG_NOTICE([xenlight: $with_libxl]) -AC_MSG_NOTICE([ LXC: $with_lxc]) -AC_MSG_NOTICE([ PHYP: $with_phyp]) -AC_MSG_NOTICE([ ESX: $with_esx]) -AC_MSG_NOTICE([ Hyper-V: $with_hyperv]) -AC_MSG_NOTICE([ PARALLELS: $with_parallels]) -AC_MSG_NOTICE([ Test: $with_test]) -AC_MSG_NOTICE([ Remote: $with_remote]) -AC_MSG_NOTICE([ Network: $with_network]) -AC_MSG_NOTICE([Libvirtd: $with_libvirtd]) -AC_MSG_NOTICE([ netcf: $with_netcf]) -AC_MSG_NOTICE([ macvtap: $with_macvtap]) -AC_MSG_NOTICE([virtport: $with_virtualport]) +AC_MSG_NOTICE([ Xen: $with_xen]) +AC_MSG_NOTICE([ QEMU: $with_qemu]) +AC_MSG_NOTICE([ UML: $with_uml]) +AC_MSG_NOTICE([ OpenVZ: $with_openvz]) +AC_MSG_NOTICE([ VMware: $with_vmware]) +AC_MSG_NOTICE([ VBox: $with_vbox]) +AC_MSG_NOTICE([ XenAPI: $with_xenapi]) +AC_MSG_NOTICE([ xenlight: $with_libxl]) +AC_MSG_NOTICE([ LXC: $with_lxc]) +AC_MSG_NOTICE([ PHYP: $with_phyp]) +AC_MSG_NOTICE([ ESX: $with_esx]) +AC_MSG_NOTICE([ Hyper-V: $with_hyperv]) +AC_MSG_NOTICE([PARALLELS: $with_parallels]) +AC_MSG_NOTICE([ Test: $with_test]) +AC_MSG_NOTICE([ Remote: $with_remote]) +AC_MSG_NOTICE([ Network: $with_network]) +AC_MSG_NOTICE([ Libvirtd: $with_libvirtd]) +AC_MSG_NOTICE([ netcf: $with_netcf]) +AC_MSG_NOTICE([ macvtap: $with_macvtap]) +AC_MSG_NOTICE([ virtport: $with_virtualport]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Storage Drivers]) AC_MSG_NOTICE([]) diff --git a/docs/drvparallels.html.in b/docs/drvparallels.html.in index 976dea1..256faf9 100644 --- a/docs/drvparallels.html.in +++ b/docs/drvparallels.html.in @@ -2,7 +2,7 @@
- The libvirt PARALLELS driver can manage Parallels Virtuozzo Server starting from 6.0 version. + The libvirt PARALLELS driver can manage Parallels Virtuozzo Server starting from version 6.0.
diff --git a/include/libvirt/virterror.h b/include/libvirt/virterror.h index 25e8d43..f69de4b 100644 --- a/include/libvirt/virterror.h +++ b/include/libvirt/virterror.h @@ -97,7 +97,8 @@ typedef enum { VIR_FROM_URI = 45, /* Error from URI handling */ VIR_FROM_AUTH = 46, /* Error from auth handling */ VIR_FROM_DBUS = 47, /* Error from DBus */ - VIR_FROM_PARALLELS = 48, /* Error from PARALLELS */ + VIR_FROM_PARALLELS = 48, /* Error from PARALLELS */ + # ifdef VIR_ENUM_SENTINELS VIR_ERR_DOMAIN_LAST # endif diff --git a/libvirt.spec.in b/libvirt.spec.in index 21d9bc0..d91d1c6 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -67,7 +67,7 @@ %define with_esx 0%{!?_without_esx:1} %define with_hyperv 0%{!?_without_hyperv:1} %define with_xenapi 0%{!?_without_xenapi:1} -%define with_parallels 0%{!?_without_parallels:1} +%define with_parallels 0%{!?_without_parallels:1} # Then the secondary host drivers, which run inside libvirtd %define with_network 0%{!?_without_network:%{server_drivers}} diff --git a/po/POTFILES.in b/po/POTFILES.in index 1917899..1b361f3 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -62,8 +62,8 @@ src/nwfilter/nwfilter_learnipaddr.c src/openvz/openvz_conf.c src/openvz/openvz_driver.c src/openvz/openvz_util.c -src/phyp/phyp_driver.c src/parallels/parallels_driver.c +src/phyp/phyp_driver.c src/qemu/qemu_agent.c src/qemu/qemu_bridge_filter.c src/qemu/qemu_capabilities.c diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c index 614f78f..a484b6b 100644 --- a/src/parallels/parallels_driver.c +++ b/src/parallels/parallels_driver.c @@ -51,12 +51,30 @@ #include "storage_file.h" #include "nodeinfo.h" #include "json.h" +#include "domain_conf.h" +#include "storage_conf.h" +#include "domain_event.h" #include "parallels_driver.h" #define VIR_FROM_THIS VIR_FROM_PARALLELS -static virCapsPtr parallelsBuildCapabilities(void); +# define parallelsError(code, ...) \ + virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \ + __FUNCTION__, __LINE__, __VA_ARGS__) +# define PRLCTL "prlctl" + +struct _parallelsConn { + virMutex lock; + virDomainObjList domains; + virStoragePoolObjList pools; + virCapsPtr caps; + virDomainEventStatePtr domainEventState; +}; + +typedef struct _parallelsConn parallelsConn; +typedef struct _parallelsConn *parallelsConnPtr; + static int parallelsClose(virConnectPtr conn); static void @@ -135,36 +153,33 @@ parallelsOpenDefault(virConnectPtr conn) return VIR_DRV_OPEN_ERROR; } if (virMutexInit(&privconn->lock) < 0) { - parallelsError(VIR_ERR_INTERNAL_ERROR, - "%s", _("cannot initialize mutex")); + parallelsError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cannot initialize mutex")); goto error; } - parallelsDriverLock(privconn); - conn->privateData = privconn; - parallelsDriverUnlock(privconn); - if (!(privconn->caps = parallelsBuildCapabilities())) goto error; if (virDomainObjListInit(&privconn->domains) < 0) goto error; + conn->privateData = privconn; + return VIR_DRV_OPEN_SUCCESS; error: virDomainObjListDeinit(&privconn->domains); virCapabilitiesFree(privconn->caps); virStoragePoolObjListFree(&privconn->pools); - parallelsDriverUnlock(privconn); - conn->privateData = NULL; VIR_FREE(privconn); return VIR_DRV_OPEN_ERROR; } static virDrvOpenStatus parallelsOpen(virConnectPtr conn, - virConnectAuthPtr auth ATTRIBUTE_UNUSED, unsigned int flags) + virConnectAuthPtr auth ATTRIBUTE_UNUSED, + unsigned int flags) { int ret; parallelsConnPtr privconn; @@ -181,11 +196,12 @@ parallelsOpen(virConnectPtr conn, return VIR_DRV_OPEN_DECLINED; /* From this point on, the connection is for us. */ - if (!conn->uri->path - || conn->uri->path[0] == '\0' - || (conn->uri->path[0] == '/' && conn->uri->path[1] == '\0')) { - parallelsError(VIR_ERR_INVALID_ARG, - "%s", _("parallelsOpen: supply a path or use parallels:///default")); + if (!conn->uri->path || + conn->uri->path[0] == '\0' || + (conn->uri->path[0] == '/' && conn->uri->path[1] == '\0')) { + parallelsError(VIR_ERR_INVALID_ARG, "%s", + _("parallelsOpen: supply a path or use " + "parallels:///default")); return VIR_DRV_OPEN_ERROR; } @@ -260,10 +276,12 @@ parallelsRegister(void) prlctl_path = virFindFileInPath(PRLCTL); if (!prlctl_path) { parallelsError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Can't find prlctl command in the PATH env")); + _("Can't find prlctl command in the PATH env")); return VIR_DRV_OPEN_ERROR; } + VIR_FREE(prlctl_path); + if (virRegisterDriver(¶llelsDriver) < 0) return -1; diff --git a/src/parallels/parallels_driver.h b/src/parallels/parallels_driver.h index c04db35..460839f 100644 --- a/src/parallels/parallels_driver.h +++ b/src/parallels/parallels_driver.h @@ -23,29 +23,6 @@ #ifndef PARALLELS_DRIVER_H # define PARALLELS_DRIVER_H - -# include "domain_conf.h" -# include "storage_conf.h" -# include "domain_event.h" - -# define parallelsError(code, ...) \ - virReportErrorHelper(VIR_FROM_TEST, code, __FILE__, \ - __FUNCTION__, __LINE__, __VA_ARGS__) -# define PRLCTL "prlctl" - - -struct _parallelsConn { - virMutex lock; - virDomainObjList domains; - virStoragePoolObjList pools; - virCapsPtr caps; - virDomainEventStatePtr domainEventState; -}; - -typedef struct _parallelsConn parallelsConn; - -typedef struct _parallelsConn *parallelsConnPtr; - int parallelsRegister(void); #endif