From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51206) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGHGR-0000DU-QI for qemu-devel@nongnu.org; Thu, 23 Jun 2016 22:54:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGHGN-0006Sb-Ia for qemu-devel@nongnu.org; Thu, 23 Jun 2016 22:54:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59475) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGHGN-0006SV-AE for qemu-devel@nongnu.org; Thu, 23 Jun 2016 22:54:35 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C2E1962666 for ; Fri, 24 Jun 2016 02:54:34 +0000 (UTC) Date: Fri, 24 Jun 2016 12:56:17 +1000 From: David Gibson Message-ID: <20160624125617.54dc1fc9@voom.fritz.box> In-Reply-To: <6a52d9a67cc72abb874c9906df039d11bfe1e18d.1466713052.git.pkrempa@redhat.com> References: <6a52d9a67cc72abb874c9906df039d11bfe1e18d.1466713052.git.pkrempa@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/J2Eu95SRI1=RhRo32CF1uNg"; protocol="application/pgp-signature" Subject: Re: [Qemu-devel] [PATCH 1/3] qapi: Report support for -device cpu hotplug in query-machines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Krempa Cc: qemu-devel@nongnu.org, Igor Mammedov --Sig_/J2Eu95SRI1=RhRo32CF1uNg Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Thu, 23 Jun 2016 22:23:23 +0200 Peter Krempa wrote: > For management apps it's very useful to know whether the selected > machine type supports cpu hotplug via the new -device approach. Using > the presence of 'query-hotpluggable-cpus' is enough for a withess. >=20 > Add a property to 'MachineInfo' called 'hotpluggable-cpus' that will > report the presence of this feature. >=20 > Example of output: > { > "hotpluggable-cpus": false, > "name": "mac99", > "cpu-max": 1 > }, > { > "hotpluggable-cpus": true, > "name": "pseries-2.7", > "is-default": true, > "cpu-max": 255, > "alias": "pseries" > }, I'd been under the impression that there was a general way of detecting the availability of a particular qmp command. Was I mistaken? > Signed-off-by: Peter Krempa > --- > qapi-schema.json | 5 ++++- > vl.c | 1 + > 2 files changed, 5 insertions(+), 1 deletion(-) >=20 > diff --git a/qapi-schema.json b/qapi-schema.json > index 0964eec..24ede28 100644 > --- a/qapi-schema.json > +++ b/qapi-schema.json > @@ -2986,11 +2986,14 @@ > # @cpu-max: maximum number of CPUs supported by the machine type > # (since 1.5.0) > # > +# @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0) > +# > # Since: 1.2.0 > ## > { 'struct': 'MachineInfo', > 'data': { 'name': 'str', '*alias': 'str', > - '*is-default': 'bool', 'cpu-max': 'int' } } > + '*is-default': 'bool', 'cpu-max': 'int', > + 'hotpluggable-cpus': 'bool'} } >=20 > ## > # @query-machines: > diff --git a/vl.c b/vl.c > index c85833a..4c1f9ae 100644 > --- a/vl.c > +++ b/vl.c > @@ -1524,6 +1524,7 @@ MachineInfoList *qmp_query_machines(Error **errp) >=20 > info->name =3D g_strdup(mc->name); > info->cpu_max =3D !mc->max_cpus ? 1 : mc->max_cpus; > + info->hotpluggable_cpus =3D !!mc->query_hotpluggable_cpus; >=20 > entry =3D g_malloc0(sizeof(*entry)); > entry->value =3D info; > --=20 > 2.8.3 >=20 --=20 David Gibson Senior Software Engineer, Virtualization, Red Hat --Sig_/J2Eu95SRI1=RhRo32CF1uNg Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXbKFRAAoJEGw4ysog2bOSXnQP/j9+1b8B6Y8PSXhIfDTDeJhx OvkkvugxLHla28AHdNEiPd6JkwWbSBXsb8ukD4QE7OdzDP5OxvDHU7JGgMOTLyOr zEYQS76Y+EO4qil860J4ByunYZVH8//yfjosCO/+gnqhTTYMrvKne8WKJL3XyL1T TWd+YsTCXu2TRzTFLs6tBMRU/rjzNHKpWjTISpOUFk9pANQQzLU8hr+Bc8U9MegD Qo/5uTaRNzW3vZ1l6riQYybKy3so6w4iXHj8XNRjzX73L9W6h+hM1hTYhLolz06v aS1uJmPnJGsKzNQ1UY4ue8fRQ/ir9kHlzF1AMPesDsc2S0N07B2XSVGZmg6htWGl Gq5qwQ0DHNdpNPpT6jDbyB4zKeqqYetHAa3rV6x8Dan7ymiuroXUiei47d/sl0gw Cdi6xWV9lRDJtC4B3b1ZTPzFbF7As4Tj8/qtg8gKrlNWtudELd7Ae+DL9drz7QRF 4uMzrnsRxGFLKAM+TOJKdZofyV35lawpW+LX7ayfC8wj0uCsOVrnkLbqy8EFgVkB ZE6AJWt2Xub/Bw3JYsw2FpoDNfaTUVoamjUpQt8xyjA0kDJ+RSOY0jpufr2HMlnv fpJNu0mjBXE/UQPV61FdNts3MEHH0CFxnDMWmZPlcIcfKGVxVNVQ6mLVxuo3ICQY Cx4mrqo/g/awrcr2p4nz =HYHC -----END PGP SIGNATURE----- --Sig_/J2Eu95SRI1=RhRo32CF1uNg--