On Thu, Mar 29, 2012 at 2:15 PM, Luiz Capitulino <lcapitul...@redhat.com> wrote: > On Thu, 29 Mar 2012 08:00:15 +0100 > Stefan Hajnoczi <stefa...@gmail.com> 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.
Okay. I mentioned it because I noticed that there are several different ways to do essentially the same thing. Stefan