WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH, RFC]: qemu: hang-free/error-tolerant PCI hot-plug pr

To: Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH, RFC]: qemu: hang-free/error-tolerant PCI hot-plug protocol
From: Gianni Tedesco <gianni.tedesco@xxxxxxxxxx>
Date: Thu, 29 Jul 2010 18:54:18 +0100
Delivery-date: Thu, 29 Jul 2010 11:00:26 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi,

The interface for PCI hotplug is flexible enough to shoot ones-self in
the foot. It is possible to try to insert a PCI device in to a slot
already occupied by a qemu emulated device (NIC, PIIX, ISA-bridge, etc.)
In this case qemu (wisely) refuses to do the hotplug. Since there is no
way for a toolstack to query qemu's pci device layout there is no way to
check for this ahead of time. In this case the toolstack must wait for
device-model state to change to pci-inserted which never happens.

I propose that when qemu decides not to hot-plug a device that it raise
the "pci-inserted" status anyway. The tools must then check the
"parameter" key in xenbus for a non-error string. In other words:

send_command("pci-ins")
wait_for_device_model("pci-inserted")
if parameter[0-2] == "0x" {
        /* success */
}else{
        /* fail */
}

Unless there is some other way of dealing with this that I am missing?

Thanks

diff --git a/hw/piix4acpi.c b/hw/piix4acpi.c
index 1efa77d..4d59ad4 100644
--- a/hw/piix4acpi.c
+++ b/hw/piix4acpi.c
@@ -620,6 +620,7 @@ void acpi_php_add(int devfn)
         if ( strlen(ret_str) > 0 )
             xenstore_record_dm("parameter", ret_str);
 
+        xenstore_record_dm_state("pci-inserted");
         return;
     }
 



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel