mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
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>
This commit is contained in:
parent
439942f395
commit
c44c970aa8
@ -86,3 +86,17 @@ libxlDomainRebootWrapper(libxl_ctx *ctx, uint32_t domid)
|
|||||||
|
|
||||||
return ret;
|
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;
|
||||||
|
}
|
||||||
|
@ -1185,7 +1185,7 @@ libxlDomainSuspend(virDomainPtr dom)
|
|||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_PAUSED) {
|
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,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Failed to suspend domain '%d' with libxenlight"),
|
_("Failed to suspend domain '%d' with libxenlight"),
|
||||||
vm->def->id);
|
vm->def->id);
|
||||||
@ -2048,7 +2048,7 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags)
|
|||||||
|
|
||||||
if (!(flags & VIR_DUMP_LIVE) &&
|
if (!(flags & VIR_DUMP_LIVE) &&
|
||||||
virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
|
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,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Before dumping core, failed to suspend domain '%d'"
|
_("Before dumping core, failed to suspend domain '%d'"
|
||||||
" with libxenlight"),
|
" with libxenlight"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user