From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGY7w-0003OK-Ta for qemu-devel@nongnu.org; Thu, 20 Feb 2014 13:13:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGY7r-0008I6-Ls for qemu-devel@nongnu.org; Thu, 20 Feb 2014 13:13:40 -0500 Received: from smtp02.citrix.com ([66.165.176.63]:16336) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGY7r-0008Hz-I9 for qemu-devel@nongnu.org; Thu, 20 Feb 2014 13:13:35 -0500 From: Stefano Stabellini Date: Thu, 20 Feb 2014 18:13:21 +0000 Message-ID: <1392920002-18522-1-git-send-email-stefano.stabellini@eu.citrix.com> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PULL 1/2] Call pci_piix3_xen_ide_unplug from unplug_disks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: peter.maydell@linaro.org, olaf@aepfle.de, xen-devel@lists.xensource.com, Stefano Stabellini , qemu-devel@nongnu.org, Anthony.Perard@citrix.com, pbonzini@redhat.com Signed-off-by: Stefano Stabellini Acked-by: Paolo Bonzini --- hw/ide/piix.c | 3 +-- hw/xen/xen_platform.c | 3 ++- include/hw/ide.h | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/ide/piix.c b/hw/ide/piix.c index 0eda301..40757eb 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -167,7 +167,7 @@ static int pci_piix_ide_initfn(PCIDevice *dev) return 0; } -static int pci_piix3_xen_ide_unplug(DeviceState *dev) +int pci_piix3_xen_ide_unplug(DeviceState *dev) { PCIIDEState *pci_ide; DriveInfo *di; @@ -266,7 +266,6 @@ static void piix3_ide_xen_class_init(ObjectClass *klass, void *data) k->device_id = PCI_DEVICE_ID_INTEL_82371SB_1; k->class_id = PCI_CLASS_STORAGE_IDE; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); - dc->unplug = pci_piix3_xen_ide_unplug; } static const TypeInfo piix3_ide_xen_info = { diff --git a/hw/xen/xen_platform.c b/hw/xen/xen_platform.c index 70875e4..1d9d0e9 100644 --- a/hw/xen/xen_platform.c +++ b/hw/xen/xen_platform.c @@ -27,6 +27,7 @@ #include "hw/hw.h" #include "hw/i386/pc.h" +#include "hw/ide.h" #include "hw/pci/pci.h" #include "hw/irq.h" #include "hw/xen/xen_common.h" @@ -110,7 +111,7 @@ static void unplug_disks(PCIBus *b, PCIDevice *d, void *o) if (pci_get_word(d->config + PCI_CLASS_DEVICE) == PCI_CLASS_STORAGE_IDE && strcmp(d->name, "xen-pci-passthrough") != 0) { - qdev_unplug(DEVICE(d), NULL); + pci_piix3_xen_ide_unplug(DEVICE(d)); } } diff --git a/include/hw/ide.h b/include/hw/ide.h index 507e6d3..bc8bd32 100644 --- a/include/hw/ide.h +++ b/include/hw/ide.h @@ -17,6 +17,7 @@ void pci_cmd646_ide_init(PCIBus *bus, DriveInfo **hd_table, PCIDevice *pci_piix3_xen_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn); PCIDevice *pci_piix3_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn); PCIDevice *pci_piix4_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn); +int pci_piix3_xen_ide_unplug(DeviceState *dev); void vt82c686b_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn); /* ide-mmio.c */ -- 1.7.10.4