From nobody Sun Feb 8 23:23:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616689629; cv=none; d=zohomail.com; s=zohoarc; b=Xl5aV1Pi4+PUW0wUe1yTCZ+kiOGNUpfxB1/Xj+GzAW6oDi+gJqHPq+RlCpu57xQGhNJGR71iNQeU9nFoMJxTHVgOhv1Y9jLU5K4wzRAdxhVeA+RcUoO/kSfcbQ2j/9e+qObaw/ZN8lBbz+KgRGtJzU9Dgah5FKmoZyO699dYlek= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616689629; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=nGZ11MY04wmtDIKqPn32mb8GkRLjlreepxloHIkQKqA=; b=KHgnMYLT+NrLmtRQ9MgLiCCcuWlOH200Rr/wnYnDF/WUq+wrUNEhxm7oYmQxuyPW/k7CTNrBvgKiZeXmIKa45VnIMhjRcWptmDegrSk/f6cKpcPmt8okP1oQ6vDBILNB8PFuWSXegw67CgY/U0DctTiVBgP5hjD1YwZWcm2MkjM= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 161668962941417.770453495674815; Thu, 25 Mar 2021 09:27:09 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-428-ZYNK-JfpNbi89_UlBGhYYw-1; Thu, 25 Mar 2021 12:27:03 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D97CC801817; Thu, 25 Mar 2021 16:26:58 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B29C75C260; Thu, 25 Mar 2021 16:26:58 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 74A874A707; Thu, 25 Mar 2021 16:26:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12PGQRxI032177 for ; Thu, 25 Mar 2021 12:26:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9FCBCF7822; Thu, 25 Mar 2021 16:26:27 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 94F25F7821 for ; Thu, 25 Mar 2021 16:26:23 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 15D05800B29 for ; Thu, 25 Mar 2021 16:26:23 +0000 (UTC) Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [81.169.146.160]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-243-srxZIvBONECUO0Bywg5Dhg-1; Thu, 25 Mar 2021 12:26:20 -0400 Received: from sender by smtp.strato.de (RZmta 47.22.0 SBL|AUTH) with ESMTPSA id 204541x2PGQH6TL (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) (Client did not present a certificate); Thu, 25 Mar 2021 17:26:17 +0100 (CET) X-MC-Unique: ZYNK-JfpNbi89_UlBGhYYw-1 X-MC-Unique: srxZIvBONECUO0Bywg5Dhg-1 X-RZG-AUTH: ":P2EQZWCpfu+qG7CngxMFH1J+3q8wa/QXkBR9MXjAuzBW/OdlBZQ4AHSS32Qg" X-RZG-CLASS-ID: mo00 From: Olaf Hering To: libvir-list@redhat.com Subject: [PATCH v2 01/12] libxl: add API wrapper for libxl_domain_create_restore Date: Thu, 25 Mar 2021 17:26:01 +0100 Message-Id: <20210325162612.8355-2-olaf@aepfle.de> In-Reply-To: <20210325162612.8355-1-olaf@aepfle.de> References: <20210325162612.8355-1-olaf@aepfle.de> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Olaf Hering X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 --- 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 diff --git a/src/libxl/libxl_api_wrapper.h b/src/libxl/libxl_api_wrapper.h new file mode 100644 index 0000000000..3b988db5b9 --- /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 + * . + */ + +#pragma once + +#include + +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 =3D libxl_domain_create_restore(ctx, d_config, domid, restore_fd, = params, + NULL, aop_console_how); +#else + ret =3D libxl_domain_create_restore(ctx, d_config, domid, restore_fd, = -1, + params, NULL, aop_console_how); +#endif + + return ret; +} diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index 014f6aceca..9adba9f2bf 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -22,6 +22,7 @@ =20 #include =20 +#include "libxl_api_wrapper.h" #include "libxl_domain.h" #include "libxl_capabilities.h" =20 @@ -1396,8 +1397,8 @@ libxlDomainStart(libxlDriverPrivatePtr driver, #ifdef LIBXL_HAVE_SRM_V2 params.stream_version =3D restore_ver; #endif - ret =3D libxl_domain_create_restore(cfg->ctx, &d_config, &domid, - restore_fd, ¶ms, NULL, + ret =3D libxlDomainCreateRestoreWrapper(cfg->ctx, &d_config, &domi= d, + restore_fd, ¶ms, &aop_console_how); libxl_domain_restore_params_dispose(¶ms); }