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

[Xen-changelog] [qemu-xen-unstable] pass-through: Catch errors in do_pci_del()



commit c6ef16ca6b55aba22f287caaa30ad5ed5e772e88
Author: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Date:   Wed Jun 3 15:38:09 2009 +0100

    pass-through: Catch errors in do_pci_del()
    
    (The strdup() is needed because the parsing of devname is destructive.)
    
    Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>
---
 xen-vl-extra.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/xen-vl-extra.c b/xen-vl-extra.c
index 3d13583..7beb6ef 100644
--- a/xen-vl-extra.c
+++ b/xen-vl-extra.c
@@ -103,9 +103,21 @@ struct qemu_alarm_timer;
 void do_pci_del(char *devname)
 {
     int pci_slot;
+    char *devname_cpy;
+
+    devname_cpy = strdup(devname);
+    if (!devname_cpy)
+        return;
+
     pci_slot = bdf_to_slot(devname);
 
-    acpi_php_del(pci_slot);
+    if (pci_slot < 0)
+        fprintf(logfile, "Device \"%s\" is not used by a hotplug device.\n",
+                devname_cpy);
+    else
+        acpi_php_del(pci_slot);
+
+    free(devname_cpy);
 }
 
 void do_pci_add(char *devname)
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.