So far, there are no flags to implement, so just call the corresponding function with 0 passed as @flags. Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx> --- src/xenapi/xenapi_driver.c | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c index a547306..01bfc98 100644 --- a/src/xenapi/xenapi_driver.c +++ b/src/xenapi/xenapi_driver.c @@ -712,18 +712,22 @@ xenapiDomainLookupByName(virConnectPtr conn, } /* - * xenapiDomainSuspend + * xenapiDomainSuspendFlags * * a VM is paused * Returns 0 on success or -1 in case of error */ static int -xenapiDomainSuspend(virDomainPtr dom) +xenapiDomainSuspendFlags(virDomainPtr dom, + unsigned int flags) { /* vm.pause() */ xen_vm vm; xen_vm_set *vms = NULL; xen_session *session = ((struct _xenapiPrivate *)(dom->conn->privateData))->session; + + virCheckFlags(0, -1); + if (xen_vm_get_by_name_label(session, &vms, dom->name) && vms->size > 0) { if (vms->size != 1) { xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR, @@ -748,18 +752,34 @@ xenapiDomainSuspend(virDomainPtr dom) } /* - * xenapiDomainResume + * xenapiDomainSuspend + * + * a VM is paused + * Returns 0 on success or -1 in case of error + */ +static int +xenapiDomainSuspend(virDomainPtr dom) +{ + return xenapiDomainSuspendFlags(dom, 0); +} + +/* + * xenapiDomainResumeFlags * * Resumes a VM * Returns 0 on success or -1 in case of error */ static int -xenapiDomainResume(virDomainPtr dom) +xenapiDomainResumeFlags(virDomainPtr dom, + unsigned int flags) { /* vm.unpause() */ xen_vm vm; xen_vm_set *vms; xen_session *session = ((struct _xenapiPrivate *)(dom->conn->privateData))->session; + + virCheckFlags(0, -1); + if (xen_vm_get_by_name_label(session, &vms, dom->name) && vms->size > 0) { if (vms->size != 1) { xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR, @@ -784,6 +804,18 @@ xenapiDomainResume(virDomainPtr dom) } /* + * xenapiDomainResume + * + * Resumes a VM + * Returns 0 on success or -1 in case of error + */ +static int +xenapiDomainResume(virDomainPtr dom) +{ + return xenapiDomainResumeFlags(dom, 0); +} + +/* * xenapiDomainShutdown * * shutsdown a VM @@ -1962,7 +1994,9 @@ static virDriver xenapiDriver = { .domainLookupByUUID = xenapiDomainLookupByUUID, /* 0.8.0 */ .domainLookupByName = xenapiDomainLookupByName, /* 0.8.0 */ .domainSuspend = xenapiDomainSuspend, /* 0.8.0 */ + .domainSuspendFlags = xenapiDomainSuspendFlags, /* 1.2.2 */ .domainResume = xenapiDomainResume, /* 0.8.0 */ + .domainResumeFlags = xenapiDomainResumeFlags, /* 1.2.2 */ .domainShutdown = xenapiDomainShutdown, /* 0.8.0 */ .domainShutdownFlags = xenapiDomainShutdownFlags, /* 0.9.10 */ .domainReboot = xenapiDomainReboot, /* 0.8.0 */ -- 1.8.5.2 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list