From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MrHrZ-00052m-Dn for qemu-devel@nongnu.org; Fri, 25 Sep 2009 16:57:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MrHrY-00051v-As for qemu-devel@nongnu.org; Fri, 25 Sep 2009 16:57:56 -0400 Received: from [199.232.76.173] (port=53962 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MrHrX-00051p-Rn for qemu-devel@nongnu.org; Fri, 25 Sep 2009 16:57:55 -0400 Received: from qw-out-1920.google.com ([74.125.92.149]:54627) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MrHrV-0007O0-G1 for qemu-devel@nongnu.org; Fri, 25 Sep 2009 16:57:54 -0400 Received: by qw-out-1920.google.com with SMTP id 5so951541qwc.4 for ; Fri, 25 Sep 2009 13:57:51 -0700 (PDT) Message-ID: <4ABD2ECB.2080405@codemonkey.ws> Date: Fri, 25 Sep 2009 15:57:47 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 00/24] qdev: bus management updates. References: <1253907769-1067-1-git-send-email-kraxel@redhat.com> In-Reply-To: <1253907769-1067-1-git-send-email-kraxel@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org Gerd Hoffmann wrote: > Hi, > > One more respin, even more improvements. > > hotplug, meet qdev. > qdev, meet hotplug. > > Changes summary: > > * allow embedded bus structs. > * add bus release function. > * added device destruction callback to qdev devices. > * make qdev hotplug-aware (NEW!). > * make busses use the new features. > > End result is that you can use qdev_unplug() to unplug a device. > Depending on the bus this will either not work at all (ISA), ask the > guest OS to release the device (PCI+ACPI) or just zap it (USB). > > Using the destruction callback everything will be released properly when > a device is zapped. qdev will walk the child bus(es) if present and zap > all connected devices too. > > You can pci_del the scsi adapter and all scsi disks will be deleted too. > You can pci_del the usb controller and all usb devices connected will be > deleted too. You can unplug usb hubs, all connected devices will go away > too. > Very nice! Regards, Anthony Liguori