Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:olh:xen-4.17
libvirt-7.0.0
libvirt.f8a890a6a45d1df627c7c70941f679f42aa6ec0...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File libvirt.f8a890a6a45d1df627c7c70941f679f42aa6ec01.patch of Package libvirt-7.0.0
From: Olaf Hering <olaf@aepfle.de> Date: Thu, 25 Mar 2021 17:26:03 +0100 Subject: f8a890a6a45d1df627c7c70941f679f42aa6ec01 libxl: add API wrapper for libxl_domain_shutdown Upcoming changes will use different LIBXL_API_VERSION variants. Prepare libxl_domain_shutdown, 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 | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) --- a/src/libxl/libxl_api_wrapper.h +++ b/src/libxl/libxl_api_wrapper.h @@ -49,12 +49,26 @@ libxlRetrieveDomainConfigurationWrapper(libxl_ctx *ctx, libxl_domain_config *d_config) { int ret; #if LIBXL_API_VERSION < 0x041300 ret = libxl_retrieve_domain_configuration(ctx, domid, d_config); #else ret = libxl_retrieve_domain_configuration(ctx, domid, d_config, NULL); #endif return ret; } + +static inline int +libxlDomainShutdownWrapper(libxl_ctx *ctx, uint32_t domid) +{ + int ret; + +#if LIBXL_API_VERSION < 0x041300 + ret = libxl_domain_shutdown(ctx, domid); +#else + ret = libxl_domain_shutdown(ctx, domid, NULL); +#endif + + return ret; +} --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -28,24 +28,25 @@ #include <fcntl.h> #include "internal.h" #include "virlog.h" #include "virerror.h" #include "virconf.h" #include "datatypes.h" #include "virfile.h" #include "viralloc.h" #include "viruuid.h" #include "virhook.h" #include "vircommand.h" +#include "libxl_api_wrapper.h" #include "libxl_domain.h" #include "libxl_driver.h" #include "libxl_conf.h" #include "libxl_capabilities.h" #include "libxl_migration.h" #include "xen_xm.h" #include "xen_xl.h" #include "virtypedparam.h" #include "viruri.h" #include "virstring.h" #include "virsysinfo.h" #include "viraccessapicheck.h" @@ -1283,25 +1284,25 @@ libxlDomainShutdownFlags(virDomainPtr dom, unsigned int flags) if (!(vm = libxlDomObjFromDomain(dom))) goto cleanup; LIBXL_CHECK_DOM0_GOTO(vm->def->name, cleanup); if (virDomainShutdownFlagsEnsureACL(dom->conn, vm->def, flags) < 0) goto cleanup; if (virDomainObjCheckActive(vm) < 0) goto cleanup; if (flags & VIR_DOMAIN_SHUTDOWN_PARAVIRT) { - ret = libxl_domain_shutdown(cfg->ctx, vm->def->id); + ret = libxlDomainShutdownWrapper(cfg->ctx, vm->def->id); if (ret == 0) goto cleanup; if (ret != ERROR_NOPARAVIRT) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Failed to shutdown domain '%d' with libxenlight"), vm->def->id); ret = -1; goto cleanup; } ret = -1; }
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