Received: from eggs.gnu.org ([2001:4830:134:3::10]:53537) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsoGz-0006sD-10 for qemu-devel@nongnu.org; Fri, 06 Jun 2014 03:09:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WsoGt-0004Ww-Kb for qemu-devel@nongnu.org; Fri, 06 Jun 2014 03:09:08 -0400 Received: from oxygen.pond.sub.org ([144.76.244.19]:56085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsoGt-0004Wf-Ea for qemu-devel@nongnu.org; Fri, 06 Jun 2014 03:09:03 -0400 From: Markus Armbruster References: <1399312987-29499-1-git-send-email-dslutz@verizon.com> <1399312987-29499-2-git-send-email-dslutz@verizon.com> Date: Fri, 06 Jun 2014 09:09:00 +0200 In-Reply-To: <1399312987-29499-2-git-send-email-dslutz@verizon.com> (Don Slutz's message of "Mon, 5 May 2014 14:03:06 -0400") Message-ID: <87wqcuzf8z.fsf_-_@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] Should not abort on -global (was: [PATCH v4 1/2] qdev: Display warning about unused -global) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Paolo Bonzini , "Michael S. Tsirkin" , qemu-devel@nongnu.org, Don Slutz , Andreas =?utf-8?Q?F=C3=A4rber?= Nothing wrong with Don's patch as far as I can see, but... Don Slutz writes: > This can help a user understand why -global was ignored. > > For example: with "-vga cirrus"; "-global vga.vgamem_mb=16" is just > ignored when "-global cirrus-vga.vgamem_mb=16" is not. > > This is currently clear when the wrong property is provided: > > out/x86_64-softmmu/qemu-system-x86_64 -global cirrus-vga.vram_size_mb=16 -monitor pty -vga cirrus > char device redirected to /dev/pts/20 (label compat_monitor0) > qemu-system-x86_64: Property '.vram_size_mb' not found > Aborted (core dumped) ... dumping core here is not nice. Looks like this regressed in Eduardo's commit 99a0b03 qdev: Set globals in instance_post_init function. Before, we exited cleanly on this error, in device_initfn(): qdev_prop_set_globals(dev, &err); if (err != NULL) { qerror_report_err(err); error_free(err); exit(1); } The commit asserts qdev_prop_set_globals() can't fail, which is wrong. static void device_post_init(Object *obj) { DeviceState *dev = DEVICE(obj); Error *err = NULL; qdev_prop_set_globals(dev, &err); assert_no_error(err); } Later simplified to: static void device_post_init(Object *obj) { qdev_prop_set_globals(DEVICE(obj), &error_abort); } Any takers? [...]