From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKDuo-0007qB-Kh for qemu-devel@nongnu.org; Mon, 25 Mar 2013 16:22:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UKDuj-0006AT-Kw for qemu-devel@nongnu.org; Mon, 25 Mar 2013 16:22:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58737) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKDuj-0006AM-Bz for qemu-devel@nongnu.org; Mon, 25 Mar 2013 16:22:41 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2PKMeFR018529 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 25 Mar 2013 16:22:40 -0400 Message-ID: <5150B20C.5010406@redhat.com> Date: Mon, 25 Mar 2013 14:22:36 -0600 From: Eric Blake MIME-Version: 1.0 References: <514BC592.508@redhat.com> <1364225711-32566-1-git-send-email-imammedo@redhat.com> <20130325160959.4d5119d9@redhat.com> In-Reply-To: <20130325160959.4d5119d9@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2TOQXNONRBIIXTPMXMOEH" Subject: Re: [Qemu-devel] [PATCH 11/12 v2] qmp: add cpu-set qmp command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: Igor Mammedov , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2TOQXNONRBIIXTPMXMOEH Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/25/2013 02:09 PM, Luiz Capitulino wrote: > On Mon, 25 Mar 2013 16:35:11 +0100 > Igor Mammedov wrote: >=20 >> +void qmp_cpu_set(int64_t id, const bool online, Error **errp) >> +{ >> + if (online) { >> + do_cpu_hot_add(id, errp); >> + } else { >> + error_setg(errp, "Unplug is not implemented"); >> + } >> +} >=20 > As a general rule, we don't allow command extensions to be done this > way because this is not queriable. A client would have to try online=3D= off > to see if QEMU version X supports it, worse: the client would have to > parse the error message to be sure the failure actually corresponds > to unplug not implemented. >=20 > The alternative is to have cpu-set-online and later cpu-set-offline. Qu= ite > verbose, but doesn't have issues. >=20 > Eric, what do you think? Good point. What is the likelihood of getting offline working before 1.5 is released? If we are certain that offline cpu support won't make this release, then having separate commands would indeed be easier to que= ry. On the other hand, why aren't we mirroring the QMP behavior to be similar to what Lazlo already did for qga: https://lists.gnu.org/archive/html/qemu-devel/2013-03/msg01031.html That is, by having a way to query details on the set of all possible cpus (via a new command that returns an array with max cpus elements, rather than just the single int of query-cpu-max in https://lists.gnu.org/archive/html/qemu-devel/2013-03/msg04441.html), with information in that query including a second boolean stating whether that cpu can be taken offline, would be sufficiently queryable. The initial implementation would then state that an offline cpu can be taken online, but that an online cpu must remain in that state. And while typing that, I also realize that I like Lazlo's approach for another reason - guest-set-vcpus takes an array of actions, and performs as many as possible in one transaction; whereas your current cpu-set command has to be called multiple times to take multiple cpus online. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2TOQXNONRBIIXTPMXMOEH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRULIMAAoJEKeha0olJ0Nq0RYH/0oDtOSOv9UFUgZdsD5KKNaD F1L+hlphtn2caK2gXbMrxsZbv+BiZxdq0DaoT5lfr15bhQFili8Js+50771HwkKz +XVXifkZ1h2ScyW9BFX2py8JxyNSBKtsyMFoqh9Twj9F/PAZJenBrs9gG6zKFQ/4 xS0urdDaG1qgmRD+cMkQZGjecm1BnBMidIH5KqExTDLl8jOYkQUXc6fi1d7lXSSh 9SHw0e84g2+hB9W+fWEu8yWkr3czEdgy4AzmYFpSRNH2QBKWCDYmL4ecI4M9+5dH VZTgIxSyUpfgb1Ux9/jW6oDSXInhs7RF2evydDpINAUdVoJB45Le1LhVbBMkWdM= =C87Y -----END PGP SIGNATURE----- ------enig2TOQXNONRBIIXTPMXMOEH--