From nobody Sun Feb 8 19:02:58 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=1616689624; cv=none; d=zohomail.com; s=zohoarc; b=n/w+hBcY3BRs+v4itfilR/FUQyKyriP7jNPjYnAKhzxIGJzUYiSpWHqVzaT/iZSoiuvfDiP8k5ho+/+Xvzs4iyElN015BC0kRjGdcxc1MpRiOXr3E41YNrQZCMZzRO2fDvyqe1eZD/Gj6Tc4G9o7pEc77nT9d8VYfRcJsS9yv68= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616689624; 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=i/bRR4SZWYwLdbD3E7Y1WuYUd5ZSlI10nHdrWC535zs=; b=M35IVLzWlSnlpnWHmfdm+Tq6jAMHeOL8udR7J/Qi4HxNCRrjJSlbdzRMQXWFlsemMbWrQspQl5QEaVQQnvI7fohcx44Ayuj5mQ0ARXSGR5EeqzIvMJhaq6j98ahS3SAPjIPScbCgt8GkIiTEq6z11s9/17WhvBhAXDrWs+F+tkc= 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 1616689624184114.40719293373763; Thu, 25 Mar 2021 09:27:04 -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-578-CWeHNcCUORii6-w54X4R1g-1; Thu, 25 Mar 2021 12:26:55 -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 85B57108BD07; Thu, 25 Mar 2021 16:26:50 +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 59B0B5C260; Thu, 25 Mar 2021 16:26:50 +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 04EEE4A7CA; Thu, 25 Mar 2021 16:26:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12PGQPGZ032136 for ; Thu, 25 Mar 2021 12:26:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id CAC4620E1DA4; Thu, 25 Mar 2021 16:26:25 +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 C243120E1D84 for ; Thu, 25 Mar 2021 16:26:23 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.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 36E808015B9 for ; Thu, 25 Mar 2021 16:26:23 +0000 (UTC) Received: from mo4-p01-ob.smtp.rzone.de (mo4-p01-ob.smtp.rzone.de [85.215.255.52]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-264-Mi7VInGLNdaLEekcfV_4qA-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 204541x2PGQI6TM (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) (Client did not present a certificate); Thu, 25 Mar 2021 17:26:18 +0100 (CET) X-MC-Unique: CWeHNcCUORii6-w54X4R1g-1 X-MC-Unique: Mi7VInGLNdaLEekcfV_4qA-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 02/12] libxl: add API wrapper for libxl_retrieve_domain_configuration Date: Thu, 25 Mar 2021 17:26:02 +0100 Message-Id: <20210325162612.8355-3-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.78 on 10.11.54.6 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_retrieve_domain_configuration, which got a new parameter "libxl_asyncop_how" in Xen 4.12. libvirt does not use this parameter. No functional change intended. Signed-off-by: Olaf Hering --- src/libxl/libxl_api_wrapper.h | 16 ++++++++++++++++ src/libxl/libxl_domain.c | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/libxl/libxl_api_wrapper.h b/src/libxl/libxl_api_wrapper.h index 3b988db5b9..4763947b50 100644 --- a/src/libxl/libxl_api_wrapper.h +++ b/src/libxl/libxl_api_wrapper.h @@ -42,3 +42,19 @@ libxlDomainCreateRestoreWrapper(libxl_ctx *ctx, =20 return ret; } + +static inline int +libxlRetrieveDomainConfigurationWrapper(libxl_ctx *ctx, + uint32_t domid, + libxl_domain_config *d_config) +{ + int ret; + +#if LIBXL_API_VERSION < 0x041300 + ret =3D libxl_retrieve_domain_configuration(ctx, domid, d_config); +#else + ret =3D libxl_retrieve_domain_configuration(ctx, domid, d_config, NULL= ); +#endif + + return ret; +} diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index 9adba9f2bf..809108fd7d 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -572,8 +572,8 @@ libxlDomainShutdownThread(void *opaque) } else if (xl_reason =3D=3D LIBXL_SHUTDOWN_REASON_SOFT_RESET) { libxlDomainObjPrivatePtr priv =3D vm->privateData; =20 - if (libxl_retrieve_domain_configuration(cfg->ctx, vm->def->id, - &d_config) !=3D 0) { + if (libxlRetrieveDomainConfigurationWrapper(cfg->ctx, vm->def->id, + &d_config) !=3D 0) { VIR_ERROR(_("Failed to retrieve config for VM '%s'. " "Unable to perform soft reset. Destroying VM"), vm->def->name);