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-changelog

[Xen-changelog] [qemu-xen-3.4-testing] usb hotplug in qemu-dm via xm

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [qemu-xen-3.4-testing] usb hotplug in qemu-dm via xm
From: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Date: Thu, 5 Nov 2009 03:50:10 -0800
Delivery-date: Thu, 05 Nov 2009 03:50:12 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
commit 8704e492321dae8ad76fa9a5cb56f48baddc360e
Author: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Date:   Tue Oct 20 15:16:34 2009 +0100

    usb hotplug in qemu-dm via xm
    
    Add the two commands( "xm usb-add" and "xm usb-del") to add or delete
    the usb device instead of do it in QEMU console.
    
    Signed-off-by: James Song Wei <jsong@xxxxxxxxxx<mailto:jsong@xxxxxxxxxx>>
    (cherry picked from commit a3285ff385d2568f0226f15fee2b9808ec3b6deb)
---
 xenstore.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/xenstore.c b/xenstore.c
index 9360771..46915fb 100644
--- a/xenstore.c
+++ b/xenstore.c
@@ -819,6 +819,34 @@ static void xenstore_process_dm_command_event(void)
     } else if (!strncmp(command, "continue", len)) {
         fprintf(logfile, "dm-command: continue after state save\n");
         xen_pause_requested = 0;
+    } else if (!strncmp(command, "usb-add", len)) {
+        fprintf(logfile, "dm-command: usb-add a usb device\n");
+        if (pasprintf(&path,
+                "/local/domain/0/device-model/%u/parameter", domid) == -1) {
+            fprintf(logfile, "out of memory reading dm command parameter\n");
+            goto out;
+        }
+        par = xs_read(xsh, XBT_NULL, path, &len);
+        fprintf(logfile, "dm-command: usb-add a usb device: %s \n", par);
+        if (!par)
+            goto out;
+        do_usb_add(par);
+        xenstore_record_dm_state("usb-added");
+        fprintf(logfile, "dm-command: finish usb-add a usb device:%s\n",par);
+    } else if (!strncmp(command, "usb-del", len)) {
+        fprintf(logfile, "dm-command: usb-del a usb device\n");
+        if (pasprintf(&path,
+                "/local/domain/0/device-model/%u/parameter", domid) == -1) {
+            fprintf(logfile, "out of memory reading dm command parameter\n");
+            goto out;
+        }
+        par = xs_read(xsh, XBT_NULL, path, &len);
+        fprintf(logfile, "dm-command: usb-del a usb device: %s \n", par);
+        if (!par)
+            goto out;
+        do_usb_del(par);
+        xenstore_record_dm_state("usb-deleted");
+        fprintf(logfile, "dm-command: finish usb-del a usb device:%s\n",par);
 #ifdef CONFIG_PASSTHROUGH
     } else if (!strncmp(command, "pci-rem", len)) {
         fprintf(logfile, "dm-command: hot remove pass-through pci dev \n");
--
generated by git-patchbot for /home/xen/git/qemu-xen-3.4-testing.git

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [qemu-xen-3.4-testing] usb hotplug in qemu-dm via xm, Ian Jackson <=