From nobody Mon Feb 9 08:27:55 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=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;