From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWlKi-00073u-Nt for qemu-devel@nongnu.org; Wed, 24 Sep 2014 08:06:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWlKc-0002PK-Jg for qemu-devel@nongnu.org; Wed, 24 Sep 2014 08:06:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13760) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWlKc-0002OI-9X for qemu-devel@nongnu.org; Wed, 24 Sep 2014 08:06:02 -0400 Message-ID: <5422B35E.2020006@redhat.com> Date: Wed, 24 Sep 2014 14:04:46 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1411559299-19042-1-git-send-email-imammedo@redhat.com> <1411559299-19042-30-git-send-email-imammedo@redhat.com> In-Reply-To: <1411559299-19042-30-git-send-email-imammedo@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 29/30] qdev: drop legacy hotplug fields/methods List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov , qemu-devel@nongnu.org Cc: dmitry@daynix.com, borntraeger@de.ibm.com, mst@redhat.com, agraf@suse.de, cornelia.huck@de.ibm.com, kraxel@redhat.com, amit.shah@redhat.com, rth@twiddle.net Il 24/09/2014 13:48, Igor Mammedov ha scritto: > @@ -239,10 +239,7 @@ void qdev_unplug(DeviceState *dev, Error **errp) > hotplug_handler_unplug(dev->parent_bus->hotplug_handler, dev, errp); > } > } else { > - assert(dc->unplug != NULL); > - if (dc->unplug(dev) < 0) { /* legacy handler */ > - error_set(errp, QERR_UNDEFINED_ERROR); > - } > + assert(0); > } This is not particularly nice, but it makes sense at this part of the series, since an assert(dev->parent_bus && dev->parent_bus->hotplug_handler); would be changed immediately in the next patch. Also, it would change indentation and make the patch bigger. Hence, please consider adding a 31st patch that changes hotplug_ctrl = qdev_get_hotplug_handler(dev); if (hotplug_ctrl) { ... } else { assert(0); } to hotplug_ctrl = qdev_get_hotplug_handler(dev); assert(hotplug_ctrl); ... Still, this patch is okay. Reviewed-by: Paolo Bonzini Paolo