Received: from eggs.gnu.org ([2001:4830:134:3::10]:53932) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wt58U-0007Jh-CF for qemu-devel@nongnu.org; Fri, 06 Jun 2014 21:09:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wt58O-0005hn-2y for qemu-devel@nongnu.org; Fri, 06 Jun 2014 21:09:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38652) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wt58N-0005gn-Qn for qemu-devel@nongnu.org; Fri, 06 Jun 2014 21:09:24 -0400 Date: Fri, 6 Jun 2014 22:09:18 -0300 From: Eduardo Habkost Message-ID: <20140607010918.GE17594@otherpad.lan.raisama.net> References: <20140606201429.GK15000@otherpad.lan.raisama.net> <20140606233858.1f126642@thinkpad> <20140606222136.GD17594@otherpad.lan.raisama.net> <20140607012209.70d48228@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH] qdev: Skip non-existing properties when setting globals List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: "Michael S. Tsirkin" , Markus Armbruster , Don Slutz , QEMU Developers , Paolo Bonzini , Igor Mammedov , Andreas =?iso-8859-1?Q?F=E4rber?= On Sat, Jun 07, 2014 at 12:45:26AM +0100, Peter Maydell wrote: > On 7 June 2014 00:22, Igor Mammedov wrote: > > Eduardo Habkost wrote: > >> On Fri, Jun 06, 2014 at 11:38:58PM +0200, Igor Mammedov wrote: > >> > Eduardo Habkost wrote: > >> > > $ ./install/bin/qemu-system-x86_64 -global cpu.foobar=5 > >> > > qemu-system-x86_64: Property '.foobar' not found > >> > > Aborted (core dumped) > >> > That is expected behavior. > >> > >> Why? > >> > >> QEMU should never dump core due to user error. > >> > >> QEMU should not abort when handling a device_add command due to user > >> error. > > I've meant QEMU shouldn't start if CLI has error. whether it's abort or > > exit(FAIL) doesn't matter much. > > I'm with Eduardo on this one -- if the user passes us a bad > command line we should diagnose it helpfully and exit with > a failure code; abort() is for programming errors. (If nothing > else, using abort() for user-triggerable conditions tends to > mean we get bug reports about core dumps, so it's in our > own interest to not do that :-) ) So you are agreeing with Igor, as well. He is just suggesting we keep terminating QEMU on that case, and we can use exit() for that. My patch, on the other hand, makes QEMU not terminate on those cases. Note that we have two different bugs: 1) QEMU core dumps in case of user error. This is a regression introduced in 1.7.0. It can be fixed easily by changing existing code to use exit() instead of aborting. 2) QEMU terminating on device_add in case of user error. This bug was always present. It can be addressed using the async_error approach suggested by Igor. I will submit a new patch to address (1), first. -- Eduardo