qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Cannot not unplug cold-plugged devices


From: Cam Macdonell
Subject: [Qemu-devel] Cannot not unplug cold-plugged devices
Date: Thu, 11 Nov 2010 23:29:39 -0700

Hi,

I was trying to do a "device_del" on my ivshmem device and it won't
work unless the device is added via hotplug.  If the device is
coldplugged (added at startup) then nothing happens.  I think I
tracked this behaviour to the patch below.

Is not allowing coldplugged devices to be unplugged the desired behaviour?

Thanks,
Cam

commit 5beb8ad503c88a76f2b8106c3b74b4ce485a60e1
Author: Isaku Yamahata <address@hidden>
Date:   Mon Sep 6 16:46:18 2010 +0900

    pci: call hotplug callback even when not hotplug case for later use.

    call hotplug callback even when not hotplug case for later use.
    And move hotplug check into hotplug callback.
    PCIE slot needs this for card presence detection.

    Signed-off-by: Isaku Yamahata <address@hidden>
    Signed-off-by: Michael S. Tsirkin <address@hidden>

diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
index bfa1d9a..24dfcf2 100644
--- a/hw/acpi_piix4.c
+++ b/hw/acpi_piix4.c
@@ -611,6 +611,9 @@ static int piix4_device_hotplug(DeviceState *qdev,
PCIDevice *dev, int state)
     PIIX4PMState *s = DO_UPCAST(PIIX4PMState, dev,
                                 DO_UPCAST(PCIDevice, qdev, qdev));

+    if (!dev->qdev.hotplugged)
+        return 0;
+
     s->pci0_status.up = 0;
     s->pci0_status.down = 0;
     if (state) {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]