qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/2] qdev: qdev_unplug(): Use error_set()


From: Luiz Capitulino
Subject: Re: [Qemu-devel] [PATCH 1/2] qdev: qdev_unplug(): Use error_set()
Date: Thu, 29 Mar 2012 10:15:46 -0300

On Thu, 29 Mar 2012 08:00:15 +0100
Stefan Hajnoczi <address@hidden> wrote:

> On Wed, Mar 28, 2012 at 05:50:53PM -0300, Luiz Capitulino wrote:
> > @@ -268,7 +270,14 @@ static int pci_device_hot_remove(Monitor *mon, const 
> > char *pci_addr)
> >          monitor_printf(mon, "slot %d empty\n", slot);
> >          return -1;
> >      }
> > -    return qdev_unplug(&d->qdev);
> > +
> > +    ret = qdev_unplug(&d->qdev, &errp);
> > +    if (error_is_set(&errp)) {
> > +        monitor_printf(mon, "%s\n", error_get_pretty(errp));
> > +        error_free(errp);
> > +    }
> 
> Minor thing if you respin: this if statement could be replaced with 
> hmp_handle_error(mon, &errp).

I'm not sure I'd like to see hmp_handle_error() spread over the tree. It uses
the monitor object and I've added it just because having the same code
duplicated among HMP functions bothered me... I think it's better to
restrict it to hmp.c.



reply via email to

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