From nobody Mon Feb 9 12:26:49 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1568913505; cv=none; d=zoho.com; s=zohoarc; b=gG/JtASwEWSnqlAAe0Hmm/h8p+j6CB79UCbvyxMzr/MUduhklhqbUMSkdZTFRWhldUVYYr2RC9oNR1DvjwmWzoXe64qc0jQofexlyEASmO0RMxFUaEyBppRK9B0sFLscYAXG9ozaDJ3Kc08CLYS4vV1/k1FKAdlv31iYVNFw6yg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568913505; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=lLUbR7zZV1QdmSIAqnO37EYYxqsYjvE3NPiEAqqgWkE=; b=mlOg4On2a+02o7pq7G58+ideK21lkODxLUpc4v8un438E4AaxWPlV0xLPyR2pIIZSNpxoEKuZEWA7zXMTWJ3GjhC1hFfqHNBQwvd2wrW3zmFwHiWY3o67P4I1dbT0+yFdXsdxs5854bjkMg7wLl7Zq7X+nUE436BWhf4BuMbECg= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1568913505165999.5818267452045; Thu, 19 Sep 2019 10:18:25 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iB03b-00012e-UG; Thu, 19 Sep 2019 17:17:27 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iB03a-00011Z-1v for xen-devel@lists.xenproject.org; Thu, 19 Sep 2019 17:17:26 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 562832dd-db01-11e9-966e-12813bfff9fa; Thu, 19 Sep 2019 17:17:21 +0000 (UTC) X-Inumbo-ID: 562832dd-db01-11e9-966e-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1568913441; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pD3+LqMEFKqS3Jy/yX0xvD5PBS4ym0EyMOr0w3gtMf0=; b=C16mVM814EKH4XgrEf3XfQuX+C2bSQBHbzUbJUH1do5Ir744Xwkq5AuA OJp1OCtzUSrXRJxBy/ouWCxHKgZW8l+KvK5Auus4YBQfqByAGTq0GrPHj QfFdYBBfxjiFlK1m66fHm8KB3LJK0mZ7U8+DeLj71SObGlQdi8DC8VcVZ U=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: Br+9/HryDdL61N+qgPYZKVV97VSZb8yMO/vzycQtkY1/XNF3gt5BmkFflX6YnbtO61v02WZbUe HKjtC56la5kDH+cIuODTDELSgWRA0n4wa+5LQ78ZEcRXX3xcelRCS1xuIi8hNKEhHu7x1C2otb ynNaTn0qJBANmkYolFkp7Y2IubHOiK7OB1cs+siBbCSNR7VC4LrDX860iaJzfwB/tg8z/KZV+7 Jb4ne1BLCUHt84sehlPIibWONAyf+45fq//NwLvqsmmlp2tRhzSO7XQwFmfSt97ODhZRnyttgM hpk= X-SBRS: 2.7 X-MesageID: 5800423 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,524,1559534400"; d="scan'208";a="5800423" From: Anthony PERARD To: Date: Thu, 19 Sep 2019 18:16:24 +0100 Message-ID: <20190919171656.899649-5-anthony.perard@citrix.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190919171656.899649-1-anthony.perard@citrix.com> References: <20190919171656.899649-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 04/35] libxl: Make libxl_retrieve_domain_configuration async X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) .. because it makes QMP calls which are going to be async. Signed-off-by: Anthony PERARD Acked-by: Ian Jackson --- tools/libxl/libxl.h | 13 ++++++++++++- tools/libxl/libxl_domain.c | 14 +++++++------- tools/xl/xl_info.c | 3 ++- tools/xl/xl_saverestore.c | 3 ++- tools/xl/xl_vmcontrol.c | 3 ++- 5 files changed, 25 insertions(+), 11 deletions(-) diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index fd69e92166b8..fd1e1349bf6a 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -1221,6 +1221,7 @@ void libxl_mac_copy(libxl_ctx *ctx, libxl_mac *dst, c= onst libxl_mac *src); * libxl_domain_unpause() * libxl_send_trigger() * libxl_set_vcpuonline() + * libxl_retrieve_domain_configuration() */ #define LIBXL_HAVE_FN_USING_QMP_ASYNC 1 =20 @@ -1564,8 +1565,18 @@ void libxl_domain_config_dispose(libxl_domain_config= *d_config); * works with DomU. */ int libxl_retrieve_domain_configuration(libxl_ctx *ctx, uint32_t domid, - libxl_domain_config *d_config) + libxl_domain_config *d_config, + const libxl_asyncop_how *ao_how) LIBXL_EXTERNAL_CALLERS_ONLY; +#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x041300 +static inline int libxl_retrieve_domain_configuration_0x041200( + libxl_ctx *ctx, uint32_t domid, libxl_domain_config *d_config) +{ + return libxl_retrieve_domain_configuration(ctx, domid, d_config, NULL); +} +#define libxl_retrieve_domain_configuration \ + libxl_retrieve_domain_configuration_0x041200 +#endif =20 int libxl_domain_suspend(libxl_ctx *ctx, uint32_t domid, int fd, int flags, /* LIBXL_SUSPEND_* */ diff --git a/tools/libxl/libxl_domain.c b/tools/libxl/libxl_domain.c index 60c3f7a34b4c..f2d5c86427ad 100644 --- a/tools/libxl/libxl_domain.c +++ b/tools/libxl/libxl_domain.c @@ -1594,14 +1594,13 @@ static int libxl__update_avail_vcpus_xenstore(libxl= __gc *gc, uint32_t domid, } =20 int libxl_retrieve_domain_configuration(libxl_ctx *ctx, uint32_t domid, - libxl_domain_config *d_config) + libxl_domain_config *d_config, + const libxl_asyncop_how *ao_how) { - GC_INIT(ctx); + AO_CREATE(ctx, domid, ao_how); int rc; libxl__domain_userdata_lock *lock =3D NULL; =20 - CTX_LOCK; - lock =3D libxl__lock_domain_userdata(gc, domid); if (!lock) { rc =3D ERROR_LOCK_FAIL; @@ -1808,9 +1807,10 @@ int libxl_retrieve_domain_configuration(libxl_ctx *c= tx, uint32_t domid, =20 out: if (lock) libxl__unlock_domain_userdata(lock); - CTX_UNLOCK; - GC_FREE; - return rc; + if (rc) + return AO_CREATE_FAIL(rc); + libxl__ao_complete(egc, ao, rc); + return AO_INPROGRESS; } =20 /* diff --git a/tools/xl/xl_info.c b/tools/xl/xl_info.c index bfbca93997dd..ca417df8e8a5 100644 --- a/tools/xl/xl_info.c +++ b/tools/xl/xl_info.c @@ -464,7 +464,8 @@ static void list_domains_details(const libxl_dominfo *i= nfo, int nb_domain) =20 for (i =3D 0; i < nb_domain; i++) { libxl_domain_config_init(&d_config); - rc =3D libxl_retrieve_domain_configuration(ctx, info[i].domid, &d_= config); + rc =3D libxl_retrieve_domain_configuration(ctx, info[i].domid, + &d_config, NULL); if (rc) continue; if (default_output_format =3D=3D OUTPUT_FORMAT_JSON) diff --git a/tools/xl/xl_saverestore.c b/tools/xl/xl_saverestore.c index 5c70e2e8747d..9be033fe65e4 100644 --- a/tools/xl/xl_saverestore.c +++ b/tools/xl/xl_saverestore.c @@ -56,7 +56,8 @@ void save_domain_core_begin(uint32_t domid, &d_config); free(config_v); } else { - rc =3D libxl_retrieve_domain_configuration(ctx, domid, &d_config); + rc =3D libxl_retrieve_domain_configuration(ctx, domid, &d_config, + NULL); if (rc) { fprintf(stderr, "unable to retrieve domain configuration\n"); exit(EXIT_FAILURE); diff --git a/tools/xl/xl_vmcontrol.c b/tools/xl/xl_vmcontrol.c index 3fc6f565748c..eb6779a56197 100644 --- a/tools/xl/xl_vmcontrol.c +++ b/tools/xl/xl_vmcontrol.c @@ -377,7 +377,8 @@ static void reload_domain_config(uint32_t domid, } =20 libxl_domain_config_init(&d_config_new); - rc =3D libxl_retrieve_domain_configuration(ctx, domid, &d_config_new); + rc =3D libxl_retrieve_domain_configuration(ctx, domid, &d_config_new, + NULL); if (rc) { LOG("failed to retrieve guest configuration (rc=3D%d). " "reusing old configuration", rc); --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel