From nobody Sun May 5 18:41:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615978856; cv=none; d=zohomail.com; s=zohoarc; b=m6e8TPVQMk8KmttwhfWkdPd6VMl0NO7OjZFA06E44HO+XqU0Qcx/Kddtz0/wzbbvsA25E62sa7kchoQLBSiHdUXE9ZXXZbpQwlr5ELijPX42HmNWQlj1R0wW9QuY75OuE951yWANe0zjx2I5TzKiK2ETdrKqrxMXfkrplAlczJ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615978856; 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=kyO6Qq1E0hhjXyo5YmgNnd51LDqCtNUHlaz2Wbriz4Y=; b=XGySqe2IUhl96v4RVsu7euimCk23ZpAzg0DtsguMOxIGg1yzNkd63ZogSE+Jxjc8qp28ha6tDUqbpbr5hr+oOLicaS668OivKZAp3Hk1k3nJhTfTpC4KKfhr/Ca1lfkbeqf54K9NHXDLkEIn8Q015AlL1HZFbTPeUtizUCT2ZqY= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1615978856883871.309382792821; Wed, 17 Mar 2021 04:00:56 -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-519-CFJGXPvDOPGQd2YG2yF6zw-1; Wed, 17 Mar 2021 07:00:53 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 14BB881747D; Wed, 17 Mar 2021 11:00:47 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E11135D747; Wed, 17 Mar 2021 11:00:46 +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 A19411809C84; Wed, 17 Mar 2021 11:00:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12HB0eOd022187 for ; Wed, 17 Mar 2021 07:00:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0E7772024CD1; Wed, 17 Mar 2021 11:00:40 +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 08CD02026D48 for ; Wed, 17 Mar 2021 11:00:37 +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-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8BCBE800883 for ; Wed, 17 Mar 2021 11:00:37 +0000 (UTC) Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [81.169.146.162]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-516-rN0iCFLjPH2ZvRdgQmdvUw-1; Wed, 17 Mar 2021 07:00:35 -0400 Received: from sender by smtp.strato.de (RZmta 47.21.0 SBL|AUTH) with ESMTPSA id k0a44fx2HAvY10I (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) (Client did not present a certificate); Wed, 17 Mar 2021 11:57:34 +0100 (CET) X-MC-Unique: CFJGXPvDOPGQd2YG2yF6zw-1 X-MC-Unique: rN0iCFLjPH2ZvRdgQmdvUw-1 X-RZG-AUTH: ":P2EQZWCpfu+qG7CngxMFH1J+3q8wa/QXkBR9MXjAuzBW/OdlBZQ4AHSS325Pjw==" X-RZG-CLASS-ID: mo00 From: Olaf Hering To: libvir-list@redhat.com Subject: [PATCH v1 01/12] libxl: add API wrapper for libxl_domain_create_restore Date: Wed, 17 Mar 2021 11:57:17 +0100 Message-Id: <20210317105728.3745-2-olaf@aepfle.de> In-Reply-To: <20210317105728.3745-1-olaf@aepfle.de> References: <20210317105728.3745-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.4 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.15 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.h | 44 ++++++++++++++++++++++++++++++++++++++++ src/libxl/libxl_domain.c | 5 +++-- 2 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 src/libxl/libxl_api.h diff --git a/src/libxl/libxl_api.h b/src/libxl/libxl_api.h new file mode 100644 index 0000000000..64ccd7a428 --- /dev/null +++ b/src/libxl/libxl_api.h @@ -0,0 +1,44 @@ +/* + * libxl_api.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 +Libxl_Domain_Create_Restore(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..2fe1d34e19 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -22,6 +22,7 @@ =20 #include =20 +#include "libxl_api.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 Libxl_Domain_Create_Restore(cfg->ctx, &d_config, &domid, + restore_fd, ¶ms, &aop_console_how); libxl_domain_restore_params_dispose(¶ms); } From nobody Sun May 5 18:41:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615978681; cv=none; d=zohomail.com; s=zohoarc; b=GsM+zLDpO1AjSf60mSmaidmm+g+5yBXpsUmNQZ3Ow84MfKt9x2mL67/K+Hh5hvoZR0B+DOrH/pLx4SgaikI+8w51dI2gdXUx0Z3BOWUgq0jaadcQa12c7uumYDgik54VeMY77H3PUPMk3Mc/eymsbeAu1uVTyz11t/K4A0S9KUI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615978681; 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=ayMi7FSjTy6usUhdTQiFYMOe3thLZZaRv+h9KRJshog=; b=lQEhWq/ohqMPxC3o+y7N69LfDQsEQNMgoHJv+DDFqmwjF6bHYW4Uv3UqYhSPt2HaHbwnMxcTDeQwOwguNLHzJUajL9BopOR7ZO1BN7p9VY9Hv1FibfAX4WOiSQjyVkhU7Q2PRqHpCb6ksu10ldcoGS6+qHgaXQ9pqQsfo6HN5as= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1615978681005141.2755483598994; Wed, 17 Mar 2021 03:58:01 -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-36-BXLNgajqOVeIafRzmZdkHg-1; Wed, 17 Mar 2021 06:57:57 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 69ECA87A83F; Wed, 17 Mar 2021 10:57:52 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 47B726F973; Wed, 17 Mar 2021 10:57:52 +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 0A86D180B450; Wed, 17 Mar 2021 10:57:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12HAvjVY021644 for ; Wed, 17 Mar 2021 06:57:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 37C471016D74; Wed, 17 Mar 2021 10:57:45 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 32E6E1018D6A for ; Wed, 17 Mar 2021 10:57:39 +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-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D82E780D2AF for ; Wed, 17 Mar 2021 10:57:39 +0000 (UTC) Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [85.215.255.22]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-519-8u8h4woyNUuW_qrL3wsvwA-1; Wed, 17 Mar 2021 06:57:37 -0400 Received: from sender by smtp.strato.de (RZmta 47.21.0 SBL|AUTH) with ESMTPSA id k0a44fx2HAvZ10J (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) (Client did not present a certificate); Wed, 17 Mar 2021 11:57:35 +0100 (CET) X-MC-Unique: BXLNgajqOVeIafRzmZdkHg-1 X-MC-Unique: 8u8h4woyNUuW_qrL3wsvwA-1 X-RZG-AUTH: ":P2EQZWCpfu+qG7CngxMFH1J+3q8wa/QXkBR9MXjAuzBW/OdlBZQ4AHSS325Pjw==" X-RZG-CLASS-ID: mo00 From: Olaf Hering To: libvir-list@redhat.com Subject: [PATCH v1 02/12] libxl: add API wrapper for libxl_retrieve_domain_configuration Date: Wed, 17 Mar 2021 11:57:18 +0100 Message-Id: <20210317105728.3745-3-olaf@aepfle.de> In-Reply-To: <20210317105728.3745-1-olaf@aepfle.de> References: <20210317105728.3745-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.3 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.13 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.h | 16 ++++++++++++++++ src/libxl/libxl_domain.c | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/libxl/libxl_api.h b/src/libxl/libxl_api.h index 64ccd7a428..e985e6d302 100644 --- a/src/libxl/libxl_api.h +++ b/src/libxl/libxl_api.h @@ -42,3 +42,19 @@ Libxl_Domain_Create_Restore(libxl_ctx *ctx, =20 return ret; } + +static inline int +Libxl_Retrieve_Domain_Configuration(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 2fe1d34e19..d970a05f3a 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -572,7 +572,7 @@ 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, + if (Libxl_Retrieve_Domain_Configuration(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"), From nobody Sun May 5 18:41:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615978684; cv=none; d=zohomail.com; s=zohoarc; b=AzeoGu05Myc1vxAv6JdY6avwMg/VakvzrM0LIhC9xvqQgPTdeGxMq4AVz6BgL46fI13+ET70a2ksJMEmGO2gzkmzmxKcLW/LfRIlYm6pMHOiGj0btZXpfsjQLcci5gM/gF3KhFqAHawEYhp3khm82wiW7GJECmJnQX56QXJZ1ps= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615978684; 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=jo3DSX+Ssv13qNcGkYP0ihLV4yQswtfSorjzOZz/x58=; b=LK1X56X53bTW0oR0M2kkPL74DOYYwh5ZUYP/rJ6VnR4+cwOba22xgB/IN85VOch4I0ikRdWJRXPV7IYil8urFsE+LFsdzvFIIyWLMiWoYiu1yECbaDexSTg8Cq0j6wnFqQTir+I88xZiMVDmptvxOxt6Yj73jcEmNpLOWDkTNcU= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1615978684688184.5330022694469; Wed, 17 Mar 2021 03:58: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-240-60WXjwVuPSq3VMFqF0xZ7A-1; Wed, 17 Mar 2021 06:58:01 -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 B19DA87A826; Wed, 17 Mar 2021 10:57:54 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8A3165C1CF; Wed, 17 Mar 2021 10:57:54 +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 43CC61800B8A; Wed, 17 Mar 2021 10:57:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12HAvg3R021616 for ; Wed, 17 Mar 2021 06:57:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id BCEDD2026D2F; Wed, 17 Mar 2021 10:57:42 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B6F5D2026D11 for ; Wed, 17 Mar 2021 10:57:40 +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-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 34B63100DE7B for ; Wed, 17 Mar 2021 10:57:40 +0000 (UTC) Received: from mo4-p01-ob.smtp.rzone.de (mo4-p01-ob.smtp.rzone.de [85.215.255.50]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-407-mR_K3OH8PcS_ugxyCqAiJg-1; Wed, 17 Mar 2021 06:57:37 -0400 Received: from sender by smtp.strato.de (RZmta 47.21.0 SBL|AUTH) with ESMTPSA id k0a44fx2HAvZ10K (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) (Client did not present a certificate); Wed, 17 Mar 2021 11:57:35 +0100 (CET) X-MC-Unique: 60WXjwVuPSq3VMFqF0xZ7A-1 X-MC-Unique: mR_K3OH8PcS_ugxyCqAiJg-1 X-RZG-AUTH: ":P2EQZWCpfu+qG7CngxMFH1J+3q8wa/QXkBR9MXjAuzBW/OdlBZQ4AHSS325Pjw==" X-RZG-CLASS-ID: mo00 From: Olaf Hering To: libvir-list@redhat.com Subject: [PATCH v1 03/12] libxl: add API wrapper for libxl_domain_shutdown Date: Wed, 17 Mar 2021 11:57:19 +0100 Message-Id: <20210317105728.3745-4-olaf@aepfle.de> In-Reply-To: <20210317105728.3745-1-olaf@aepfle.de> References: <20210317105728.3745-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.4 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_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 --- src/libxl/libxl_api.h | 14 ++++++++++++++ src/libxl/libxl_driver.c | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/libxl/libxl_api.h b/src/libxl/libxl_api.h index e985e6d302..9a3dcba60c 100644 --- a/src/libxl/libxl_api.h +++ b/src/libxl/libxl_api.h @@ -58,3 +58,17 @@ Libxl_Retrieve_Domain_Configuration(libxl_ctx *ctx, =20 return ret; } + +static inline int +Libxl_Domain_Shutdown(libxl_ctx *ctx, uint32_t domid) +{ + int ret; + +#if LIBXL_API_VERSION < 0x041300 + ret =3D libxl_domain_shutdown(ctx, domid); +#else + ret =3D libxl_domain_shutdown(ctx, domid, NULL); +#endif + + return ret; +} diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index e3d769b5d9..93db26903c 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -37,6 +37,7 @@ #include "viruuid.h" #include "virhook.h" #include "vircommand.h" +#include "libxl_api.h" #include "libxl_domain.h" #include "libxl_driver.h" #include "libxl_conf.h" @@ -1292,7 +1293,7 @@ libxlDomainShutdownFlags(virDomainPtr dom, unsigned i= nt flags) goto cleanup; =20 if (flags & VIR_DOMAIN_SHUTDOWN_PARAVIRT) { - ret =3D libxl_domain_shutdown(cfg->ctx, vm->def->id); + ret =3D Libxl_Domain_Shutdown(cfg->ctx, vm->def->id); if (ret =3D=3D 0) goto cleanup; =20 From nobody Sun May 5 18:41:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615978682; cv=none; d=zohomail.com; s=zohoarc; b=TcxK8xiVZUOwcK4HiavorFIZoB/pnBRxdaq6PZSoe6iDNKkTPjAo+KVGkm7PyEFJxhV/FgEwKozNMQSKkoNrfmEi3CkJOgmX4O4pOXnAZD8rUpXej026Vd1AEh7S4DDbLlE0G8Pi+PQZZ+JRBsfsVd63f2GrO2liYhmpt/a+1C0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615978682; 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=gV2g6QFplO2S+n32eh470XMZ1wMwgtIVBmvJheu6TNo=; b=B8FPJTKfDtrO1HQUHbObKua5ChnrUTiFYv+Ht6+/Ie8NtMDXBD17QKTBBrYA/n1bRu+ixwdyLB1O46UjC+FriANZfZCCTJzxJmpyD2Pgu2+adPMPX7Qnbd7l/8Y4H5lWXnEhVPi1etPiHgUe3Vypsp9jnnpyU4rFaObwAs9V58o= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1615978682128930.1388114399517; Wed, 17 Mar 2021 03:58:02 -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-229-UkfxxLowPdW7Z_S7kh-30A-1; Wed, 17 Mar 2021 06:57:58 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6C559108BD0C; Wed, 17 Mar 2021 10:57:51 +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 45A9A17DC3; Wed, 17 Mar 2021 10:57:51 +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 0CBC84A7CD; Wed, 17 Mar 2021 10:57:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12HAvgWY021614 for ; Wed, 17 Mar 2021 06:57:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id B713B1016D74; Wed, 17 Mar 2021 10:57:42 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B2A4510F8E39 for ; Wed, 17 Mar 2021 10:57:40 +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-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9429480006E for ; Wed, 17 Mar 2021 10:57:40 +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-537-RkY4pACQPVyJ_C7WklHQIA-1; Wed, 17 Mar 2021 06:57:38 -0400 Received: from sender by smtp.strato.de (RZmta 47.21.0 SBL|AUTH) with ESMTPSA id k0a44fx2HAvZ10L (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) (Client did not present a certificate); Wed, 17 Mar 2021 11:57:35 +0100 (CET) X-MC-Unique: UkfxxLowPdW7Z_S7kh-30A-1 X-MC-Unique: RkY4pACQPVyJ_C7WklHQIA-1 X-RZG-AUTH: ":P2EQZWCpfu+qG7CngxMFH1J+3q8wa/QXkBR9MXjAuzBW/OdlBZQ4AHSS325Pjw==" X-RZG-CLASS-ID: mo00 From: Olaf Hering To: libvir-list@redhat.com Subject: [PATCH v1 04/12] libxl: add API wrapper for libxl_domain_reboot Date: Wed, 17 Mar 2021 11:57:20 +0100 Message-Id: <20210317105728.3745-5-olaf@aepfle.de> In-Reply-To: <20210317105728.3745-1-olaf@aepfle.de> References: <20210317105728.3745-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.3 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.13 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_reboot, 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 --- src/libxl/libxl_api.h | 14 ++++++++++++++ src/libxl/libxl_driver.c | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/libxl/libxl_api.h b/src/libxl/libxl_api.h index 9a3dcba60c..1f09f3f888 100644 --- a/src/libxl/libxl_api.h +++ b/src/libxl/libxl_api.h @@ -72,3 +72,17 @@ Libxl_Domain_Shutdown(libxl_ctx *ctx, uint32_t domid) =20 return ret; } + +static inline int +Libxl_Domain_Reboot(libxl_ctx *ctx, uint32_t domid) +{ + int ret; + +#if LIBXL_API_VERSION < 0x041300 + ret =3D libxl_domain_reboot(ctx, domid); +#else + ret =3D libxl_domain_reboot(ctx, domid, NULL); +#endif + + return ret; +} diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 93db26903c..1811df8acf 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -1356,7 +1356,7 @@ libxlDomainReboot(virDomainPtr dom, unsigned int flag= s) goto cleanup; =20 if (flags & VIR_DOMAIN_REBOOT_PARAVIRT) { - ret =3D libxl_domain_reboot(cfg->ctx, vm->def->id); + ret =3D Libxl_Domain_Reboot(cfg->ctx, vm->def->id); if (ret =3D=3D 0) goto cleanup; =20 From nobody Sun May 5 18:41:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615978687; cv=none; d=zohomail.com; s=zohoarc; b=OmCG324bGcdzZ70Bk40BKzSh5uaw9o+0wpixKIMqCbRoMoXqPi8zDD74AMu4SFYSDUB8mtWXL5w1GKrHOHlL6IPyY8ZlYf+vc57hPKPlGwkdLYn+Pls+5Iqn/X0E6WJeO7gD/FbnGT8K/KkuLopid+Z7JFxDKOv7c5pU/XK+bf0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615978687; 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=EpbDJbeIiq6s+70MxwX9CRDHoFnK0mQsy81J4nFiUpY=; b=SrsHGqAPMJkuXWmAHSVr1BTim22yv1YQJs/aSns26Vx0chNVsEF9nnRGW4r21hMiSKOpJ7lfQBRtnPEWzSyaM9thKWhvoVm+zMThLS33N2ST6bGZVxQrIVwbVg/Q+XSQhpi8awl5ONTyIYf8Nb7zzw2p7yxKcL4IckuCq026opY= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1615978687197268.1675626698211; Wed, 17 Mar 2021 03:58:07 -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-205-GjoSQgFgPhe8sGFaCmk9RA-1; Wed, 17 Mar 2021 06:58:04 -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 0E7691927803; Wed, 17 Mar 2021 10:57: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 D62DD5C1CF; Wed, 17 Mar 2021 10:57:57 +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 99F5F4A701; Wed, 17 Mar 2021 10:57:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12HAvgsm021615 for ; Wed, 17 Mar 2021 06:57:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id BD7EF2026D07; Wed, 17 Mar 2021 10:57:42 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B75FC2026D13 for ; Wed, 17 Mar 2021 10:57:41 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (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 BF2F6858F11 for ; Wed, 17 Mar 2021 10:57:41 +0000 (UTC) Received: from mo4-p01-ob.smtp.rzone.de (mo4-p01-ob.smtp.rzone.de [85.215.255.54]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-176-lliQKNA5ONiOXHJ5fbqUPw-1; Wed, 17 Mar 2021 06:57:38 -0400 Received: from sender by smtp.strato.de (RZmta 47.21.0 SBL|AUTH) with ESMTPSA id k0a44fx2HAva10M (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) (Client did not present a certificate); Wed, 17 Mar 2021 11:57:36 +0100 (CET) X-MC-Unique: GjoSQgFgPhe8sGFaCmk9RA-1 X-MC-Unique: lliQKNA5ONiOXHJ5fbqUPw-1 X-RZG-AUTH: ":P2EQZWCpfu+qG7CngxMFH1J+3q8wa/QXkBR9MXjAuzBW/OdlBZQ4AHSS325Pjw==" X-RZG-CLASS-ID: mo00 From: Olaf Hering To: libvir-list@redhat.com Subject: [PATCH v1 05/12] libxl: add API wrapper for libxl_domain_pause Date: Wed, 17 Mar 2021 11:57:21 +0100 Message-Id: <20210317105728.3745-6-olaf@aepfle.de> In-Reply-To: <20210317105728.3745-1-olaf@aepfle.de> References: <20210317105728.3745-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.4 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_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 --- src/libxl/libxl_api.h | 14 ++++++++++++++ src/libxl/libxl_driver.c | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/libxl/libxl_api.h b/src/libxl/libxl_api.h index 1f09f3f888..947e0c8d47 100644 --- a/src/libxl/libxl_api.h +++ b/src/libxl/libxl_api.h @@ -86,3 +86,17 @@ Libxl_Domain_Reboot(libxl_ctx *ctx, uint32_t domid) =20 return ret; } + +static inline int +Libxl_Domain_Pause(libxl_ctx *ctx, uint32_t domid) +{ + int ret; + +#if LIBXL_API_VERSION < 0x041300 + ret =3D libxl_domain_pause(ctx, domid); +#else + ret =3D libxl_domain_pause(ctx, domid, NULL); +#endif + + return ret; +} diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 1811df8acf..929e8195f0 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -1185,7 +1185,7 @@ libxlDomainSuspend(virDomainPtr dom) goto endjob; =20 if (virDomainObjGetState(vm, NULL) !=3D VIR_DOMAIN_PAUSED) { - if (libxl_domain_pause(cfg->ctx, vm->def->id) !=3D 0) { + if (Libxl_Domain_Pause(cfg->ctx, vm->def->id) !=3D 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Failed to suspend domain '%d' with libxenlig= ht"), vm->def->id); @@ -2048,7 +2048,7 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to,= unsigned int flags) =20 if (!(flags & VIR_DUMP_LIVE) && virDomainObjGetState(vm, NULL) =3D=3D VIR_DOMAIN_RUNNING) { - if (libxl_domain_pause(cfg->ctx, vm->def->id) !=3D 0) { + if (Libxl_Domain_Pause(cfg->ctx, vm->def->id) !=3D 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Before dumping core, failed to suspend domai= n '%d'" " with libxenlight"), From nobody Sun May 5 18:41:51 2024 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=1615978854; cv=none; d=zohomail.com; s=zohoarc; b=H03/tOrZ0dBM8abtA5xpLwr9l5DzZsEIImUdsh95N8FVGIB+8a2BANGAzc7gQZE3Jyq1iAN5h95w6Y3u97irIB+MJelfWV9lwNKQEp8HFdqRGDiemVA1ups89z7SoKAKeZNikd4IyWtkX00ZlACHWHvV0nojp0VDSrZTUaJ3aQw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615978854; 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=5/bKgo18kA62UPuZnwLV3O0LwAky31+MJoI60RCdcFg=; b=P191m9J9JtSMFPyKKgVC1zT4f8qdGgLZ2wv88irX96d90dsXNAws4UIpoG15FXmfDy8A40bQ5Z4k7MKYX7BbictwOIps9Xhdt/4HuB/nTzW/RpHPW9Zl+nq4r7QhuurRcaVP7x5JJX7FH4BsmAzVCNqX9LwbfsKF0cKpSix5guE= 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 1615978854182367.66079323085853; Wed, 17 Mar 2021 04:00:54 -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-532-CTQR2LwhM0q3Q5KvXz8kgw-1; Wed, 17 Mar 2021 07:00:50 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E25DA1922961; Wed, 17 Mar 2021 11:00:44 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9407463BB8; Wed, 17 Mar 2021 11:00:44 +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 C6C2F1800216; Wed, 17 Mar 2021 11:00:43 +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 12HB0gBa022225 for ; Wed, 17 Mar 2021 07:00:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 374792166B44; Wed, 17 Mar 2021 11:00:42 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D821C2166BA4 for ; Wed, 17 Mar 2021 11:00:38 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (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 8FA12185A7BA for ; Wed, 17 Mar 2021 11:00:38 +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-183-L46zao6VM9CxXMy-oSmiYg-1; Wed, 17 Mar 2021 07:00:36 -0400 Received: from sender by smtp.strato.de (RZmta 47.21.0 SBL|AUTH) with ESMTPSA id k0a44fx2HAva10N (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) (Client did not present a certificate); Wed, 17 Mar 2021 11:57:36 +0100 (CET) X-MC-Unique: CTQR2LwhM0q3Q5KvXz8kgw-1 X-MC-Unique: L46zao6VM9CxXMy-oSmiYg-1 X-RZG-AUTH: ":P2EQZWCpfu+qG7CngxMFH1J+3q8wa/QXkBR9MXjAuzBW/OdlBZQ4AHSS325Pjw==" X-RZG-CLASS-ID: mo00 From: Olaf Hering To: libvir-list@redhat.com Subject: [PATCH v1 06/12] libxl: add API wrapper for libxl_domain_unpause Date: Wed, 17 Mar 2021 11:57:22 +0100 Message-Id: <20210317105728.3745-7-olaf@aepfle.de> In-Reply-To: <20210317105728.3745-1-olaf@aepfle.de> References: <20210317105728.3745-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.15 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_unpause, 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 --- src/libxl/libxl_api.h | 14 ++++++++++++++ src/libxl/libxl_domain.c | 4 ++-- src/libxl/libxl_driver.c | 4 ++-- src/libxl/libxl_migration.c | 3 ++- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/libxl/libxl_api.h b/src/libxl/libxl_api.h index 947e0c8d47..86d2d64b37 100644 --- a/src/libxl/libxl_api.h +++ b/src/libxl/libxl_api.h @@ -100,3 +100,17 @@ Libxl_Domain_Pause(libxl_ctx *ctx, uint32_t domid) =20 return ret; } + +static inline int +Libxl_Domain_Unpause(libxl_ctx *ctx, uint32_t domid) +{ + int ret; + +#if LIBXL_API_VERSION < 0x041300 + ret =3D libxl_domain_unpause(ctx, domid); +#else + ret =3D libxl_domain_unpause(ctx, domid, NULL); +#endif + + return ret; +} diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index d970a05f3a..6eca7027eb 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -594,7 +594,7 @@ libxlDomainShutdownThread(void *opaque) goto endjob; } libxl_evenable_domain_death(cfg->ctx, vm->def->id, 0, &priv->death= W); - libxl_domain_unpause(cfg->ctx, vm->def->id); + Libxl_Domain_Unpause(cfg->ctx, vm->def->id); #endif } else { VIR_INFO("Unhandled shutdown_reason %d", xl_reason); @@ -1459,7 +1459,7 @@ libxlDomainStart(libxlDriverPrivatePtr driver, goto destroy_dom; =20 if (!start_paused) { - libxl_domain_unpause(cfg->ctx, domid); + Libxl_Domain_Unpause(cfg->ctx, domid); virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, VIR_DOMAIN_RUNNING_BO= OTED); } else { virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_USER= ); diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 929e8195f0..2823cdb9d8 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -1238,7 +1238,7 @@ libxlDomainResume(virDomainPtr dom) goto endjob; =20 if (virDomainObjGetState(vm, NULL) =3D=3D VIR_DOMAIN_PAUSED) { - if (libxl_domain_unpause(cfg->ctx, vm->def->id) !=3D 0) { + if (Libxl_Domain_Unpause(cfg->ctx, vm->def->id) !=3D 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Failed to resume domain '%d' with libxenligh= t"), vm->def->id); @@ -2091,7 +2091,7 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to,= unsigned int flags) =20 unpause: if (virDomainObjIsActive(vm) && paused) { - if (libxl_domain_unpause(cfg->ctx, vm->def->id) !=3D 0) { + if (Libxl_Domain_Unpause(cfg->ctx, vm->def->id) !=3D 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("After dumping core, failed to resume domain = '%d' with" " libxenlight"), vm->def->id); diff --git a/src/libxl/libxl_migration.c b/src/libxl/libxl_migration.c index a5a9df98ad..f65f68b839 100644 --- a/src/libxl/libxl_migration.c +++ b/src/libxl/libxl_migration.c @@ -34,6 +34,7 @@ #include "virthread.h" #include "virhook.h" #include "rpc/virnetsocket.h" +#include "libxl_api.h" #include "libxl_domain.h" #include "libxl_driver.h" #include "libxl_conf.h" @@ -1298,7 +1299,7 @@ libxlDomainMigrationDstFinish(virConnectPtr dconn, =20 /* Unpause if requested */ if (!(flags & VIR_MIGRATE_PAUSED)) { - if (libxl_domain_unpause(cfg->ctx, vm->def->id) !=3D 0) { + if (Libxl_Domain_Unpause(cfg->ctx, vm->def->id) !=3D 0) { virReportError(VIR_ERR_OPERATION_FAILED, "%s", _("Failed to unpause domain")); goto cleanup; From nobody Sun May 5 18:41:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615978683; cv=none; d=zohomail.com; s=zohoarc; b=XooK7N8gKTmNvL8MgAufCmYv11FFn/PEo374tUR9pA3L26rTk0QKaVluohVqPgnsVfqX6DIgdwravNlN+ypqIKpSq8HGTPM1ir/LwXo6gc5SKCiUlX//BOZ7vUO/NbtPMPkypHmdIfaDV/xi7jnni9m7dC5q6BYquuScn61tgsE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615978683; 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=mfPZ3j7+jdS1TuPLRCO82F/S6d4h8xqC6Rrb+SrzRVc=; b=BGhFR5IXR7Ljog6fcmyXqsGnZlVmbR9D81CVuheoge1+LKUqyR5jBggad4DIc4d4zUe4IZ5dM00rjfE/DY+Of4ONB8AVwtaW7S/rEZKX/L7MGtGpPkO130AV9VWsoWwzuq0b9gjBedBQivNy35lLntrTwyh4LeY8MVuh150k6lA= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1615978683611389.4788483037511; Wed, 17 Mar 2021 03:58:03 -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-36-ETDTGa31MaOrzSoX_fXZEQ-1; Wed, 17 Mar 2021 06:57:57 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 69EC4108BD0B; Wed, 17 Mar 2021 10:57:51 +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 43A4D50FAF; Wed, 17 Mar 2021 10:57:51 +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 07B854A7CB; Wed, 17 Mar 2021 10:57:51 +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 12HAvgh2021608 for ; Wed, 17 Mar 2021 06:57:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 76FEDE56A8; Wed, 17 Mar 2021 10:57:42 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7147FE56A7 for ; Wed, 17 Mar 2021 10:57:42 +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-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 59D4F101A531 for ; Wed, 17 Mar 2021 10:57:42 +0000 (UTC) Received: from mo4-p01-ob.smtp.rzone.de (mo4-p01-ob.smtp.rzone.de [85.215.255.53]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-343-47Er0IbFN7WyDEReDuDdNA-1; Wed, 17 Mar 2021 06:57:39 -0400 Received: from sender by smtp.strato.de (RZmta 47.21.0 SBL|AUTH) with ESMTPSA id k0a44fx2HAvb10O (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) (Client did not present a certificate); Wed, 17 Mar 2021 11:57:37 +0100 (CET) X-MC-Unique: ETDTGa31MaOrzSoX_fXZEQ-1 X-MC-Unique: 47Er0IbFN7WyDEReDuDdNA-1 X-RZG-AUTH: ":P2EQZWCpfu+qG7CngxMFH1J+3q8wa/QXkBR9MXjAuzBW/OdlBZQ4AHSS325Pjw==" X-RZG-CLASS-ID: mo00 From: Olaf Hering To: libvir-list@redhat.com Subject: [PATCH v1 07/12] libxl: add API wrapper for libxl_domain_need_memory Date: Wed, 17 Mar 2021 11:57:23 +0100 Message-Id: <20210317105728.3745-8-olaf@aepfle.de> In-Reply-To: <20210317105728.3745-1-olaf@aepfle.de> References: <20210317105728.3745-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.11 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_need_memory, which changed the storage size of "need_memkb" in Xen 4.8. With Xen 4.12 the libxl_domain_config parameter was changed No functional change intended. Signed-off-by: Olaf Hering --- src/libxl/libxl_api.h | 24 ++++++++++++++++++++++++ src/libxl/libxl_domain.c | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/libxl/libxl_api.h b/src/libxl/libxl_api.h index 86d2d64b37..5c1545c3c0 100644 --- a/src/libxl/libxl_api.h +++ b/src/libxl/libxl_api.h @@ -114,3 +114,27 @@ Libxl_Domain_Unpause(libxl_ctx *ctx, uint32_t domid) =20 return ret; } + +#define INVALID_DOMID ~0 +static inline int +Libxl_Domain_Need_Memory(libxl_ctx *ctx, + libxl_domain_config *d_config, + uint64_t *need_memkb) +{ + int ret; + +#if LIBXL_API_VERSION < 0x040800 + { + uint32_t val32 =3D 0; + + ret =3D libxl_domain_need_memory(ctx, &d_config->b_info, &val32); + *need_memkb =3D val32; + } +#elif LIBXL_API_VERSION < 0x041300 + ret =3D libxl_domain_need_memory(ctx, &d_config->b_info, need_memkb); +#else + ret =3D libxl_domain_need_memory(ctx, d_config, INVALID_DOMID, need_me= mkb); +#endif + + return ret; +} diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index 6eca7027eb..337764b5c7 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -1008,13 +1008,13 @@ libxlDomainSetVcpuAffinities(libxlDriverPrivatePtr = driver, virDomainObjPtr vm) static int libxlDomainFreeMem(libxl_ctx *ctx, libxl_domain_config *d_config) { - uint32_t needed_mem; + uint64_t needed_mem; uint32_t free_mem; int32_t target_mem; int tries =3D 3; int wait_secs =3D 10; =20 - if (libxl_domain_need_memory(ctx, &d_config->b_info, &needed_mem) < 0) + if (Libxl_Domain_Need_Memory(ctx, d_config, &needed_mem) < 0) goto error; =20 do { From nobody Sun May 5 18:41:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615978674; cv=none; d=zohomail.com; s=zohoarc; b=j09vJ6GV7BRxsaZfqcx+UAn6DqlB6lmc0ayCGVf/x4DfYLmY6sHTzRTC8qac1FW2z7gTkMEueWvZZ4OQ8QOg2qVMucN4HG879JHsayyYTJBQXZzY2FsvN+hrQkZMYWO2prTWuEgbgndkfYFM/uSh8COMXQH4462SzoIHFkgr6TQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615978674; 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=suNyHaiFtA+2n3hE+93XCUJ1qic80FICH4K10lFCVpk=; b=Iu/5uRpuNxpywvTqrl6d25HVIXiqzV6kmzuQsRc7EytC4gU+v9TiH6SiCS5f3G81WRP9RlUt5a3wZHzXqltrtId94UDqjJXEvl08ddlSJOnjiCzZplbBMXEIHnAp4hv6l5rFhYHNn2xPiO3CVP54LUeVfz5n3gkWYvTb69m9w3U= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1615978674297853.8922719563222; Wed, 17 Mar 2021 03:57:54 -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-215--7CDqRhAOuOxv33E1aUIeQ-1; Wed, 17 Mar 2021 06:57:51 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5C0FA81621; Wed, 17 Mar 2021 10:57:45 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 307A05D9C0; Wed, 17 Mar 2021 10:57:45 +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 14C821809C84; Wed, 17 Mar 2021 10:57:44 +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 12HAvgWr021609 for ; Wed, 17 Mar 2021 06:57:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8DCDAE2030; Wed, 17 Mar 2021 10:57:42 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 88BD0E56A7 for ; Wed, 17 Mar 2021 10:57:42 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (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 7203280B91F for ; Wed, 17 Mar 2021 10:57:42 +0000 (UTC) Received: from mo4-p01-ob.smtp.rzone.de (mo4-p01-ob.smtp.rzone.de [85.215.255.53]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-280-SKK6fe0ZPhOPSS9Ji8k6Kg-1; Wed, 17 Mar 2021 06:57:40 -0400 Received: from sender by smtp.strato.de (RZmta 47.21.0 SBL|AUTH) with ESMTPSA id k0a44fx2HAvb10Q (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) (Client did not present a certificate); Wed, 17 Mar 2021 11:57:37 +0100 (CET) X-MC-Unique: -7CDqRhAOuOxv33E1aUIeQ-1 X-MC-Unique: SKK6fe0ZPhOPSS9Ji8k6Kg-1 X-RZG-AUTH: ":P2EQZWCpfu+qG7CngxMFH1J+3q8wa/QXkBR9MXjAuzBW/OdlBZQ4AHSS325Pjw==" X-RZG-CLASS-ID: mo00 From: Olaf Hering To: libvir-list@redhat.com Subject: [PATCH v1 08/12] libxl: add API wrapper for libxl_get_free_memory Date: Wed, 17 Mar 2021 11:57:24 +0100 Message-Id: <20210317105728.3745-9-olaf@aepfle.de> In-Reply-To: <20210317105728.3745-1-olaf@aepfle.de> References: <20210317105728.3745-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.14 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_get_free_memory, which changed storage size of parameter "memkb" in Xen 4.8. No functional change intended. Signed-off-by: Olaf Hering --- src/libxl/libxl_api.h | 19 +++++++++++++++++++ src/libxl/libxl_conf.c | 5 +++-- src/libxl/libxl_domain.c | 4 ++-- tests/libxlmock.c | 7 ++++++- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/src/libxl/libxl_api.h b/src/libxl/libxl_api.h index 5c1545c3c0..1c13781ae6 100644 --- a/src/libxl/libxl_api.h +++ b/src/libxl/libxl_api.h @@ -138,3 +138,22 @@ Libxl_Domain_Need_Memory(libxl_ctx *ctx, =20 return ret; } + +static inline int +Libxl_Get_Free_Memory(libxl_ctx *ctx, uint64_t *memkb) +{ + int ret; + +#if LIBXL_API_VERSION < 0x040800 + { + uint32_t val32 =3D 0; + + ret =3D libxl_get_free_memory(ctx, &val32); + *memkb =3D val32; + } +#else + ret =3D libxl_get_free_memory(ctx, memkb); +#endif + + return ret; +} diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index 4b6a7e6096..74551ff804 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -36,6 +36,7 @@ #include "viruuid.h" #include "vircommand.h" #include "virsocketaddr.h" +#include "libxl_api.h" #include "libxl_domain.h" #include "libxl_conf.h" #include "libxl_utils.h" @@ -1785,7 +1786,7 @@ libxlDriverConfigNew(void) int libxlDriverConfigInit(libxlDriverConfigPtr cfg) { - unsigned int free_mem; + uint64_t free_mem; =20 if (g_mkdir_with_parents(cfg->logDir, 0777) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -1817,7 +1818,7 @@ libxlDriverConfigInit(libxlDriverConfigPtr cfg) =20 /* This will fill xenstore info about free and dom0 memory if missing, * should be called before starting first domain */ - if (libxl_get_free_memory(cfg->ctx, &free_mem)) { + if (Libxl_Get_Free_Memory(cfg->ctx, &free_mem)) { VIR_ERROR(_("Unable to configure libxl's memory management paramet= ers")); return -1; } diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index 337764b5c7..264a730c6c 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -1009,7 +1009,7 @@ static int libxlDomainFreeMem(libxl_ctx *ctx, libxl_domain_config *d_config) { uint64_t needed_mem; - uint32_t free_mem; + uint64_t free_mem; int32_t target_mem; int tries =3D 3; int wait_secs =3D 10; @@ -1018,7 +1018,7 @@ libxlDomainFreeMem(libxl_ctx *ctx, libxl_domain_confi= g *d_config) goto error; =20 do { - if (libxl_get_free_memory(ctx, &free_mem) < 0) + if (Libxl_Get_Free_Memory(ctx, &free_mem) < 0) goto error; =20 if (free_mem >=3D needed_mem) diff --git a/tests/libxlmock.c b/tests/libxlmock.c index a36ca135f6..7a43f9196b 100644 --- a/tests/libxlmock.c +++ b/tests/libxlmock.c @@ -67,7 +67,12 @@ VIR_MOCK_IMPL_RET_ARGS(libxl_get_version_info, VIR_MOCK_STUB_RET_ARGS(libxl_get_free_memory, int, 0, libxl_ctx *, ctx, - uint32_t *, memkb); +#if LIBXL_API_VERSION < 0x040800 + uint32_t *, +#else + uint64_t *, +#endif + memkb); =20 VIR_MOCK_STUB_RET_ARGS(xc_interface_close, int, 0, From nobody Sun May 5 18:41:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615978921; cv=none; d=zohomail.com; s=zohoarc; b=FRRiEIc3ducVHAywM1iBk8Ovh03oJtto7qftRlEhJadKEviXIzbjA2p1Xoora3AqtCenvPpZudLtTljaU7kjQnQFlFjPSPrTezA18sKgn2oKsHeVj6/OGsUdx/VYqTWsxrjh5x2K2CFSqOeZHHdy8khwpx8zvLoei2t8pTXX6eE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615978921; 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=xajYVjgc+dBmUnpQXDZLyQ7ufLNPgPFifKkFd733Doc=; b=fGYPCJ1wjDNZUYpznQLPcnbCdNYHbaE/RTmzvkvYSbTBHAHqbAlny9Av4fNy10pU0W7CWZ89L+DDz06qtmpl7jPAe+wjeBkXBfTNvMRgcq+5LCpEz6VLiVrtSKqImCLlvcOGwp+2YORHGwWtiC9iNjvwQqQ0svd2rqpzN5TH1UU= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1615978921545287.463490456292; Wed, 17 Mar 2021 04:02:01 -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-62-cfU6u8rgMeWga-Sy4Fz5-Q-1; Wed, 17 Mar 2021 07:01:04 -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 76F7384BA68; Wed, 17 Mar 2021 11:00:52 +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 0EAC75C1CF; Wed, 17 Mar 2021 11:00:52 +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 BD1D64A701; Wed, 17 Mar 2021 11:00:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12HB0h6L022239 for ; Wed, 17 Mar 2021 07:00:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id B4DF11018D7F; Wed, 17 Mar 2021 11:00:43 +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 B0C481018E4A for ; Wed, 17 Mar 2021 11:00:43 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (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 9999B800B24 for ; Wed, 17 Mar 2021 11:00:43 +0000 (UTC) Received: from mo4-p01-ob.smtp.rzone.de (mo4-p01-ob.smtp.rzone.de [85.215.255.50]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-143-8omGr9ilNlaL6RIANfumvg-1; Wed, 17 Mar 2021 07:00:40 -0400 Received: from sender by smtp.strato.de (RZmta 47.21.0 SBL|AUTH) with ESMTPSA id k0a44fx2HAvc10R (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) (Client did not present a certificate); Wed, 17 Mar 2021 11:57:38 +0100 (CET) X-MC-Unique: cfU6u8rgMeWga-Sy4Fz5-Q-1 X-MC-Unique: 8omGr9ilNlaL6RIANfumvg-1 X-RZG-AUTH: ":P2EQZWCpfu+qG7CngxMFH1J+3q8wa/QXkBR9MXjAuzBW/OdlBZQ4AHSS325Pjw==" X-RZG-CLASS-ID: mo00 From: Olaf Hering To: libvir-list@redhat.com Subject: [PATCH v1 09/12] libxl: add API wrapper for libxl_set_vcpuonline Date: Wed, 17 Mar 2021 11:57:25 +0100 Message-Id: <20210317105728.3745-10-olaf@aepfle.de> In-Reply-To: <20210317105728.3745-1-olaf@aepfle.de> References: <20210317105728.3745-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.3 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_set_vcpuonline, 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 --- src/libxl/libxl_api.h | 14 ++++++++++++++ src/libxl/libxl_driver.c | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/libxl/libxl_api.h b/src/libxl/libxl_api.h index 1c13781ae6..415e2cb32c 100644 --- a/src/libxl/libxl_api.h +++ b/src/libxl/libxl_api.h @@ -157,3 +157,17 @@ Libxl_Get_Free_Memory(libxl_ctx *ctx, uint64_t *memkb) =20 return ret; } + +static inline int +Libxl_Set_Vcpuonline(libxl_ctx *ctx, uint32_t domid, libxl_bitmap *cpumap) +{ + int ret; + +#if LIBXL_API_VERSION < 0x041300 + ret =3D libxl_set_vcpuonline(ctx, domid, cpumap); +#else + ret =3D libxl_set_vcpuonline(ctx, domid, cpumap, NULL); +#endif + + return ret; +} diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 2823cdb9d8..1d37ae6c89 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -2331,7 +2331,7 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned i= nt nvcpus, break; =20 case VIR_DOMAIN_VCPU_LIVE: - if (libxl_set_vcpuonline(cfg->ctx, vm->def->id, &map) !=3D 0) { + if (Libxl_Set_Vcpuonline(cfg->ctx, vm->def->id, &map) !=3D 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Failed to set vcpus for domain '%d'" " with libxenlight"), vm->def->id); @@ -2342,7 +2342,7 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned i= nt nvcpus, break; =20 case VIR_DOMAIN_VCPU_LIVE | VIR_DOMAIN_VCPU_CONFIG: - if (libxl_set_vcpuonline(cfg->ctx, vm->def->id, &map) !=3D 0) { + if (Libxl_Set_Vcpuonline(cfg->ctx, vm->def->id, &map) !=3D 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Failed to set vcpus for domain '%d'" " with libxenlight"), vm->def->id); From nobody Sun May 5 18:41:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615979027; cv=none; d=zohomail.com; s=zohoarc; b=AyqMMSIw9p6fn3aRIucoreoM5sJT9UC5fytBt2P0F/EmXkE+Kvs0oG744TUjbzSSdLry6OMBZJnaBJE8GFr9HRHjVhKCAM3jU570nkYQyWroBIGoWP4kBzOAXtLC/slokV545XjerJ1sVT6IKK9LWpQ8vO1meQyKko2LbjdOHoI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615979027; 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=Z880OVCJTWLQqowIXt+W9E06bC7GfnT6nbsaSSjSH6c=; b=bGjw7ffUV+5m2MDS7KAcn2UYLXrjivyUdsyfKe/LUF3pP7ERGaZxY7HZLyh5o6qArWMc2PKPwqG7lWesR5CaBVbsrUG+E21/bZKYTX9kmmSWG6oVBNpkwIHV6b6g0t5GgfW0+ra3GZ0NLGG7ftraoUq4GfzU9KzUxj9SJ8DzgMM= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1615979027650706.4101525905555; Wed, 17 Mar 2021 04:03:47 -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-385-GA99ouOGN92WsFnWlRKG8g-1; Wed, 17 Mar 2021 07:01:05 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 851D9100D1A4; Wed, 17 Mar 2021 11:00:53 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 65E756A8FD; Wed, 17 Mar 2021 11:00:52 +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 1F0F1180B451; Wed, 17 Mar 2021 11:00:52 +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 12HB0ibo022244 for ; Wed, 17 Mar 2021 07:00:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1BDE6E2037; Wed, 17 Mar 2021 11:00:44 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 10A6BE56A6 for ; Wed, 17 Mar 2021 11:00:41 +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-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 55E0E858EED for ; Wed, 17 Mar 2021 11:00:41 +0000 (UTC) Received: from mo4-p02-ob.smtp.rzone.de (mo4-p02-ob.smtp.rzone.de [85.215.255.84]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-390-Chiy53fEPBqv6wuknuthkA-1; Wed, 17 Mar 2021 07:00:38 -0400 Received: from sender by smtp.strato.de (RZmta 47.21.0 SBL|AUTH) with ESMTPSA id k0a44fx2HAvc10S (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) (Client did not present a certificate); Wed, 17 Mar 2021 11:57:38 +0100 (CET) X-MC-Unique: GA99ouOGN92WsFnWlRKG8g-1 X-MC-Unique: Chiy53fEPBqv6wuknuthkA-1 X-RZG-AUTH: ":P2EQZWCpfu+qG7CngxMFH1J+3q8wa/QXkBR9MXjAuzBW/OdlBZQ4AHSS325Pjw==" X-RZG-CLASS-ID: mo00 From: Olaf Hering To: libvir-list@redhat.com Subject: [PATCH v1 10/12] libxl: add API wrapper for libxl_send_trigger Date: Wed, 17 Mar 2021 11:57:26 +0100 Message-Id: <20210317105728.3745-11-olaf@aepfle.de> In-Reply-To: <20210317105728.3745-1-olaf@aepfle.de> References: <20210317105728.3745-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.15 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_send_trigger, 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 --- src/libxl/libxl_api.h | 17 +++++++++++++++++ src/libxl/libxl_driver.c | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/libxl/libxl_api.h b/src/libxl/libxl_api.h index 415e2cb32c..c7174f5133 100644 --- a/src/libxl/libxl_api.h +++ b/src/libxl/libxl_api.h @@ -171,3 +171,20 @@ Libxl_Set_Vcpuonline(libxl_ctx *ctx, uint32_t domid, l= ibxl_bitmap *cpumap) =20 return ret; } + +static inline int +Libxl_Send_Trigger(libxl_ctx *ctx, + uint32_t domid, + libxl_trigger trigger, + uint32_t vcpuid) +{ + int ret; + +#if LIBXL_API_VERSION < 0x041300 + ret =3D libxl_send_trigger(ctx, domid, trigger, vcpuid); +#else + ret =3D libxl_send_trigger(ctx, domid, trigger, vcpuid, NULL); +#endif + + return ret; +} diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 1d37ae6c89..cf3a2d9775 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -1308,7 +1308,7 @@ libxlDomainShutdownFlags(virDomainPtr dom, unsigned i= nt flags) } =20 if (flags & VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN) { - ret =3D libxl_send_trigger(cfg->ctx, vm->def->id, + ret =3D Libxl_Send_Trigger(cfg->ctx, vm->def->id, LIBXL_TRIGGER_POWER, 0); if (ret =3D=3D 0) goto cleanup; From nobody Sun May 5 18:41:51 2024 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=1615978858; cv=none; d=zohomail.com; s=zohoarc; b=fyYkMUAgbGDHjgPf6GFWD6GEQ4XqlGA6MAYiNBvv0m3jWee7JUKcv0VGAZ60We/2JluRQwR5ZEcGugF2MdXDEXo/4OKw7hYkhi775gYerCyj95cx8y4dlQCAli/iSgRmgBOmWhs4oNh5BhFXS622J2TwcnbUvYV4mXUlU9AJW9c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615978858; 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=nfWv/vXSo+tTsn4zgTUHOnrXHiZRHjpRCWkbjlhn7Jg=; b=B3p+R35nZ9n+TxEqTtWjfD4MUJKr9OeQdh5zhqDg5tlzCZgQVUGfzh0gjwte3fJQGjUiCuVltZ4qA6MkRfy0kOS8ijMUwDfiCan2RFOeeatW2XHoqhuOWO2eMsjBjAIMefoV38x5IdTe3C45YNfVDxf1J75+VWspro2xZO8f8I8= 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 1615978858123788.3656316262992; Wed, 17 Mar 2021 04:00:58 -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-542-uQacFHo0NzyyGvnMv36H5Q-1; Wed, 17 Mar 2021 07:00:53 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 71E7A801817; Wed, 17 Mar 2021 11:00:46 +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 456B863BB8; Wed, 17 Mar 2021 11:00:46 +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 9DB414BB7C; Wed, 17 Mar 2021 11:00:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12HB0gYW022224 for ; Wed, 17 Mar 2021 07:00:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id E521310151F0; Wed, 17 Mar 2021 11:00:41 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E030010F8E3A for ; Wed, 17 Mar 2021 11:00:38 +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-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B3431811E9B for ; Wed, 17 Mar 2021 11:00:38 +0000 (UTC) Received: from mo4-p02-ob.smtp.rzone.de (mo4-p02-ob.smtp.rzone.de [85.215.255.83]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-348-D_ndsmFHN-SEQAfd1qULAA-1; Wed, 17 Mar 2021 07:00:35 -0400 Received: from sender by smtp.strato.de (RZmta 47.21.0 SBL|AUTH) with ESMTPSA id k0a44fx2HAvc10T (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) (Client did not present a certificate); Wed, 17 Mar 2021 11:57:38 +0100 (CET) X-MC-Unique: uQacFHo0NzyyGvnMv36H5Q-1 X-MC-Unique: D_ndsmFHN-SEQAfd1qULAA-1 X-RZG-AUTH: ":P2EQZWCpfu+qG7CngxMFH1J+3q8wa/QXkBR9MXjAuzBW/OdlBZQ4AHSS325Pjw==" X-RZG-CLASS-ID: mo00 From: Olaf Hering To: libvir-list@redhat.com Subject: [PATCH v1 11/12] libxl: add API wrapper for libxl_set_memory_target Date: Wed, 17 Mar 2021 11:57:27 +0100 Message-Id: <20210317105728.3745-12-olaf@aepfle.de> In-Reply-To: <20210317105728.3745-1-olaf@aepfle.de> References: <20210317105728.3745-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.3 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.15 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_set_memory_target, which changed the storage size of parameter "target_memkb" in Xen 4.8. No functional change intended. Signed-off-by: Olaf Hering --- src/libxl/libxl_api.h | 29 +++++++++++++++++++++++++++++ src/libxl/libxl_domain.c | 4 ++-- src/libxl/libxl_driver.c | 2 +- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/src/libxl/libxl_api.h b/src/libxl/libxl_api.h index c7174f5133..1507dbd38e 100644 --- a/src/libxl/libxl_api.h +++ b/src/libxl/libxl_api.h @@ -20,6 +20,7 @@ =20 #pragma once =20 +#include #include =20 static inline int @@ -188,3 +189,31 @@ Libxl_Send_Trigger(libxl_ctx *ctx, =20 return ret; } + +static inline int +Libxl_Set_Memory_Target(libxl_ctx *ctx, + uint32_t domid, + uint64_t target_memkb, + int relative, + int enforce) +{ + int ret =3D -1; + + /* Technically this guard could be LIBXL_HAVE_MEMKB_64BITS */ +#if LIBXL_API_VERSION < 0x040800 + if (target_memkb < UINT_MAX) + { + uint32_t val32 =3D target_memkb; + + ret =3D libxl_set_memory_target(ctx, domid, val32, relative, enfor= ce); + } +#else + if (target_memkb < LLONG_MAX) + { + int64_t val64 =3D target_memkb; + ret =3D libxl_set_memory_target(ctx, domid, val64, relative, enfor= ce); + } +#endif + + return ret; +} diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index 264a730c6c..0b0c3865fa 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -1010,7 +1010,7 @@ libxlDomainFreeMem(libxl_ctx *ctx, libxl_domain_confi= g *d_config) { uint64_t needed_mem; uint64_t free_mem; - int32_t target_mem; + uint64_t target_mem; int tries =3D 3; int wait_secs =3D 10; =20 @@ -1025,7 +1025,7 @@ libxlDomainFreeMem(libxl_ctx *ctx, libxl_domain_confi= g *d_config) return 0; =20 target_mem =3D free_mem - needed_mem; - if (libxl_set_memory_target(ctx, 0, target_mem, + if (Libxl_Set_Memory_Target(ctx, 0, target_mem, /* relative */ 1, 0) < 0) goto error; =20 diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index cf3a2d9775..97aed9949d 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -1695,7 +1695,7 @@ libxlDomainSetMemoryFlags(virDomainPtr dom, unsigned = long newmem, =20 /* Unlock virDomainObj while ballooning memory */ virObjectUnlock(vm); - res =3D libxl_set_memory_target(cfg->ctx, vm->def->id, newmem,= 0, + res =3D Libxl_Set_Memory_Target(cfg->ctx, vm->def->id, newmem,= 0, /* force */ 1); virObjectLock(vm); if (res < 0) { From nobody Sun May 5 18:41:51 2024 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=1615978674; cv=none; d=zohomail.com; s=zohoarc; b=ljQUOU7+o70lZifvT1JLMgAdQ8ZQYG8l9C7I9idLKE2xKomdEQMltQ69QYiUZD9LvhEZ+qgpTgFIkVzOS6GcSagduoJU+Q5FapUcOEwiUb7fWKy5xui9n9ngg/AXXYvvW1m6vr07a+GXs8BMcdVbERpIXpLCR4tltdK5f/FtCNs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615978674; 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=ZMW3jRLgllK+PEpSeVQDb/QWdG/tjbn5ybCw9j2go6g=; b=Jtcu2j5hE+nAvyRue4dAxIELFCpvl04rv96pf0dA4/LaD3LwWtj77Hl4nhdvGMM5kABxpw5onPt0hv7qaB8zg/nq5GfOWGgmuPiqkczVdZKUqsb9WnNUA3vOaVFweIETPHjD35cQaLd1QC++9K27JXGbzwSWnGogFT8jEeXFwTk= 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 1615978674536357.0480492818705; Wed, 17 Mar 2021 03:57:54 -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-588-4pNXAbHOPqKVoDzDXur_MQ-1; Wed, 17 Mar 2021 06:57:51 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DEFAF107ACCA; Wed, 17 Mar 2021 10:57:46 +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 B90895D9D3; Wed, 17 Mar 2021 10:57:46 +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 6D86F4BB7C; Wed, 17 Mar 2021 10:57:46 +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 12HAvim3021639 for ; Wed, 17 Mar 2021 06:57:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 71B09E2030; Wed, 17 Mar 2021 10:57:44 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6C835E56AA for ; Wed, 17 Mar 2021 10:57:44 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (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 54DAC800140 for ; Wed, 17 Mar 2021 10:57:44 +0000 (UTC) Received: from mo4-p02-ob.smtp.rzone.de (mo4-p02-ob.smtp.rzone.de [85.215.255.84]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-247-IEuH8KzJO9WxRMb1OqEekQ-1; Wed, 17 Mar 2021 06:57:42 -0400 Received: from sender by smtp.strato.de (RZmta 47.21.0 SBL|AUTH) with ESMTPSA id k0a44fx2HAvd10U (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) (Client did not present a certificate); Wed, 17 Mar 2021 11:57:39 +0100 (CET) X-MC-Unique: 4pNXAbHOPqKVoDzDXur_MQ-1 X-MC-Unique: IEuH8KzJO9WxRMb1OqEekQ-1 X-RZG-AUTH: ":P2EQZWCpfu+qG7CngxMFH1J+3q8wa/QXkBR9MXjAuzBW/OdlBZQ4AHSS325Pjw==" X-RZG-CLASS-ID: mo00 From: Olaf Hering To: libvir-list@redhat.com Subject: [PATCH v1 12/12] libxl: use API 4.13 to support domUs with more than 4TB Date: Wed, 17 Mar 2021 11:57:28 +0100 Message-Id: <20210317105728.3745-13-olaf@aepfle.de> In-Reply-To: <20210317105728.3745-1-olaf@aepfle.de> References: <20210317105728.3745-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.14 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" To support domUs with more than 4TB memory it is required to use LIBXL_API_VERSION >=3D 0x040800, which uses uint64_t for certained guest memory related quantities. Unfortunately this change is not straight forward. While most of the code in libxl.h handles the various LIBXL_API_VERSION variants correctly, the check for valid a LIBXL_API_VERSION at the beginning of the file was broken between Xen 4.7 and 4.13 - it did not cover for API changes introduced in Xen 4.7 and 4.8. This was fixed with xen-project/xen@c3999835df, which for libvirt means in practice either the libxl API from Xen 4.5 or 4.13+ can be used. This change uses pkgconfig to decide which API can be safely selected. Xen provides a pkgconfig file since Xen 4.6, which is also the lowest version expected by libvirt. Signed-off-by: Olaf Hering --- meson.build | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index ea93a2a8ec..d246886cbf 100644 --- a/meson.build +++ b/meson.build @@ -1592,8 +1592,13 @@ if not get_option('driver_libxl').disabled() and con= f.has('WITH_LIBVIRTD') xtl_link_dep =3D cc.find_library('xenctrl') endif =20 + if libxl_dep.version().version_compare('>=3D4.13.0') + LIBXL_API_VERSION=3D'0x041300' + else + LIBXL_API_VERSION=3D'0x040500' + endif libxl_dep =3D declare_dependency( - compile_args: '-DLIBXL_API_VERSION=3D0x040500', + compile_args: '-DLIBXL_API_VERSION=3D' + LIBXL_API_VERSION, dependencies: [ libxl_dep, xtl_link_dep,