]> git.proxmox.com Git - mirror_qemu.git/blobdiff - vl.c
Add CDC-Ethernet usb NIC (original patch from Thomas Sailer).
[mirror_qemu.git] / vl.c
diff --git a/vl.c b/vl.c
index c8db57983b146ffb138896e554fd4771b569899a..043e484f1178994d3675065de9517e0b56b8207d 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -5475,6 +5475,12 @@ static int usb_device_add(const char *devname)
     } else if (!strcmp(devname, "braille")) {
         dev = usb_baum_init();
 #endif
+    } else if (strstart(devname, "net:", &p)) {
+        int nicidx = strtoul(p, NULL, 0);
+
+        if (nicidx >= nb_nics || strcmp(nd_table[nicidx].model, "usb"))
+            return -1;
+        dev = usb_net_init(&nd_table[nicidx]);
     } else {
         return -1;
     }