Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:olh:xen-4.12
libvirt-7.0.0
libvirt.f2332e8f780197565aebaa3c4a64424053d9544...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File libvirt.f2332e8f780197565aebaa3c4a64424053d95441.patch of Package libvirt-7.0.0
From: Olaf Hering <olaf@aepfle.de> Date: Thu, 25 Mar 2021 17:26:01 +0100 Subject: f2332e8f780197565aebaa3c4a64424053d95441 libxl: add API wrapper for libxl_domain_create_restore Upcoming changes will use different LIBXL_API_VERSION variants. Prepare libxl_domain_create_restore, which got a new parameter "send_back_fd" in Xen 4.7. 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 | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/libxl/libxl_domain.c | 5 +++-- 2 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 src/libxl/libxl_api_wrapper.h new file mode 100644 --- /dev/null +++ b/src/libxl/libxl_api_wrapper.h @@ -0,0 +1,44 @@ +/* + * libxl_api_wrapper.h: handle various libxl API variants + * + * Copyright (C) 2021 SUSE LLC + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#pragma once + +#include <libxl.h> + +static inline int +libxlDomainCreateRestoreWrapper(libxl_ctx *ctx, + libxl_domain_config *d_config, + uint32_t *domid, + int restore_fd, + const libxl_domain_restore_params *params, + const libxl_asyncprogress_how *aop_console_how) +{ + int ret; + +#if LIBXL_API_VERSION < 0x040700 + ret = libxl_domain_create_restore(ctx, d_config, domid, restore_fd, params, + NULL, aop_console_how); +#else + ret = libxl_domain_create_restore(ctx, d_config, domid, restore_fd, -1, + params, NULL, aop_console_how); +#endif + + return ret; +} --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -13,24 +13,25 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see * <http://www.gnu.org/licenses/>. */ #include <config.h> #include <fcntl.h> +#include "libxl_api_wrapper.h" #include "libxl_domain.h" #include "libxl_capabilities.h" #include "datatypes.h" #include "viralloc.h" #include "virfile.h" #include "virerror.h" #include "virhook.h" #include "virlog.h" #include "virstring.h" #include "virtime.h" #include "locking/domain_lock.h" @@ -1394,26 +1395,26 @@ libxlDomainStart(libxlDriverPrivatePtr driver, virObjectUnlock(vm); aop_console_how.for_callback = vm; aop_console_how.callback = libxlConsoleCallback; if (restore_fd < 0) { ret = libxl_domain_create_new(cfg->ctx, &d_config, &domid, NULL, &aop_console_how); } else { libxl_domain_restore_params_init(¶ms); #ifdef LIBXL_HAVE_SRM_V2 params.stream_version = restore_ver; #endif - ret = libxl_domain_create_restore(cfg->ctx, &d_config, &domid, - restore_fd, ¶ms, NULL, + ret = libxlDomainCreateRestoreWrapper(cfg->ctx, &d_config, &domid, + restore_fd, ¶ms, &aop_console_how); libxl_domain_restore_params_dispose(¶ms); } virObjectLock(vm); if (ret) { if (restore_fd < 0) virReportError(VIR_ERR_INTERNAL_ERROR, _("libxenlight failed to create new domain '%s'"), d_config.c_info.name); else virReportError(VIR_ERR_INTERNAL_ERROR,
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