From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKUSl-0001hi-Gf for qemu-devel@nongnu.org; Tue, 26 Mar 2013 10:03:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UKUSk-0008Qd-3X for qemu-devel@nongnu.org; Tue, 26 Mar 2013 10:02:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51606) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKUSj-0008QV-S5 for qemu-devel@nongnu.org; Tue, 26 Mar 2013 10:02:54 -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 r2QE2rGw027960 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 26 Mar 2013 10:02:53 -0400 Date: Tue, 26 Mar 2013 10:02:51 -0400 From: Luiz Capitulino Message-ID: <20130326100251.00c2b360@redhat.com> In-Reply-To: <20130326144301.79fed257@nial.usersys.redhat.com> References: <514BC592.508@redhat.com> <1364225711-32566-1-git-send-email-imammedo@redhat.com> <20130325160959.4d5119d9@redhat.com> <5150B20C.5010406@redhat.com> <20130326144301.79fed257@nial.usersys.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: Igor Mammedov Cc: qemu-devel@nongnu.org On Tue, 26 Mar 2013 14:43:01 +0100 Igor Mammedov wrote: > On Mon, 25 Mar 2013 14:22:36 -0600 > Eric Blake wrote: > > > On 03/25/2013 02:09 PM, Luiz Capitulino wrote: > > > On Mon, 25 Mar 2013 16:35:11 +0100 > > > Igor Mammedov wrote: > > > > > > > >> +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"); > > >> + } > > >> +} > > > > > > 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=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. > > > > > > The alternative is to have cpu-set-online and later cpu-set-offline. Quite > > > verbose, but doesn't have issues. > It looks like better as way to go. Later on we could keep them for > compatibility sake and map it to device_add/device_del commands when they are > ready. I find the batch API to be a bit overkill (I'd add it in the future if really needed), but I won't oppose to it.