Received: from eggs.gnu.org ([140.186.70.92]:40093) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPzru-0005de-MX for qemu-devel@nongnu.org; Fri, 27 May 2011 12:26:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QPzrt-0001mF-HX for qemu-devel@nongnu.org; Fri, 27 May 2011 12:26:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35836) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPzrt-0001m7-91 for qemu-devel@nongnu.org; Fri, 27 May 2011 12:26:33 -0400 From: Markus Armbruster References: <1304116821-18201-1-git-send-email-lcapitulino@redhat.com> <20110502125746.5ef8bc78@doriath> <20110509103210.337ea7af@doriath> <20110527110455.1b42df32@doriath> <4DDFBB49.5050505@codemonkey.ws> <20110527124340.1067d489@doriath> Date: Fri, 27 May 2011 18:26:24 +0200 In-Reply-To: <20110527124340.1067d489@doriath> (Luiz Capitulino's message of "Fri, 27 May 2011 12:43:40 -0300") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH 0/3]: QMP: Introduce inject-nmi command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: Blue Swirl , laijs@cn.fujitsu.com, qemu-devel@nongnu.org Luiz Capitulino writes: > On Fri, 27 May 2011 09:55:05 -0500 > Anthony Liguori wrote: > >> On 05/27/2011 09:04 AM, Luiz Capitulino wrote: >> > On Thu, 26 May 2011 22:23:10 +0300 >> > Blue Swirl wrote: >> > >> >> I think I explained it many times, but let's try again. Thanks! >> >> >> >> inject >> >> ---------- >> >> >> >> Inject a signal on guest machine. >> >> >> >> Arguments: signal name. >> >> >> >> Example: >> >> >> >> -> { "execute": "inject", >> >> "arguments": { "signal": "nmi" } } >> >> <- { "return": {} } >> >> >> >> -> { "execute": "inject", >> >> "arguments": { "signal": "/apic@fee00000:l1int" } } >> >> <- { "return": {} } >> > >> > Shouldn't this be broken into device and signal (or pin) arguments? >> >> >> I dislike this approach strongly. >> >> Overloading verbs to have multiple meanings is a bad thing for QMP. It >> means less type safety. Think of a C interface: >> >> inject_nmi() <- good >> inject_nim() <- compile error >> >> inject("nmi") <- good >> inject("nim") <- runtime error Not sure how much mileage we'll get out of static typing in QMP, but overloading commands for dissimilar tasks is bad taste. One ugly bastard like "change" is enough. Thus, this "inject" command should always be limited to irq-like operands. >> Not to mention that "inject" doesn't mean "raise and then lower a pin". >> Inject means insert or put in. Yes. Like "inject a fault". >> I'm not opposed to being able to have a way to raise/lower a qemu_irq, >> but (a) that's orthogonal to this operation (b) we should design that >> interface properly. b means that we should be able to enumerate pins, >> raise and lower pins, and pulse pins. Once qdev models pins nicely, a command to manipulate them shouldn't be hard. > So, would you be in favor of merging the current series as it stands > currently and design this new interface as a new command? I recommend to commit the sucker already. It's simple, and it solves a problem that's relevant enough for Lai to pursue it for *months*, and starting over now is just not worth it. [...]