From nobody Tue May 7 08:53:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1561029773; cv=none; d=zoho.com; s=zohoarc; b=mYwhR00Y4sxuBGSZXiUCvFN89/EpnpGN8a89dzs2wFbl/q0tOF1R80gSyzcv08bCmOaghwaIWyNgt5aHwfiZu+XXKA4kyBbZLjnn0FzzHISAlCiPvLrfEF8HTKBNsmdjbSMHKl2sPAG8sTtuKAMoaNK8HxsK/XxyKaAId5rfdn8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561029773; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=tEO249WVjrVyh5B2URgGEmHvoSexKSwy/anS69uhqEQ=; b=WumCYWOh9sfrDODXhiFFlY3GpYlf2Gyvk8n74KdRV412LA8ayts42vpKLny32GdEs8oohACdJ6G/ttUa/1cRDyBMhxX2ExVtL9YFDshfcBuyRkF/Y6Hth6gIFBSNVSQbtwLuiPRCD3d+jcXcIMyLwb2y9qvIgMqSYg4/l4RwTvY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1561029773164576.4333489171389; Thu, 20 Jun 2019 04:22:53 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D583B81130; Thu, 20 Jun 2019 11:22:39 +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 A577A19C4F; Thu, 20 Jun 2019 11:22:35 +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 423A7C57E; Thu, 20 Jun 2019 11:22:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x5KBMVVv031524 for ; Thu, 20 Jun 2019 07:22:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2633F18967; Thu, 20 Jun 2019 11:22:31 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id A5ABA84E9 for ; Thu, 20 Jun 2019 11:22:30 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 20 Jun 2019 13:22:26 +0200 Message-Id: <7f993e866e758f48453db11e83b39f3c68ce1034.1561029563.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] qemu: monitor: Remove text monitor support for cpu hot(un)plug 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 20 Jun 2019 11:22:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The "cpu-add" command is supported in all supported qemu versions and cpu unplug did not work at all until the new cpu unplug approach (using device_add/del) was implemented. Remove the support for falling back to the text monitor. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_monitor_json.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 4eca75ecc9..6d4f119a35 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2979,8 +2979,9 @@ int qemuMonitorJSONSetCPU(qemuMonitorPtr mon, "i:id", cpu, NULL); } else { - /* offlining is not yet implemented in qmp */ - goto fallback; + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("vCPU unplug is not supported by this qemu")); + goto cleanup; } if (!cmd) goto cleanup; @@ -2988,20 +2989,12 @@ int qemuMonitorJSONSetCPU(qemuMonitorPtr mon, if ((ret =3D qemuMonitorJSONCommand(mon, cmd, &reply)) < 0) goto cleanup; - if (qemuMonitorJSONHasError(reply, "CommandNotFound")) - goto fallback; - else - ret =3D qemuMonitorJSONCheckError(cmd, reply); + ret =3D qemuMonitorJSONCheckError(cmd, reply); cleanup: virJSONValueFree(cmd); virJSONValueFree(reply); return ret; - - fallback: - VIR_DEBUG("no QMP support for cpu_set, trying HMP"); - ret =3D qemuMonitorTextSetCPU(mon, cpu, online); - goto cleanup; } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 08:53:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1561029792; cv=none; d=zoho.com; s=zohoarc; b=hQ1GyHMIYnvOql5O677eZVAyEj4K31ytJADGWtVPdWSHo2lWtJ4vLl3Rx88/e1VoEIGl8yBhxiAhPla7XSQ9l1WTEgcMgO8uVOUU0tvBDwLIEoIbE7GQXireXHGmdVFXHd0jDWd5ccoG+418LE6tHSKS5O3AWnoNyWsoQJghMos= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561029792; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=CmV+RXgYdyEUClG4KWFr4kvTD6fnqHdr0gFtwFkOpt4=; b=Gqf1+y1ZvzkxmUEC9DBi9GhO53yw0fzN5q/JU4nyIYCzV3Cc6fQEbjEOAV5PBI1SjDNVgRHVbNCyzJoiElf2E/EZnHP4oen0B0K8zkOaIr1/91WK/aAejcC58TPq8VCkuWSlJKJOq8TVQZJzT3nypIv5J/6PluRtgV/pPIuJqKs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1561029792122395.5465441530026; Thu, 20 Jun 2019 04:23:12 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 6625E30BC100; Thu, 20 Jun 2019 11:23:07 +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 4173E5C205; Thu, 20 Jun 2019 11:23:06 +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 E68301806B0F; Thu, 20 Jun 2019 11:23:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x5KBMVD1031532 for ; Thu, 20 Jun 2019 07:22:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id E56E484E9; Thu, 20 Jun 2019 11:22:31 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7125561090 for ; Thu, 20 Jun 2019 11:22:31 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 20 Jun 2019 13:22:27 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/2] qemu: Remove qemuMonitorTextSetCPU 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Thu, 20 Jun 2019 11:23:10 +0000 (UTC) Content-Type: text/plain; charset="utf-8" It's not used any more. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_monitor_text.c | 30 ------------------------------ src/qemu/qemu_monitor_text.h | 2 -- 2 files changed, 32 deletions(-) diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c index 280cc58840..a15c3df76e 100644 --- a/src/qemu/qemu_monitor_text.c +++ b/src/qemu/qemu_monitor_text.c @@ -32,36 +32,6 @@ VIR_LOG_INIT("qemu.qemu_monitor_text"); -int qemuMonitorTextSetCPU(qemuMonitorPtr mon, int cpu, bool online) -{ - char *cmd; - char *reply =3D NULL; - int ret =3D -1; - - if (virAsprintf(&cmd, "cpu_set %d %s", cpu, online ? "online" : "offli= ne") < 0) - return -1; - - if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) - goto cleanup; - - /* If the command failed qemu prints: 'unknown command' - * No message is printed on success it seems */ - if (strstr(reply, "unknown command:")) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cannot change vcpu count of this domain")); - goto cleanup; - } - - ret =3D 0; - - cleanup: - VIR_FREE(reply); - VIR_FREE(cmd); - - return ret; -} - - int qemuMonitorTextAddDrive(qemuMonitorPtr mon, const char *drivestr) { diff --git a/src/qemu/qemu_monitor_text.h b/src/qemu/qemu_monitor_text.h index 524bd1d5cb..ce6dd979a5 100644 --- a/src/qemu/qemu_monitor_text.h +++ b/src/qemu/qemu_monitor_text.h @@ -25,8 +25,6 @@ #include "qemu_monitor.h" -int qemuMonitorTextSetCPU(qemuMonitorPtr mon, int cpu, bool online); - int qemuMonitorTextAddDrive(qemuMonitorPtr mon, const char *drivestr); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list