From nobody Sun May 5 10:56:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1616422706; cv=none; d=zohomail.com; s=zohoarc; b=L+qrUnvATS8VAf57GyS58ZhK8/1SQSzLmLsfsTkvrerrPuuAy9lhfAXmxoNE7OA25fYCurUEMQwhvI91iLiD/tIFpvAlhg/0W+anKpxjnGrVze3J6tCnPraSD2/xU0EpLfL+4MMnhKLNaVGQGgp/urnJBxWWBSLw+vyh2+yaMbA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616422706; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=hMBxnTRAFHQUgdZjZ/RqnFAkmOoihDcaMdPleGiFv5o=; b=WYTL25sQsvioOIrHtWfakBNQzSshAGIMChqrNFDMIeayHTC962JxSYIY6nd7o993HP8EDtKURdCBg7qIvnctbG73705IIL72W/+PM3znf3HK4LsxP4/N3bhfazYcMw0e4CdqXG4LJygkDR7Y2S+E7ZQF0liADg9Gmvw7qauu1nY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1616422706340250.43456091145754; Mon, 22 Mar 2021 07:18:26 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.100237.190857 (Exim 4.92) (envelope-from ) id 1lOLNT-0005ws-F3; Mon, 22 Mar 2021 14:17:55 +0000 Received: by outflank-mailman (output) from mailman id 100237.190857; Mon, 22 Mar 2021 14:17:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lOLNT-0005wl-Bl; Mon, 22 Mar 2021 14:17:55 +0000 Received: by outflank-mailman (input) for mailman id 100237; Mon, 22 Mar 2021 14:17:53 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lOLNR-0005wg-IF for xen-devel@lists.xenproject.org; Mon, 22 Mar 2021 14:17:53 +0000 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 4f112ac4-98f6-4f94-ac7f-98ffaa9f65c6; Mon, 22 Mar 2021 14:17:52 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 4f112ac4-98f6-4f94-ac7f-98ffaa9f65c6 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1616422672; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=zbCA7xPzOeIvFMMUTDAmfGCrX4UtpDvlzVZISRSEDMo=; b=aZUFkAZ2qIzuFn5WuMWtR9ajrQM0QTE5u+hiRSy1yRNFymMeX5XhIfMc kJUmdC/O5aEE/vPU8vA+e3VmvoEWB/R1RnMau8JT5NyqeglPvDs1eUz6f 7ftmYs4gc17cDq8O4IxSx8t1xNrlF0j2agH6zhKWY4lDPfXzNZ5Z+XT32 o=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: gDU9YOZltnPkmbL5qfoHnDE2uuKo84dBf3CW8NukPI6cUvyn19Z92/c42QM1Kl+6PtDZGOjwrY AOKdU7b9fGFoh2tyEN9HIcBv2z7YcNRRFWilY1rciwOIdp0KBdp70jD2o4TPn16rX0gEdW19jp 68rK4YlO2x5hXnycSL79ZIYNygiHi2Gd5QvH+6LYgKhPVJzQy7JEdBUHdKMh1roMaMoaj6dcM7 9TZlEJ6ULNQ/TwA9wWJRKv6GNnR5JzJ4kbYwGfGRzx63Nm09AGCyllrFX4mYpAHTokgKwsU8NF l/c= X-SBRS: 5.1 X-MesageID: 41257215 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED IronPort-HdrOrdr: A9a23:zfm48q20pkwbpXJTZ3UPIwqjBFAkLtp033Aq2lEZdDV+WKWj+P yGtvIdyBPylXItQ3kmg9+NI+2tRnnb+J5z7+AqTNKfdSPhv3alK5wn0Jv6z1TbakrD38NUyK sISclDIfLqC1wSt6vHyS2ZN/pl/9Wd6qCvgo7lvhVQZCVncbtp4Qs8KivzKC1LbTJLD5Y4C5 aQj/Avz1HLRV0tYtmmHX5AZuDfprTw5fbbSCQbDB0q4hTmt12VwYP9eiL14j4uFxdGwbIv6g H+4m/E2pk= X-IronPort-AV: E=Sophos;i="5.81,269,1610427600"; d="scan'208";a="41257215" From: Anthony PERARD To: CC: Anthony PERARD , Ian Jackson , Wei Liu Subject: [XEN PATCH for-4.15] libxl: Replace deprecated QMP command by "query-cpus-fast" Date: Mon, 22 Mar 2021 14:17:44 +0000 Message-ID: <20210322141744.522041-1-anthony.perard@citrix.com> X-Mailer: git-send-email 2.31.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) Content-Type: text/plain; charset="utf-8" We use the deprecated QMP command "query-cpus" which will be remove in the upcoming QEMU 6.0 release. There's a replacement which is "query-cpus-fast", and have been available since QEMU 2.12 (April 2018). In order to been able to keep using recent version of QEMU, this patch replace the deprecated command by the newer version. And because we are in the "feature freeze" period, this patch is kept simple without fallback (which could have been used when "query-cpus-fast" wasn't available). Signed-off-by: Anthony PERARD Acked-by: Ian Jackson --- tools/libs/light/libxl_domain.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tools/libs/light/libxl_domain.c b/tools/libs/light/libxl_domai= n.c index 5d4ec9071160..e32e1cd39fea 100644 --- a/tools/libs/light/libxl_domain.c +++ b/tools/libs/light/libxl_domain.c @@ -1740,23 +1740,23 @@ static int libxl__set_vcpuonline_xenstore(libxl__gc= *gc, uint32_t domid, return rc; } =20 -static int qmp_parse_query_cpus(libxl__gc *gc, - libxl_domid domid, - const libxl__json_object *response, - libxl_bitmap *const map) +static int qmp_parse_query_cpus_fast(libxl__gc *gc, + libxl_domid domid, + const libxl__json_object *response, + libxl_bitmap *const map) { int i; const libxl__json_object *cpu; =20 libxl_bitmap_set_none(map); - /* Parse response to QMP command "query-cpus": - * [ { 'CPU': 'int',...} ] + /* Parse response to QMP command "query-cpus-fast": + * [ { 'cpu-index': 'int',...} ] */ for (i =3D 0; (cpu =3D libxl__json_array_get(response, i)); i++) { unsigned int cpu_index; const libxl__json_object *o; =20 - o =3D libxl__json_map_get("CPU", cpu, JSON_INTEGER); + o =3D libxl__json_map_get("cpu-index", cpu, JSON_INTEGER); if (!o) { LOGD(ERROR, domid, "Failed to retrieve CPU index."); return ERROR_QEMU_API; @@ -1841,7 +1841,7 @@ int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t dom= id, LIBXL_QMP_CMD_TIMEOUT * 1000); if (rc) goto out; qmp->callback =3D set_vcpuonline_qmp_cpus_queried; - rc =3D libxl__ev_qmp_send(egc, qmp, "query-cpus", NULL); + rc =3D libxl__ev_qmp_send(egc, qmp, "query-cpus-fast", NULL); if (rc) goto out; return AO_INPROGRESS; default: @@ -1876,7 +1876,7 @@ static void set_vcpuonline_qmp_cpus_queried(libxl__eg= c *egc, if (rc) goto out; =20 libxl_bitmap_alloc(CTX, ¤t_map, svos->info.vcpu_max_id + 1); - rc =3D qmp_parse_query_cpus(gc, qmp->domid, response, ¤t_map); + rc =3D qmp_parse_query_cpus_fast(gc, qmp->domid, response, ¤t_ma= p); if (rc) goto out; =20 libxl_bitmap_copy_alloc(CTX, final_map, svos->cpumap); @@ -2199,7 +2199,7 @@ static void retrieve_domain_configuration_lock_acquir= ed( libxl_bitmap_alloc(CTX, &rdcs->qemuu_cpus, d_config->b_info.max_vcpus); rdcs->qmp.callback =3D retrieve_domain_configuration_cpu_queried; - rc =3D libxl__ev_qmp_send(egc, &rdcs->qmp, "query-cpus", NULL); + rc =3D libxl__ev_qmp_send(egc, &rdcs->qmp, "query-cpus-fast", NULL= ); if (rc) goto out; has_callback =3D true; } @@ -2220,7 +2220,7 @@ static void retrieve_domain_configuration_cpu_queried( =20 if (rc) goto out; =20 - rc =3D qmp_parse_query_cpus(gc, qmp->domid, response, &rdcs->qemuu_cpu= s); + rc =3D qmp_parse_query_cpus_fast(gc, qmp->domid, response, &rdcs->qemu= u_cpus); =20 out: retrieve_domain_configuration_end(egc, rdcs, rc); --=20 Anthony PERARD