"vnc",
"drive-mirror", /* 115 */
+ "usb-redir.bootindex",
+ "usb-host.bootindex",
);
struct _qemuCaps {
static struct qemuCapsStringFlags qemuCapsObjectPropsUsbRedir[] = {
{ "filter", QEMU_CAPS_USB_REDIR_FILTER },
+ { "bootindex", QEMU_CAPS_USB_REDIR_BOOTINDEX },
+};
+
+static struct qemuCapsStringFlags qemuCapsObjectPropsUsbHost[] = {
+ { "bootindex", QEMU_CAPS_USB_HOST_BOOTINDEX },
};
struct qemuCapsObjectTypeProps {
ARRAY_CARDINALITY(qemuCapsObjectPropsPixx4PM) },
{ "usb-redir", qemuCapsObjectPropsUsbRedir,
ARRAY_CARDINALITY(qemuCapsObjectPropsUsbRedir) },
+ { "usb-host", qemuCapsObjectPropsUsbHost,
+ ARRAY_CARDINALITY(qemuCapsObjectPropsUsbHost) },
};
"-device", "PIIX4_PM,?",
"-device", "usb-redir,?",
"-device", "ide-drive,?",
+ "-device", "usb-host,?",
NULL);
/* qemu -help goes to stdout, but qemu -device ? goes to stderr. */
virCommandSetErrorBuffer(cmd, &output);
}
}
+ if (dev->info.bootIndex) {
+ if (!qemuCapsGet(caps, QEMU_CAPS_USB_REDIR_BOOTINDEX)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("USB redirection booting is not "
+ "supported by this version of QEMU"));
+ goto error;
+ }
+ virBufferAsprintf(&buf, ",bootindex=%d", dev->info.bootIndex);
+ }
+
if (qemuBuildDeviceAddressStr(&buf, &dev->info, caps) < 0)
goto error;
dev->source.subsys.u.usb.device);
}
virBufferAsprintf(&buf, ",id=%s", dev->info->alias);
+ if (dev->info->bootIndex)
+ virBufferAsprintf(&buf, ",bootindex=%d", dev->info->bootIndex);
if (qemuBuildDeviceAddressStr(&buf, dev->info, caps) < 0)
goto error;
if (hostdev->info->bootIndex) {
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS ||
- hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI) {
+ (hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI &&
+ hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("booting from assigned devices is only"
- " supported for PCI devices"));
- goto error;
- } else if (!qemuCapsGet(caps, QEMU_CAPS_PCI_BOOTINDEX)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("booting from assigned PCI devices is not"
- " supported with this version of qemu"));
+ " supported for PCI and USB devices"));
goto error;
+ } else {
+ if (hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI &&
+ !qemuCapsGet(caps, QEMU_CAPS_PCI_BOOTINDEX)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("booting from assigned PCI devices is not"
+ " supported with this version of qemu"));
+ goto error;
+ }
+ if (hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB &&
+ !qemuCapsGet(caps, QEMU_CAPS_USB_HOST_BOOTINDEX)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("booting from assigned USB devices is not"
+ " supported with this version of qemu"));
+ goto error;
+ }
}
}