This patch will allow usb-net devices to be automatically assigned a USB
address (and skip any attempt to assign a PCI one).
Signed-off-by: Rayhan Faizel <rayhan.faizel@gmail.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
``virtio-transitional`` and ``virtio-non-transitional`` values are supported.
See `Virtio transitional devices`_ for more details.
:since:`Since 9.3.0` igb is also supported.
+:since:`Since 10.3.0` usb-net is supported.
Setting NIC driver-specific options
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
}
}
- /* TODO: add def->nets here when libvirt starts supporting usb-net */
+ /* usb-net */
+ for (i = 0; i < def->nnets; i++) {
+ virDomainNetDef *net = def->nets[i];
+ if (net->model == VIR_DOMAIN_NET_MODEL_USB_NET) {
+ if (iter(&net->info, opaque) < 0)
+ return -1;
+ }
+ }
/* usb-ccid */
for (i = 0; i < def->ncontrollers; i++) {
for (i = 0; i < def->nnets; i++) {
virDomainNetDef *net = def->nets[i];
+ if (net->model == VIR_DOMAIN_NET_MODEL_USB_NET) {
+ continue;
+ }
+
/* type='hostdev' network devices might be USB, and are also
* in hostdevs list anyway, so handle them with other hostdevs
* instead of here.