From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55303) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDFEM-0003hY-1W for qemu-devel@nongnu.org; Thu, 29 Mar 2012 09:17:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SDFEF-0007ku-Mi for qemu-devel@nongnu.org; Thu, 29 Mar 2012 09:17:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23095) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDFEF-0007kj-Ec for qemu-devel@nongnu.org; Thu, 29 Mar 2012 09:17:27 -0400 Date: Thu, 29 Mar 2012 10:17:31 -0300 From: Luiz Capitulino Message-ID: <20120329101731.0d509b4e@doriath.home> In-Reply-To: <20120329070851.GC13344@stefanha-thinkpad.localdomain> References: <1332967854-29106-1-git-send-email-lcapitulino@redhat.com> <1332967854-29106-3-git-send-email-lcapitulino@redhat.com> <20120329070851.GC13344@stefanha-thinkpad.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] qapi: convert device_del List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org On Thu, 29 Mar 2012 08:08:51 +0100 Stefan Hajnoczi wrote: > On Wed, Mar 28, 2012 at 05:50:54PM -0300, Luiz Capitulino wrote: > > ret = qdev_unplug(dev, &local_err); > > if (error_is_set(&local_err)) { > > - qerror_report_err(local_err); > > - error_free(local_err); > > + error_propagate(errp, local_err); > > + } else if (ret) { > > + error_set(errp, QERR_UNDEFINED_ERROR); > > Can we make qdev_unplug() void? I can find no case in QEMU where we > return != 0 without setting error. If we fix the function prototype > this invalid state can be eliminated forever. Good point, I'll change it. > > (Other functions that take Error **errp are usually void.) > > > diff --git a/qapi-schema.json b/qapi-schema.json > > index 0d11d6e..ace55f3 100644 > > --- a/qapi-schema.json > > +++ b/qapi-schema.json > > @@ -1701,3 +1701,23 @@ > > # Since: 1.1 > > ## > > { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} } > > + > > +## > > +# @device_del: > > +# > > +# Remove a device from a guest > > +# > > +# @id: the name of the device > > +# > > +# Returns: Nothing on success > > +# If @id is not a valid device, DeviceNotFound > > +# If the device does not support unplug, BusNoHotplug > > +# > > +# Notes: When this command completes, the device may not be removed from the > > +# guest. Hot removal is an operation that requires guest cooperation. > > +# This command merely requests that the guest begin the hot removal > > +# process. > > I have not peeked at the implementation in QEMU or libvirt, but is there > a QMP event for actual removal or would the user need to poll? This bit > of information would be useful in the documentation. There's no event, I'll document it. Is there any preferred method for polling? query-pci?