On 04/20/2012 10:01 AM, Dmitry Guryanov wrote:
Add functions for create/shutdown/destroy and suspend/resume domain.
Signed-off-by: Dmitry Guryanov <dguryanov(a)parallels.com>
---
po/POTFILES.in | 1 +
src/pvs/pvs_driver.c | 148 ++++++++++++++++++++++++++++++++++++++++++++++++++
src/pvs/pvs_driver.h | 1 +
src/pvs/pvs_utils.c | 18 ++++++
4 files changed, 168 insertions(+), 0 deletions(-)
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 07ccb7c..7ec8df5 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -166,6 +166,7 @@ src/xenapi/xenapi_utils.c
src/xenxs/xen_sxpr.c
src/xenxs/xen_xm.c
src/pvs/pvs_driver.c
+src/pvs/pvs_utils.c
tools/console.c
tools/libvirt-guests.init.sh
tools/virsh.c
This hunk should be in 3/9. I see what's happening - you didn't spot
the issue until the file was already in git, but that isn't the case
until after you've committed the previous patch. I wish 'make
syntax-check' would be a bit nicer about catching new files when they
are new, so you didn't quite have to amend so many patches.
+typedef int (*pvsChangeState) (virDomainObjPtr privdom);
+#define PVS_UUID(x) (((pvsDomObjPtr)(x->privateData))->uuid)
+
+static int
+pvsDomainChangeState(virDomainPtr domain,
+ virDomainState req_state, const char * req_state_name,
Style nit - no space after the *.
+ pvsChangeState chstate,
+ virDomainState new_state, int reason,
+ int event_type, int event_detail)
+{
+ pvsConnPtr privconn = domain->conn->privateData;
+ virDomainObjPtr privdom;
+ virDomainEventPtr event = NULL;
+ int state;
+ int ret = -1;
+
+ pvsDriverLock(privconn);
+ privdom = virDomainFindByName(&privconn->domains, domain->name);
+ pvsDriverUnlock(privconn);
+
+ if (privdom == NULL) {
+ pvsError(VIR_ERR_INVALID_ARG, __FUNCTION__);
Same comment about __FUNCTION__ as in 3/9.
+
+int pvsPause(virDomainObjPtr privdom)
+{
+ return pvsCmdRun(PRLCTL, "pause", PVS_UUID(privdom), NULL);
+}
Can this function be static?
+++ b/src/pvs/pvs_driver.h
@@ -61,5 +61,6 @@ typedef struct _pvsConn *pvsConnPtr;
int pvsRegister(void);
virJSONValuePtr pvsParseOutput(const char *binary, ...);
+int pvsCmdRun(const char *binary, ...);
ATTRIBUTE_NONNULL(1) ATTRIBUTE_SENTINEL
--
Eric Blake eblake(a)redhat.com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org