From nobody Thu May 9 19:50:53 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=1616689629; cv=none; d=zohomail.com; s=zohoarc; b=Xl5aV1Pi4+PUW0wUe1yTCZ+kiOGNUpfxB1/Xj+GzAW6oDi+gJqHPq+RlCpu57xQGhNJGR71iNQeU9nFoMJxTHVgOhv1Y9jLU5K4wzRAdxhVeA+RcUoO/kSfcbQ2j/9e+qObaw/ZN8lBbz+KgRGtJzU9Dgah5FKmoZyO699dYlek= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616689629; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=nGZ11MY04wmtDIKqPn32mb8GkRLjlreepxloHIkQKqA=; b=KHgnMYLT+NrLmtRQ9MgLiCCcuWlOH200Rr/wnYnDF/WUq+wrUNEhxm7oYmQxuyPW/k7CTNrBvgKiZeXmIKa45VnIMhjRcWptmDegrSk/f6cKpcPmt8okP1oQ6vDBILNB8PFuWSXegw67CgY/U0DctTiVBgP5hjD1YwZWcm2MkjM= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 161668962941417.770453495674815; Thu, 25 Mar 2021 09:27:09 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-428-ZYNK-JfpNbi89_UlBGhYYw-1; Thu, 25 Mar 2021 12:27:03 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D97CC801817; Thu, 25 Mar 2021 16:26:58 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B29C75C260; Thu, 25 Mar 2021 16:26:58 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 74A874A707; Thu, 25 Mar 2021 16:26:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12PGQRxI032177 for ; Thu, 25 Mar 2021 12:26:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9FCBCF7822; Thu, 25 Mar 2021 16:26:27 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 94F25F7821 for ; Thu, 25 Mar 2021 16:26:23 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 15D05800B29 for ; Thu, 25 Mar 2021 16:26:23 +0000 (UTC) Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [81.169.146.160]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-243-srxZIvBONECUO0Bywg5Dhg-1; Thu, 25 Mar 2021 12:26:20 -0400 Received: from sender by smtp.strato.de (RZmta 47.22.0 SBL|AUTH) with ESMTPSA id 204541x2PGQH6TL (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) (Client did not present a certificate); Thu, 25 Mar 2021 17:26:17 +0100 (CET) X-MC-Unique: ZYNK-JfpNbi89_UlBGhYYw-1 X-MC-Unique: srxZIvBONECUO0Bywg5Dhg-1 X-RZG-AUTH: ":P2EQZWCpfu+qG7CngxMFH1J+3q8wa/QXkBR9MXjAuzBW/OdlBZQ4AHSS32Qg" X-RZG-CLASS-ID: mo00 From: Olaf Hering To: libvir-list@redhat.com Subject: [PATCH v2 01/12] libxl: add API wrapper for libxl_domain_create_restore Date: Thu, 25 Mar 2021 17:26:01 +0100 Message-Id: <20210325162612.8355-2-olaf@aepfle.de> In-Reply-To: <20210325162612.8355-1-olaf@aepfle.de> References: <20210325162612.8355-1-olaf@aepfle.de> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Olaf Hering X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Upcoming changes will use different LIBXL_API_VERSION variants. Prepare libxl_domain_create_restore, which got a new parameter "send_back_fd" in Xen 4.7. libvirt does not use this parameter. No functional change intended. Signed-off-by: Olaf Hering Reviewed-by: Jim Fehlig --- src/libxl/libxl_api_wrapper.h | 44 +++++++++++++++++++++++++++++++++++ src/libxl/libxl_domain.c | 5 ++-- 2 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 src/libxl/libxl_api_wrapper.h diff --git a/src/libxl/libxl_api_wrapper.h b/src/libxl/libxl_api_wrapper.h new file mode 100644 index 0000000000..3b988db5b9 --- /dev/null +++ b/src/libxl/libxl_api_wrapper.h @@ -0,0 +1,44 @@ +/* + * libxl_api_wrapper.h: handle various libxl API variants + * + * Copyright (C) 2021 SUSE LLC + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * . + */ + +#pragma once + +#include + +static inline int +libxlDomainCreateRestoreWrapper(libxl_ctx *ctx, + libxl_domain_config *d_config, + uint32_t *domid, + int restore_fd, + const libxl_domain_restore_params *params, + const libxl_asyncprogress_how *aop_console= _how) +{ + int ret; + +#if LIBXL_API_VERSION < 0x040700 + ret =3D libxl_domain_create_restore(ctx, d_config, domid, restore_fd, = params, + NULL, aop_console_how); +#else + ret =3D libxl_domain_create_restore(ctx, d_config, domid, restore_fd, = -1, + params, NULL, aop_console_how); +#endif + + return ret; +} diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index 014f6aceca..9adba9f2bf 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -22,6 +22,7 @@ =20 #include =20 +#include "libxl_api_wrapper.h" #include "libxl_domain.h" #include "libxl_capabilities.h" =20 @@ -1396,8 +1397,8 @@ libxlDomainStart(libxlDriverPrivatePtr driver, #ifdef LIBXL_HAVE_SRM_V2 params.stream_version =3D restore_ver; #endif - ret =3D libxl_domain_create_restore(cfg->ctx, &d_config, &domid, - restore_fd, ¶ms, NULL, + ret =3D libxlDomainCreateRestoreWrapper(cfg->ctx, &d_config, &domi= d, + restore_fd, ¶ms, &aop_console_how); libxl_domain_restore_params_dispose(¶ms); } From nobody Thu May 9 19:50:53 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=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 Reviewed-by: Jim Fehlig --- 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); From nobody Thu May 9 19:50:53 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=1616689620; cv=none; d=zohomail.com; s=zohoarc; b=RgAgsryfvK/726R+7iBuFdUeJnUjbzlO4ZLAlP6Fp0Ms/u/zqSZy7WMrSuyFc3K76I3DwhqBDwWfRQhQL/8s5mAx3Zt/fl2Yv154uIOoSIAVPnGQN/g9LGjmsIRxEwefmSmR2grK/VGdDHV+SA2WTRRVk0gZ+fGXzqp4+IzGNwY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616689620; 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=R0kAzSFtgCTkAw+/5u/JiGz+YCx3EpuiVxc49nxZ6As=; b=LJowsmNwAl4ORdZi7ConGO3z69ADXXrSjJD/j0Fugmp3apGzNf5cUI2ktvbQVNAqjmm9S4oSNoMriwb6AM8Gbq+R0T1MZXJBLB+xSo5e6UFJ7tx/2rDN7YeAZlYjImi2eMBzmm2YSTlirf+8jq1/iCyaCiytud/GIq4bIxqkq6A= 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 1616689620744825.2247674623071; Thu, 25 Mar 2021 09:27:00 -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-37-cKP4AS5-OO-CUZUFDUuE9A-1; Thu, 25 Mar 2021 12:26:57 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8A58580006E; Thu, 25 Mar 2021 16:26:50 +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 5BE2E100E113; 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 07632180B451; Thu, 25 Mar 2021 16:26:50 +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 12PGQQTt032138 for ; Thu, 25 Mar 2021 12:26:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id EAD3E2026D65; Thu, 25 Mar 2021 16:26:25 +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 E5D792026D48 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 2F0CE100DE7A 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-304-QyuG80qyOvS1l80p8cK7pQ-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 204541x2PGQI6TN (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: cKP4AS5-OO-CUZUFDUuE9A-1 X-MC-Unique: QyuG80qyOvS1l80p8cK7pQ-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 03/12] libxl: add API wrapper for libxl_domain_shutdown Date: Thu, 25 Mar 2021 17:26:03 +0100 Message-Id: <20210325162612.8355-4-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.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.84 on 10.5.11.22 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 Reviewed-by: Jim Fehlig --- src/libxl/libxl_api_wrapper.h | 14 ++++++++++++++ src/libxl/libxl_driver.c | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/libxl/libxl_api_wrapper.h b/src/libxl/libxl_api_wrapper.h index 4763947b50..8b25c3fc9e 100644 --- a/src/libxl/libxl_api_wrapper.h +++ b/src/libxl/libxl_api_wrapper.h @@ -58,3 +58,17 @@ libxlRetrieveDomainConfigurationWrapper(libxl_ctx *ctx, =20 return ret; } + +static inline int +libxlDomainShutdownWrapper(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..d5e53154de 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_wrapper.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 libxlDomainShutdownWrapper(cfg->ctx, vm->def->id); if (ret =3D=3D 0) goto cleanup; =20 From nobody Thu May 9 19:50:53 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=1616689626; cv=none; d=zohomail.com; s=zohoarc; b=lP6fY+g5pGo7+EtusNFithbiXyOs/JpkTwK8kbttYieaVPRQqCOiI5rlcEkScfBa+/5v7TTnv/N3fauL973eW619Qo50jwNAZ9cOGXex0AvSftSKWlQewJhTsTGTYe923vYHcyygGOOIOSadJD+BVbtbfxrWotgf3hPOUJ+E97Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616689626; 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=r+LxFBZ91LhzJCy8ChtwPr5S101gQMG98TSpRwZ86/I=; b=B5+imwsgpF+V5YV+mNLTsePiJE3F4V3reKSzsg9CWkwtUnAGLWQA1wJ0iTatxKX3GS8hiAJRLVqUO9aWrHvwFNUTsT8K/m+8AF3IIrf4BAxc4UT0ePkjnX3MNU/svR1Rr92BBYsIPKZ5hKnTVyxqQU8ffAK4Zi0GgFCzjedMua0= 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 1616689626341896.7814365701357; Thu, 25 Mar 2021 09:27:06 -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-105-9inee_8uMOeam6TIj8dpUg-1; Thu, 25 Mar 2021 12:27:00 -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 045A287A83E; Thu, 25 Mar 2021 16:26: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 D434650EDF; Thu, 25 Mar 2021 16:26:53 +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 93559180C5A8; Thu, 25 Mar 2021 16:26:53 +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 12PGQQY2032149 for ; Thu, 25 Mar 2021 12:26:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3B10610500D3; Thu, 25 Mar 2021 16:26:26 +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 35F0A10500D5 for ; Thu, 25 Mar 2021 16:26:23 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 90CE9800B28 for ; Thu, 25 Mar 2021 16:26:23 +0000 (UTC) Received: from mo4-p01-ob.smtp.rzone.de (mo4-p01-ob.smtp.rzone.de [81.169.146.165]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-299-Kz_z0mhnNs-_JGeeS8WJOA-1; Thu, 25 Mar 2021 12:26:21 -0400 Received: from sender by smtp.strato.de (RZmta 47.22.0 SBL|AUTH) with ESMTPSA id 204541x2PGQI6TO (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: 9inee_8uMOeam6TIj8dpUg-1 X-MC-Unique: Kz_z0mhnNs-_JGeeS8WJOA-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 04/12] libxl: add API wrapper for libxl_domain_reboot Date: Thu, 25 Mar 2021 17:26:04 +0100 Message-Id: <20210325162612.8355-5-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.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.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_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 Reviewed-by: Jim Fehlig --- src/libxl/libxl_api_wrapper.h | 14 ++++++++++++++ src/libxl/libxl_driver.c | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/libxl/libxl_api_wrapper.h b/src/libxl/libxl_api_wrapper.h index 8b25c3fc9e..6744ba7db3 100644 --- a/src/libxl/libxl_api_wrapper.h +++ b/src/libxl/libxl_api_wrapper.h @@ -72,3 +72,17 @@ libxlDomainShutdownWrapper(libxl_ctx *ctx, uint32_t domi= d) =20 return ret; } + +static inline int +libxlDomainRebootWrapper(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 d5e53154de..cad008c1f5 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 libxlDomainRebootWrapper(cfg->ctx, vm->def->id); if (ret =3D=3D 0) goto cleanup; =20 From nobody Thu May 9 19:50:53 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=1616689604; cv=none; d=zohomail.com; s=zohoarc; b=NWy9Dm0E1G3MjTxHdhhvvrx27iTcZrnSkuxMSdAH1qt9kDg+mkyqDQ1Xb38DV1hDBTGHYymOh/9EXJNug/+uYu25p8F28bCSG0MgutQdhSrekIggS8TKHAapMgpc69URdJnVt0/NBEdrfoUnqwpeTTMLQveGyz/UN3WGmyhYvi8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616689604; 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=OdvlxfJ6bszmpXcqTQq9fe7nD/wzSm4EKrqzMqNIlg4=; b=i74JWD0zAs8wqmfKaIDLWBrk7HQgwr5jy8CCdXxFZxwwYERCrnAShJVjjr4MtVYei/vaYeVoDVAzCXzwx3nIcPZvFlDef63XBuEMIf+Jj415FyUm1Zm+g3tAt32zDxEGefi3WAS3ZAHKzJp89yAVvcsogKp1p1nct+Jct4/1AX0= 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 1616689604579959.5551875105416; Thu, 25 Mar 2021 09:26:44 -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-541-7aeRd3eAN2yH5dQIQh77lw-1; Thu, 25 Mar 2021 12:26:38 -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 9C65B8189D7; Thu, 25 Mar 2021 16:26:32 +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 21C3960CCF; Thu, 25 Mar 2021 16:26:32 +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 3A92C1809C83; Thu, 25 Mar 2021 16:26:28 +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 12PGQPDN032137 for ; Thu, 25 Mar 2021 12:26:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id CA89520E1D89; 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 C3C8520E1D86 for ; Thu, 25 Mar 2021 16:26:24 +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 873C0802C1C for ; Thu, 25 Mar 2021 16:26:24 +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-476-7X4ycw72M9ylgp2JUaUGvw-1; Thu, 25 Mar 2021 12:26:21 -0400 Received: from sender by smtp.strato.de (RZmta 47.22.0 SBL|AUTH) with ESMTPSA id 204541x2PGQJ6TP (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) (Client did not present a certificate); Thu, 25 Mar 2021 17:26:19 +0100 (CET) X-MC-Unique: 7aeRd3eAN2yH5dQIQh77lw-1 X-MC-Unique: 7X4ycw72M9ylgp2JUaUGvw-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 05/12] libxl: add API wrapper for libxl_domain_pause Date: Thu, 25 Mar 2021 17:26:05 +0100 Message-Id: <20210325162612.8355-6-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.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_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 Reviewed-by: Jim Fehlig --- src/libxl/libxl_api_wrapper.h | 14 ++++++++++++++ src/libxl/libxl_driver.c | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/libxl/libxl_api_wrapper.h b/src/libxl/libxl_api_wrapper.h index 6744ba7db3..c912aabadb 100644 --- a/src/libxl/libxl_api_wrapper.h +++ b/src/libxl/libxl_api_wrapper.h @@ -86,3 +86,17 @@ libxlDomainRebootWrapper(libxl_ctx *ctx, uint32_t domid) =20 return ret; } + +static inline int +libxlDomainPauseWrapper(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 cad008c1f5..afde679269 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 (libxlDomainPauseWrapper(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 (libxlDomainPauseWrapper(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 Thu May 9 19:50:53 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=1616689638; cv=none; d=zohomail.com; s=zohoarc; b=mjpSuXKT0BtcWzXwVU+YNjxK48Ewj5EidXFLGpGBPQGajrqo+QEbdrzIHiOaArrS9aaQUluplHd/+yRv20z1BPF9YKPaA/JMU32EWF1py1c3/GOgd5mQmFCLgqMDFoUk9Zq0NBdrBkuoj7hSh+b4w5jU3/+zNemsqVUk8wz8YMM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616689638; 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=A0lzwEQTd2EkTYuqbNNZ5Ki9r6wyMO0Zc0kbVma5cew=; b=kNL6axaCIo48Z+Bx0m9XKWLcRTKCLn8PuD58xnMa7h3G3QdlxPPKH1B+rs08zhr/B2XWqMymvE+mKgzhxJIXtizGkQyBjOzkUuh4lMP69aXE17AtArFkRx8hoGBMJF3hyEvZwLCW1qvvinpl6xoDW9NIFUZOO8pg+e4VIgzMjPU= 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 1616689638863134.31424246341953; Thu, 25 Mar 2021 09:27:18 -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-586-kT88NIiyM86WBtk-VkyAZg-1; Thu, 25 Mar 2021 12:27:11 -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 24151108BD09; Thu, 25 Mar 2021 16:27:05 +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 F13E05C559; Thu, 25 Mar 2021 16:27:04 +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 B0E0418045CA; Thu, 25 Mar 2021 16:27:04 +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 12PGQR2J032175 for ; Thu, 25 Mar 2021 12:26:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9F50EF7823; Thu, 25 Mar 2021 16:26:27 +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 94A14F77D3 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 DB86C858EED for ; Thu, 25 Mar 2021 16:26:23 +0000 (UTC) Received: from mo4-p01-ob.smtp.rzone.de (mo4-p01-ob.smtp.rzone.de [81.169.146.164]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-42-dekAcL_fNESXBJf9AtICqw-1; Thu, 25 Mar 2021 12:26:21 -0400 Received: from sender by smtp.strato.de (RZmta 47.22.0 SBL|AUTH) with ESMTPSA id 204541x2PGQJ6TQ (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) (Client did not present a certificate); Thu, 25 Mar 2021 17:26:19 +0100 (CET) X-MC-Unique: kT88NIiyM86WBtk-VkyAZg-1 X-MC-Unique: dekAcL_fNESXBJf9AtICqw-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 06/12] libxl: add API wrapper for libxl_domain_unpause Date: Thu, 25 Mar 2021 17:26:06 +0100 Message-Id: <20210325162612.8355-7-olaf@aepfle.de> In-Reply-To: <20210325162612.8355-1-olaf@aepfle.de> References: <20210325162612.8355-1-olaf@aepfle.de> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Olaf Hering X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Upcoming changes will use different LIBXL_API_VERSION variants. Prepare libxl_domain_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 Reviewed-by: Jim Fehlig --- src/libxl/libxl_api_wrapper.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_wrapper.h b/src/libxl/libxl_api_wrapper.h index c912aabadb..13200cfec6 100644 --- a/src/libxl/libxl_api_wrapper.h +++ b/src/libxl/libxl_api_wrapper.h @@ -100,3 +100,17 @@ libxlDomainPauseWrapper(libxl_ctx *ctx, uint32_t domid) =20 return ret; } + +static inline int +libxlDomainUnpauseWrapper(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 809108fd7d..a034fe2219 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); + libxlDomainUnpauseWrapper(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); + libxlDomainUnpauseWrapper(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 afde679269..a2642e9d94 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 (libxlDomainUnpauseWrapper(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 (libxlDomainUnpauseWrapper(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..a99021031d 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_wrapper.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 (libxlDomainUnpauseWrapper(cfg->ctx, vm->def->id) !=3D 0) { virReportError(VIR_ERR_OPERATION_FAILED, "%s", _("Failed to unpause domain")); goto cleanup; From nobody Thu May 9 19:50:53 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=1616689629; cv=none; d=zohomail.com; s=zohoarc; b=oJgim18DLhcInDrsr1uYbRP7JaLXZ+XwIn2i++UAIf2dEtHqW9Q4CwaT2YcEKO3MfCi3PXEF2m+WH56Y+zoiCBI53iT4SjcJvvH2y4DwizZCbAsRm0LAo0eygJU2adCBpjLkoCWuFS5APm48XY28gxzcRKHFHkDx2W7oXP6EYak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616689629; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mEDID88D5QBde1ozTDsFzex4rfszsr7EbEgQJkjhIPk=; b=lYjdvdhki20wRgQ0e+VpXLjDbc/he/RVTrptAOoT7krZs2BhrCoKRin/VNG9EiWL77Mel2W5xABVwl1QMIobge6mtogjS1H3LW8C38W0QSRQqwC7QM9YRRsYk9hHfxscFfipfd6olAPYjlWtka504lHABWVgN+9RwZOp7pbZePA= 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 1616689629022640.3713650999288; Thu, 25 Mar 2021 09:27:09 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-488-Bs23cMk_OfOf2aF4fkKwFg-1; Thu, 25 Mar 2021 12:27:03 -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 7B51C180FCAE; Thu, 25 Mar 2021 16:26:58 +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 593215B4B5; Thu, 25 Mar 2021 16:26:58 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1BBF61802139; Thu, 25 Mar 2021 16:26:58 +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 12PGQQd7032148 for ; Thu, 25 Mar 2021 12:26:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3741120E1D81; Thu, 25 Mar 2021 16:26:26 +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 3212720E1D80 for ; Thu, 25 Mar 2021 16:26:26 +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 173CA185A7B4 for ; Thu, 25 Mar 2021 16:26:26 +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-434-e_4W7ukdOUCLGahOddjH-g-1; Thu, 25 Mar 2021 12:26:22 -0400 Received: from sender by smtp.strato.de (RZmta 47.22.0 SBL|AUTH) with ESMTPSA id 204541x2PGQJ6TR (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) (Client did not present a certificate); Thu, 25 Mar 2021 17:26:19 +0100 (CET) X-MC-Unique: Bs23cMk_OfOf2aF4fkKwFg-1 X-MC-Unique: e_4W7ukdOUCLGahOddjH-g-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 07/12] libxl: add API wrapper for libxl_domain_need_memory Date: Thu, 25 Mar 2021 17:26:07 +0100 Message-Id: <20210325162612.8355-8-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.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 Reviewed-by: Jim Fehlig --- src/libxl/libxl_api_wrapper.h | 24 ++++++++++++++++++++++++ src/libxl/libxl_domain.c | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/libxl/libxl_api_wrapper.h b/src/libxl/libxl_api_wrapper.h index 13200cfec6..193f971919 100644 --- a/src/libxl/libxl_api_wrapper.h +++ b/src/libxl/libxl_api_wrapper.h @@ -114,3 +114,27 @@ libxlDomainUnpauseWrapper(libxl_ctx *ctx, uint32_t dom= id) =20 return ret; } + +#define INVALID_DOMID ~0 +static inline int +libxlDomainNeedMemoryWrapper(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 a034fe2219..d6554bc230 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 (libxlDomainNeedMemoryWrapper(ctx, d_config, &needed_mem) < 0) goto error; =20 do { From nobody Thu May 9 19:50:53 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=1616689631; cv=none; d=zohomail.com; s=zohoarc; b=n7Hmh1BDMi1DqI1qsM1YgcbrhFP+rfotvn1KUxwqcZHfHx96Ai1tIrskxwpCuCUc9Tny2dw1qrSAKS49QKFE8Pn2ikZgDZjLpXTgCNuLFxJYoTJytCQ5KoqVo6W/XvneWXxLHu9s6u1p9LW1oe75FPmcJnc7WZDWc/x55JIOLPo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616689631; 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=220mIpNhQht9t3HtzCjL9DLKlehwD6TQDcaOZXUfyeA=; b=mrM5LsMnY9v6domvwdh11HKjPJ5/TYvDSB7KS4jGOCHY1KQlV6pjifv9yzced4qQd1Pi9+Kslf+h+m2n2SpxYdeYG0q5sjE06d5IpN4G6hd8lgfILJg8pQEz6zwUHcefQdlWQBJCHT25kiHeUPkg+3yrITGDIfWWG8zIQboNX1s= 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 1616689631943381.80215648913907; Thu, 25 Mar 2021 09:27:11 -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-145-H_No5wQUPaaUFiin0yX_fw-1; Thu, 25 Mar 2021 12:27:08 -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 D61C01018F7B; Thu, 25 Mar 2021 16:27:01 +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 AD24E5D74B; Thu, 25 Mar 2021 16:27:01 +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 70C271800662; Thu, 25 Mar 2021 16:27:01 +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 12PGQRRg032176 for ; Thu, 25 Mar 2021 12:26:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id A3790F7820; Thu, 25 Mar 2021 16:26:27 +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 9AE81F77B3 for ; Thu, 25 Mar 2021 16:26:25 +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 582C38316F2 for ; Thu, 25 Mar 2021 16:26:25 +0000 (UTC) Received: from mo4-p01-ob.smtp.rzone.de (mo4-p01-ob.smtp.rzone.de [85.215.255.51]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-548-i6XzeAoXMTOB1cUMiYeyZw-1; Thu, 25 Mar 2021 12:26:23 -0400 Received: from sender by smtp.strato.de (RZmta 47.22.0 SBL|AUTH) with ESMTPSA id 204541x2PGQK6TS (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) (Client did not present a certificate); Thu, 25 Mar 2021 17:26:20 +0100 (CET) X-MC-Unique: H_No5wQUPaaUFiin0yX_fw-1 X-MC-Unique: i6XzeAoXMTOB1cUMiYeyZw-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 08/12] libxl: add API wrapper for libxl_get_free_memory Date: Thu, 25 Mar 2021 17:26:08 +0100 Message-Id: <20210325162612.8355-9-olaf@aepfle.de> In-Reply-To: <20210325162612.8355-1-olaf@aepfle.de> References: <20210325162612.8355-1-olaf@aepfle.de> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Olaf Hering X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.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_get_free_memory, which changed storage size of parameter "memkb" in Xen 4.8. No functional change intended. Signed-off-by: Olaf Hering Reviewed-by: Jim Fehlig --- src/libxl/libxl_api_wrapper.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_wrapper.h b/src/libxl/libxl_api_wrapper.h index 193f971919..a400bbd5a3 100644 --- a/src/libxl/libxl_api_wrapper.h +++ b/src/libxl/libxl_api_wrapper.h @@ -138,3 +138,22 @@ libxlDomainNeedMemoryWrapper(libxl_ctx *ctx, =20 return ret; } + +static inline int +libxlGetFreeMemoryWrapper(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..8fe04fd8e0 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_wrapper.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 (libxlGetFreeMemoryWrapper(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 d6554bc230..ac613b96b9 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 (libxlGetFreeMemoryWrapper(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..604dc4bfbe 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 Thu May 9 19:50:53 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=1616689631; cv=none; d=zohomail.com; s=zohoarc; b=AHt61cQmMqHHXL/ST+cfcCxKxApA9GaP7UyBPg6edq9mMx2ZMXC/Xqfg2dfvqvmgyMTquGvL1EIqSWCp/EFm0tsVbMYe5+PK3do4RhocfhcjJ58W3fS9E1DhnhE6wHkM/1zlqw2DHOO4pIbs4/sSh/HJBUV6NygU8hAQW7k/zCs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616689631; 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=Y9gQBLSDMRjS0FIhgUG9x4hPmzS48Rt8jMdGg3Oyst8=; b=BpyCew+M8ucl58GusV+8g1zsJHkIwuqDNwNbKhAT5DnGpQOk+rh2ZwZnKneb31zKHNR80s6Ch538QvhnzRHuoYIh8+yqJr/vEKc55VormYaUEBHw+iPfGvNUH0xUiznrWiyJflyI7UGsq38YlA1N7K+X/yJw8+hXpJ5NnYYnX10= 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 1616689631728491.6835937108649; Thu, 25 Mar 2021 09:27:11 -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-335-ZJrVvuayO6aDsSYO_-LIaw-1; Thu, 25 Mar 2021 12:27:07 -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 6C2E5881276; Thu, 25 Mar 2021 16:26:58 +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 EC7435C559; Thu, 25 Mar 2021 16:26: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 B07411802137; Thu, 25 Mar 2021 16:26:57 +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 12PGQRMH032178 for ; Thu, 25 Mar 2021 12:26:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id A3036F77D3; Thu, 25 Mar 2021 16:26:27 +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 98934568DC for ; Thu, 25 Mar 2021 16:26:26 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.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 EAFA885A5B9 for ; Thu, 25 Mar 2021 16:26:25 +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-496-NefxT7o9PrS7ocg1BRbGKw-1; Thu, 25 Mar 2021 12:26:23 -0400 Received: from sender by smtp.strato.de (RZmta 47.22.0 SBL|AUTH) with ESMTPSA id 204541x2PGQK6TT (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) (Client did not present a certificate); Thu, 25 Mar 2021 17:26:20 +0100 (CET) X-MC-Unique: ZJrVvuayO6aDsSYO_-LIaw-1 X-MC-Unique: NefxT7o9PrS7ocg1BRbGKw-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 09/12] libxl: add API wrapper for libxl_set_vcpuonline Date: Thu, 25 Mar 2021 17:26:09 +0100 Message-Id: <20210325162612.8355-10-olaf@aepfle.de> In-Reply-To: <20210325162612.8355-1-olaf@aepfle.de> References: <20210325162612.8355-1-olaf@aepfle.de> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Olaf Hering X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Upcoming changes will use different LIBXL_API_VERSION variants. Prepare libxl_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 Reviewed-by: Jim Fehlig --- src/libxl/libxl_api_wrapper.h | 14 ++++++++++++++ src/libxl/libxl_driver.c | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/libxl/libxl_api_wrapper.h b/src/libxl/libxl_api_wrapper.h index a400bbd5a3..047089ed25 100644 --- a/src/libxl/libxl_api_wrapper.h +++ b/src/libxl/libxl_api_wrapper.h @@ -157,3 +157,17 @@ libxlGetFreeMemoryWrapper(libxl_ctx *ctx, uint64_t *me= mkb) =20 return ret; } + +static inline int +libxlSetVcpuonlineWrapper(libxl_ctx *ctx, uint32_t domid, libxl_bitmap *cp= umap) +{ + 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 a2642e9d94..7c93a9a4db 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 (libxlSetVcpuonlineWrapper(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 (libxlSetVcpuonlineWrapper(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 Thu May 9 19:50:53 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=1616689623; cv=none; d=zohomail.com; s=zohoarc; b=OS/ziIz2+zhPN/aZqvrFODFFdjX83kY3wQUmhLokJ1aEW3i4Wxi2r9ImyUkwfJGXDUqJX6GaVQU93eAjahUhYZQb3TcQBOhbakEhKys394QXYa+Wh60W2eYggERFNDAnObxMfbbnfk6AxDIBPWMGM558PRKH+k7LdGSztqgZYS4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616689623; 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=nGU72tdjqprWGLSRn2hPsDUuPS6LVDNSEbSVaOwqFhU=; b=BK4+nlLMLeZIaMVQYbGmkGX3z7InleDpMTLN6iD1q5i1dS5e3e6yr3B1B5o4dUPZlEfQlDmQh4FiPIGYF67uYt4PWPa0Ay0vdOl4PWuw9trYiwAE6knUgHR+WYNZA4oidStsTfm16N/b7ktBo7+RhGvWyMs2Shqavannz07GbGw= 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 1616689623166196.3467127264597; Thu, 25 Mar 2021 09:27: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-408-3_hXV0ixP16zJCLhLNVEMw-1; Thu, 25 Mar 2021 12:26:59 -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 BEB1F8189C7; Thu, 25 Mar 2021 16:26:54 +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 9A0C85D9E3; Thu, 25 Mar 2021 16:26: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 5D74C4A706; Thu, 25 Mar 2021 16:26:54 +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 12PGQQ9a032147 for ; Thu, 25 Mar 2021 12:26:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1F7B920E1D83; Thu, 25 Mar 2021 16:26:26 +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 1A6DA20E1D81 for ; Thu, 25 Mar 2021 16:26:26 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.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 019FF800B24 for ; Thu, 25 Mar 2021 16:26:26 +0000 (UTC) Received: from mo4-p02-ob.smtp.rzone.de (mo4-p02-ob.smtp.rzone.de [81.169.146.171]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-287-WQuedGP0MTCOqMnjR8_bjw-1; Thu, 25 Mar 2021 12:26:23 -0400 Received: from sender by smtp.strato.de (RZmta 47.22.0 SBL|AUTH) with ESMTPSA id 204541x2PGQL6TU (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) (Client did not present a certificate); Thu, 25 Mar 2021 17:26:21 +0100 (CET) X-MC-Unique: 3_hXV0ixP16zJCLhLNVEMw-1 X-MC-Unique: WQuedGP0MTCOqMnjR8_bjw-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 10/12] libxl: add API wrapper for libxl_send_trigger Date: Thu, 25 Mar 2021 17:26:10 +0100 Message-Id: <20210325162612.8355-11-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.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_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 Reviewed-by: Jim Fehlig --- src/libxl/libxl_api_wrapper.h | 17 +++++++++++++++++ src/libxl/libxl_driver.c | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/libxl/libxl_api_wrapper.h b/src/libxl/libxl_api_wrapper.h index 047089ed25..26c2215cb7 100644 --- a/src/libxl/libxl_api_wrapper.h +++ b/src/libxl/libxl_api_wrapper.h @@ -171,3 +171,20 @@ libxlSetVcpuonlineWrapper(libxl_ctx *ctx, uint32_t dom= id, libxl_bitmap *cpumap) =20 return ret; } + +static inline int +libxlSendTriggerWrapper(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 7c93a9a4db..18098734fc 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -1308,8 +1308,8 @@ 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, - LIBXL_TRIGGER_POWER, 0); + ret =3D libxlSendTriggerWrapper(cfg->ctx, vm->def->id, + LIBXL_TRIGGER_POWER, 0); if (ret =3D=3D 0) goto cleanup; =20 From nobody Thu May 9 19:50:53 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=1616689601; cv=none; d=zohomail.com; s=zohoarc; b=jVa18TuQHTk3R4kR9FObJkZg6Cg6uNUfLIOMUN+K3zpZyLZVDnZX4YIEkEoYA64yITHKp6xjl5/265XTWEnBnbrB0NT4JbE0ow6cHJ1ODO3o0ahU03IXIs50MrAM7o6UkU2aZ2a5oY8eS32Apll8Ejylp1J/iIc+133yiA0uBbs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616689601; 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=QE6hw45T14W487UPFaSAanfrfDnQc1vl3wMwhbOEfhk=; b=SUTCsmuCVQMpECAbft2UvpSfHp/exO9pUxaYf6sKYHxeaqyosae8kO/loryDjlPL2w93cwKXRyY/wKPFF+C7EZevVnqMovRgiG/MXuRtjomFS4+N4bD8RdLIQOyyQC1JDVZZ43TI670iOPLQ67N51JVESImLLWjS2DRiBE8Zqcc= 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 1616689601261459.56604989310586; Thu, 25 Mar 2021 09:26:41 -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-564-J_0BvgIDOW64qxDOIo9rYQ-1; Thu, 25 Mar 2021 12:26:37 -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 E20BF8189D8; Thu, 25 Mar 2021 16:26:32 +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 259C050AC0; Thu, 25 Mar 2021 16:26:32 +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 926631809C84; Thu, 25 Mar 2021 16:26:28 +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 12PGQQXo032170 for ; Thu, 25 Mar 2021 12:26:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id C08D120E1D81; Thu, 25 Mar 2021 16:26:26 +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 BA7DF20E1D80 for ; Thu, 25 Mar 2021 16:26:26 +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 A20818007B1 for ; Thu, 25 Mar 2021 16:26:26 +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-451-XjxetckCORSvLV8SrJDywg-1; Thu, 25 Mar 2021 12:26:24 -0400 Received: from sender by smtp.strato.de (RZmta 47.22.0 SBL|AUTH) with ESMTPSA id 204541x2PGQL6TV (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) (Client did not present a certificate); Thu, 25 Mar 2021 17:26:21 +0100 (CET) X-MC-Unique: J_0BvgIDOW64qxDOIo9rYQ-1 X-MC-Unique: XjxetckCORSvLV8SrJDywg-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 11/12] libxl: add API wrapper for libxl_set_memory_target Date: Thu, 25 Mar 2021 17:26:11 +0100 Message-Id: <20210325162612.8355-12-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.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_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 Reviewed-by: Jim Fehlig --- src/libxl/libxl_api_wrapper.h | 27 +++++++++++++++++++++++++++ src/libxl/libxl_domain.c | 6 +++--- src/libxl/libxl_driver.c | 4 ++-- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/src/libxl/libxl_api_wrapper.h b/src/libxl/libxl_api_wrapper.h index 26c2215cb7..a9627f7983 100644 --- a/src/libxl/libxl_api_wrapper.h +++ b/src/libxl/libxl_api_wrapper.h @@ -20,6 +20,7 @@ =20 #pragma once =20 +#include #include =20 static inline int @@ -188,3 +189,29 @@ libxlSendTriggerWrapper(libxl_ctx *ctx, =20 return ret; } + +static inline int +libxlSetMemoryTargetWrapper(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 ac613b96b9..7ffafb9023 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,8 +1025,8 @@ 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, - /* relative */ 1, 0) < 0) + if (libxlSetMemoryTargetWrapper(ctx, 0, target_mem, + /* relative */ 1, 0) < 0) goto error; =20 if (libxl_wait_for_memory_target(ctx, 0, wait_secs) < 0) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 18098734fc..f130790484 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -1695,8 +1695,8 @@ 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, - /* force */ 1); + res =3D libxlSetMemoryTargetWrapper(cfg->ctx, vm->def->id, new= mem, 0, + /* force */ 1); virObjectLock(vm); if (res < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, From nobody Thu May 9 19:50:53 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=1616689631; cv=none; d=zohomail.com; s=zohoarc; b=JCZSUSRR4zQt/Dx4eKG137RBH2DXqtfeko3fyA14p2fqZEDDPPEYC+60teF1pcc+3ZC3BI6E31+fP16dmxmsHOy/Q6gU1m/SWZQMsBYEl7XQRPVp/nKOTUKikeVu3ZRj+9OTCI/9k5djFnAwGAxkky1TaxMbBJC+vICCDGdNlBg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616689631; 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=V0IPwR7jxoC6ADb9qPXZsN0imKAsCJgpWHFmqwBvJnguMXNg8Kdjvhd+j9PgTNnIdOxaXQp2hrdQ14S6OAAbf0axF7wynqpLJKFN40MBWiJLfC3VoAAIzIkzRTJ2eZjMWuSrQNxeQoeYPSgD2jSsH66Hv/U5rF4IGoidM+m4Uew= 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 1616689631930622.1016688464192; Thu, 25 Mar 2021 09:27:11 -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-296-zrAHAAmtMW6b_1_GST30Pg-1; Thu, 25 Mar 2021 12:27:07 -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 7F8471018F74; Thu, 25 Mar 2021 16:27:01 +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 51FB917258; Thu, 25 Mar 2021 16:27:01 +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 0B5EB4BB7C; Thu, 25 Mar 2021 16:27:01 +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 12PGQReW032183 for ; Thu, 25 Mar 2021 12:26:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id D26B820E1D81; Thu, 25 Mar 2021 16:26:27 +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 CD09820E1D80 for ; Thu, 25 Mar 2021 16:26:27 +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 B4A27100DE7F for ; Thu, 25 Mar 2021 16:26:27 +0000 (UTC) Received: from mo4-p02-ob.smtp.rzone.de (mo4-p02-ob.smtp.rzone.de [85.215.255.82]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-6-CatcE7ozM9uI2bZmTRlCXg-1; Thu, 25 Mar 2021 12:26:25 -0400 Received: from sender by smtp.strato.de (RZmta 47.22.0 SBL|AUTH) with ESMTPSA id 204541x2PGQL6TW (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) (Client did not present a certificate); Thu, 25 Mar 2021 17:26:21 +0100 (CET) X-MC-Unique: zrAHAAmtMW6b_1_GST30Pg-1 X-MC-Unique: CatcE7ozM9uI2bZmTRlCXg-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 12/12] libxl: use API 4.13 to support domUs with more than 4TB Date: Thu, 25 Mar 2021 17:26:12 +0100 Message-Id: <20210325162612.8355-13-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" 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 Reviewed-by: Jim Fehlig --- 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,