qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] qdev: fix crash when device_add is called with


From: Luiz Capitulino
Subject: Re: [Qemu-devel] [PATCH] qdev: fix crash when device_add is called with abstract driver
Date: Tue, 17 Sep 2013 14:22:25 -0400

On Tue, 17 Sep 2013 19:42:08 +0200
Andreas Färber <address@hidden> 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;
> >      }
> >  
> > +    if (object_class_is_abstract(obj)) {
> > +        qerror_report(QERR_INVALID_PARAMETER_VALUE, "driver",
> > +                      "non-abstract device type");
> 
> 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).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]