[pve-devel] [PATCH 1/2] uhci controller : use new -device syntax

Alexandre Derumier aderumier at odiso.com
Fri Feb 22 11:39:13 CET 2013


we need an id to allow hotplug

info pci before
---------------
  Bus  0, device   1, function 2:
    USB controller: PCI device 8086:7020
      IRQ 11.
      BAR4: I/O at 0xc040 [0xc05f].
      id ""

info pci after
--------------
  Bus  0, device   1, function 2:
    USB controller: PCI device 8086:7020
      IRQ 11.
      BAR4: I/O at 0xc040 [0xc05f].
      id "uhci"

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/QemuServer.pm |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 14735d2..fc46d4e 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2192,6 +2192,9 @@ sub config_to_command {
 
     push @$cmd, '-daemonize';
 
+    $pciaddr = print_pci_addr("piix3", $bridges);
+    push @$devices, '-device', "piix3-usb-uhci,id=uhci$pciaddr.0x2";
+
     my $use_usb2 = 0;
     for (my $i = 0; $i < $MAX_USB_DEVICES; $i++)  {
 	next if !$conf->{"usb$i"};
@@ -3356,7 +3359,7 @@ sub print_pci_addr {
 
     my $res = '';
     my $devices = {
-	#addr1 : ide,parallel,serial (motherboard)
+	piix3 => { bus => 0, addr => 1 },
 	#addr2 : first videocard
 	balloon0 => { bus => 0, addr => 3 },
 	watchdog => { bus => 0, addr => 4 },
-- 
1.7.10.4




More information about the pve-devel mailing list