From nobody Mon Jun 17 18:41:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1586436153; cv=none; d=zohomail.com; s=zohoarc; b=DbldWQ97OAwsqSsUmaLdEiojDE1cblEYLDexRcA3KRZzahZTUjgDZqySptOhO4ma5oYPsPpHw+95JHB9v2chN8fQxlndTNTdLx2BWvAaN0eTIfs0Dvx0jUGzC2cdU0ks/WQD+lD4uVLc2zR1Fh69HnIUWQA9Ox3h2ttZcCNBF6Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586436153; 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=WYWemMN/HxOcBF2Ae8LLBXSk2QwzLio+1QFBAWl9Q+I=; b=aYN5dRRcUKx594ymQqQ7SHKhzDzceflx/lJv5Tn5lL+5HwoIVrrHnThxOidPpFsyUwlZM2hIx98LhMrPe45b93R6ymxEFzW0fc4l6p6fmUSg68MhEArQlHSo9Atcfh6Zk1NGJAoH8+JiQvLWlVoPEI6k1uRj5rLTSf0qIZnMZV0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 158643615273379.61707712084171; Thu, 9 Apr 2020 05:42:32 -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-383-R8vO_ZwKMjWns0wgpzCDvg-1; Thu, 09 Apr 2020 08:42:28 -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 DF34B1083E80; Thu, 9 Apr 2020 12:42:21 +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 A3CB496B9B; Thu, 9 Apr 2020 12:42:21 +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 36C8E9306D; Thu, 9 Apr 2020 12:42:21 +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 039CgISo026742 for ; Thu, 9 Apr 2020 08:42:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0EDE311D2B5; Thu, 9 Apr 2020 12:42:18 +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 0B3AA11D2B1 for ; Thu, 9 Apr 2020 12:42:16 +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-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1E356800297 for ; Thu, 9 Apr 2020 12:42:16 +0000 (UTC) Received: from cmccmta2.chinamobile.com (cmccmta2.chinamobile.com [221.176.66.80]) by relay.mimecast.com with ESMTP id us-mta-158-eAHlVfIZNXunanPlnK6HNw-1; Thu, 09 Apr 2020 08:42:13 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.15]) by rmmx-syy-dmz-app08-12008 (RichMail) with SMTP id 2ee85e8f181552e-ec6a6; Thu, 09 Apr 2020 20:42:00 +0800 (CST) Received: from localhost.localdomain (unknown[223.105.0.241]) by rmsmtp-syy-appsvr08-12008 (RichMail) with SMTP id 2ee85e8f180bd4c-9de19; Thu, 09 Apr 2020 20:41:59 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586436151; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=WYWemMN/HxOcBF2Ae8LLBXSk2QwzLio+1QFBAWl9Q+I=; b=ak0Q49pPbbwHdXmrihQo4KeAPeA4GI4/d2w40D7CZAKpzMtqb9tr46RWqAyOfTlfK114S6 u6sXdSBKOtU37sYi9zfKA7gen/uRBFDOUo4rFuFiUw78lUyKesdc0mzG2bNbZX2GBaIXJS M03/3yd8mexlPCYVHxPiAtZmBdzaSVA= X-MC-Unique: R8vO_ZwKMjWns0wgpzCDvg-1 X-MC-Unique: eAHlVfIZNXunanPlnK6HNw-1 X-RM-TRANSID: 2ee85e8f181552e-ec6a6 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee85e8f180bd4c-9de19 From: Jidong Xia To: libvir-list@redhat.com Subject: [PATCH 1/2] qemu: Add some cpu hotpluggable inforamtion in vm xml when run "virsh setvcpus vm --count --live". Date: Thu, 9 Apr 2020 20:38:47 +0800 Message-Id: <20200409124028.20938-2-xiajidong@cmss.chinamobile.com> In-Reply-To: <20200409124028.20938-1-xiajidong@cmss.chinamobile.com> References: <20200409124028.20938-1-xiajidong@cmss.chinamobile.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 039CgISo026742 X-loop: libvir-list@redhat.com Cc: xiajidong 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 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: xiajidong The optional cpu attribute current can be used to specify whether fewer than the maximum number of virtual CPUs should be enabled. when run "virsh setvcpus vm --count --live", it can display cpu hotpluggable information when run "virsh dumpxml vm | grep vcpu". so we can know the value of enabled and hotpluggable attributes of the current vcpus. Signed-off-by: Jidong Xia --- src/qemu/qemu_hotplug.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 14654a1..c574f63 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -6168,6 +6168,10 @@ qemuDomainSelectHotplugVcpuEntities(virDomainDefPtr = def, } else { *enable =3D false; + if (nvcpus =3D=3D curvcpus) { + def->individualvcpus =3D true; + } + for (i =3D maxvcpus - 1; i >=3D 0 && curvcpus > nvcpus; i--) { vcpu =3D virDomainDefGetVcpu(def, i); vcpupriv =3D QEMU_DOMAIN_VCPU_PRIVATE(vcpu); -- 1.8.3.1 From nobody Mon Jun 17 18:41:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1586436163; cv=none; d=zohomail.com; s=zohoarc; b=TNeUV6GGXJIjDiVwN9RPr6sQ3CHBtVPvdQVSg59hGT6u1Sgm/HQvcVfukgyjXD+BWsqHlFymEA4GEAntoml5U0wkvMymfTF/KWi5L3Bi0aShP3umsxWqBP363UmeIdgRxl1WXVn8ccqeQSNCPfHGUNPu0/RVIBrIZc8VIhbtwRI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586436163; 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=UA3RfQoCBDmUo++vURhNZRggS+SS0jlsBVk9xxFyPgo=; b=gYayErRqnp3jsSohVq20MHUZyYpOK6jPOWeu39VSJoiSjo86v0eMetRr2zmzBFGraxAVopQhy1UaPOSHR3mz6TrRCnfXsNFNGpfI0sg5pgnbEbel1vXBsYTQCamkxKbKIuHkMGannmaxMpdEUmxHio2PDeci99g8pVeocHStMnw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1586436163506989.0360084855936; Thu, 9 Apr 2020 05:42:43 -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-19-J2WOS7T8PwyvYeGgPOCLxg-1; Thu, 09 Apr 2020 08:42:40 -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 3A9DB1005510; Thu, 9 Apr 2020 12:42:34 +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 0A0211036B50; Thu, 9 Apr 2020 12:42:34 +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 A3DFC182B010; Thu, 9 Apr 2020 12:42:33 +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 039CgU5m026771 for ; Thu, 9 Apr 2020 08:42:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id 42C7E11D2B2; Thu, 9 Apr 2020 12:42:30 +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 3F06211D2B1 for ; Thu, 9 Apr 2020 12:42:30 +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-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 28312101A55E for ; Thu, 9 Apr 2020 12:42:30 +0000 (UTC) Received: from cmccmta2.chinamobile.com (cmccmta2.chinamobile.com [221.176.66.80]) by relay.mimecast.com with ESMTP id us-mta-511-VEEkj2yaOWq_W6x1OphEqQ-1; Thu, 09 Apr 2020 08:42:26 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.15]) by rmmx-syy-dmz-app07-12007 (RichMail) with SMTP id 2ee75e8f18225c6-ec7bf; Thu, 09 Apr 2020 20:42:11 +0800 (CST) Received: from localhost.localdomain (unknown[223.105.0.241]) by rmsmtp-syy-appsvr08-12008 (RichMail) with SMTP id 2ee85e8f180bd4c-9de4b; Thu, 09 Apr 2020 20:42:10 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586436162; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=UA3RfQoCBDmUo++vURhNZRggS+SS0jlsBVk9xxFyPgo=; b=MIAu4xPQvGla80aBkm+Q7KCSVPCCA9uyypjjATxSi2rs7AsmuMA+Z1AYU4rle707TgtLDM YFzYOmeMr+WVkiYtIbRBjWE+RDGbzHC1ACeVd3taP5YgWa6uLvtlv9xUrbpPMFFbdVqdbm hd4ky8JluMBTirwFoo5W9RbJQtCNan0= X-MC-Unique: J2WOS7T8PwyvYeGgPOCLxg-1 X-MC-Unique: VEEkj2yaOWq_W6x1OphEqQ-1 X-RM-TRANSID: 2ee75e8f18225c6-ec7bf X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee85e8f180bd4c-9de4b From: Jidong Xia To: libvir-list@redhat.com Subject: [PATCH 2/2] qemu: Add some cpu hotpluggable inforamtion in vm xml when run "virsh setvcpus vm --count --config". Date: Thu, 9 Apr 2020 20:38:48 +0800 Message-Id: <20200409124028.20938-3-xiajidong@cmss.chinamobile.com> In-Reply-To: <20200409124028.20938-1-xiajidong@cmss.chinamobile.com> References: <20200409124028.20938-1-xiajidong@cmss.chinamobile.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 039CgU5m026771 X-loop: libvir-list@redhat.com Cc: Jidong Xia 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 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" when run "virsh setvcpus vm --count --config", and destroy vm, then start vm, it can display cpu hotpluggable information when run "virsh dumpxml vm | grep vcpu". so we can know the value of enabled and hotpluggable attributes of the current vcpus. Signed-off-by: Jidong Xia --- src/qemu/qemu_hotplug.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index c574f63..312f257 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -6274,8 +6274,10 @@ qemuDomainSetVcpusConfig(virDomainDefPtr def, /* ordering information may become invalid, thus clear it */ virDomainDefVcpuOrderClear(def); - if (curvcpus =3D=3D nvcpus) + if (curvcpus =3D=3D nvcpus) { + def->individualvcpus =3D true; return; + } if (curvcpus < nvcpus) { for (i =3D 0; i < maxvcpus; i++) { -- 1.8.3.1