Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:olh:xen-4.6
libvirt-7.0.0
libvirt.c44c970aa81fee2857de3eb429ebccd8e602901...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File libvirt.c44c970aa81fee2857de3eb429ebccd8e602901b.patch of Package libvirt-7.0.0
From: Olaf Hering <olaf@aepfle.de> Date: Thu, 25 Mar 2021 17:26:05 +0100 Subject: c44c970aa81fee2857de3eb429ebccd8e602901b libxl: add API wrapper for libxl_domain_pause Upcoming changes will use different LIBXL_API_VERSION variants. Prepare libxl_domain_pause, which got a new parameter "ao_how" in Xen 4.12. libvirt does not use this parameter. No functional change intended. Signed-off-by: Olaf Hering <olaf@aepfle.de> Reviewed-by: Jim Fehlig <jfehlig@suse.com> --- src/libxl/libxl_api_wrapper.h | 14 ++++++++++++++ src/libxl/libxl_driver.c | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) --- a/src/libxl/libxl_api_wrapper.h +++ b/src/libxl/libxl_api_wrapper.h @@ -77,12 +77,26 @@ static inline int libxlDomainRebootWrapper(libxl_ctx *ctx, uint32_t domid) { int ret; #if LIBXL_API_VERSION < 0x041300 ret = libxl_domain_reboot(ctx, domid); #else ret = libxl_domain_reboot(ctx, domid, NULL); #endif return ret; } + +static inline int +libxlDomainPauseWrapper(libxl_ctx *ctx, uint32_t domid) +{ + int ret; + +#if LIBXL_API_VERSION < 0x041300 + ret = libxl_domain_pause(ctx, domid); +#else + ret = libxl_domain_pause(ctx, domid, NULL); +#endif + + return ret; +} --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -1176,25 +1176,25 @@ libxlDomainSuspend(virDomainPtr dom) LIBXL_CHECK_DOM0_GOTO(vm->def->name, cleanup); if (virDomainSuspendEnsureACL(dom->conn, vm->def) < 0) goto cleanup; if (libxlDomainObjBeginJob(driver, vm, LIBXL_JOB_MODIFY) < 0) goto cleanup; if (virDomainObjCheckActive(vm) < 0) goto endjob; if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_PAUSED) { - if (libxl_domain_pause(cfg->ctx, vm->def->id) != 0) { + if (libxlDomainPauseWrapper(cfg->ctx, vm->def->id) != 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Failed to suspend domain '%d' with libxenlight"), vm->def->id); goto endjob; } virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_USER); event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_SUSPENDED, VIR_DOMAIN_EVENT_SUSPENDED_PAUSED); } @@ -2040,25 +2040,25 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags) if (virDomainCoreDumpEnsureACL(dom->conn, vm->def) < 0) goto cleanup; if (libxlDomainObjBeginJob(driver, vm, LIBXL_JOB_MODIFY) < 0) goto cleanup; if (virDomainObjCheckActive(vm) < 0) goto endjob; if (!(flags & VIR_DUMP_LIVE) && virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) { - if (libxl_domain_pause(cfg->ctx, vm->def->id) != 0) { + if (libxlDomainPauseWrapper(cfg->ctx, vm->def->id) != 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Before dumping core, failed to suspend domain '%d'" " with libxenlight"), vm->def->id); goto endjob; } virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_DUMP); paused = true; } /* Unlock virDomainObj while dumping core */ virObjectUnlock(vm);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor