From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLzv5-0002RJ-1B for qemu-devel@nongnu.org; Tue, 17 Sep 2013 14:22:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VLzv0-0007jX-5L for qemu-devel@nongnu.org; Tue, 17 Sep 2013 14:22:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49550) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLzuz-0007jN-TZ for qemu-devel@nongnu.org; Tue, 17 Sep 2013 14:22:34 -0400 Date: Tue, 17 Sep 2013 14:22:25 -0400 From: Luiz Capitulino Message-ID: <20130917142225.6f608216@redhat.com> In-Reply-To: <52389470.8060505@suse.de> References: <1379424752-11456-1-git-send-email-imammedo@redhat.com> <52389470.8060505@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] qdev: fix crash when device_add is called with abstract driver List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?UTF-8?B?RsOkcmJlcg==?= Cc: Stefan Weil , qemu-devel@nongnu.org, Anthony Liguori , Paolo Bonzini , Igor Mammedov , Wenchao Xia On Tue, 17 Sep 2013 19:42:08 +0200 Andreas F=C3=A4rber wrote: > > diff --git a/qdev-monitor.c b/qdev-monitor.c > > index 410cdcb..bb2e1b6 100644 > > --- a/qdev-monitor.c > > +++ b/qdev-monitor.c > > @@ -472,6 +472,12 @@ DeviceState *qdev_device_add(QemuOpts *opts) > > return NULL; > > } > > =20 > > + if (object_class_is_abstract(obj)) { > > + qerror_report(QERR_INVALID_PARAMETER_VALUE, "driver", > > + "non-abstract device type"); >=20 > Is qerror_report() still okay despite the QERR_* considered obsolete for > error_set()? I.e. because this is only printing the text and not passing > on error classes? This is OK because qdev_device_add() still uses qerror_report(). This is so because do_device_add() (the QMP/HMP command in question) hasn't been converted yet. > Or where do we draw the line? (CC Luiz) We should convert old qerror_report() users to error_set() whenever doing error-related changes. But sometimes it may not be practical to do it right away (this case).