提交 b2fb483c 编写于 作者: A Andrea Bolognani

qemu: Require QEMU_CAPS_DEVICE_PL011 for pl011

Even though we never format the device on the QEMU command line,
as it's a platform serial device that's not user-instantiable,
we should still make sure it's available before using it.
Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
Reviewed-by: NPavel Hrdina <phrdina@redhat.com>
上级 a45ecb7b
......@@ -9240,6 +9240,7 @@ qemuChrSerialTargetModelToCaps(virDomainChrSerialTargetModel targetModel)
case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE:
return QEMU_CAPS_DEVICE_SCLPLMCONSOLE;
case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011:
return QEMU_CAPS_DEVICE_PL011;
case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE:
case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST:
break;
......@@ -9332,6 +9333,17 @@ qemuBuildSerialCommandLine(virLogManagerPtr logManager,
if (qemuBuildChrDeviceCommandLine(cmd, def, serial, qemuCaps) < 0)
return -1;
} else {
virQEMUCapsFlags caps;
caps = qemuChrSerialTargetModelToCaps(serial->targetModel);
if (caps && !virQEMUCapsGet(qemuCaps, caps)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("'%s' is not supported in this QEMU binary"),
virDomainChrSerialTargetModelTypeToString(serial->targetModel));
return -1;
}
virCommandAddArg(cmd, "-serial");
virCommandAddArgFormat(cmd, "chardev:char%s", serial->info.alias);
}
......
......@@ -1924,10 +1924,13 @@ mymain(void)
DO_TEST_PARSE_ERROR("pseries-serial-invalid-machine", NONE);
DO_TEST("mach-virt-serial-native",
QEMU_CAPS_DEVICE_PL011,
QEMU_CAPS_NODEFCONFIG);
DO_TEST("mach-virt-serial+console-native",
QEMU_CAPS_DEVICE_PL011,
QEMU_CAPS_NODEFCONFIG);
DO_TEST("mach-virt-serial-compat",
QEMU_CAPS_DEVICE_PL011,
QEMU_CAPS_NODEFCONFIG);
DO_TEST("mach-virt-serial-pci",
QEMU_CAPS_NODEFCONFIG,
......@@ -1945,6 +1948,7 @@ mymain(void)
QEMU_CAPS_DEVICE_QEMU_XHCI,
QEMU_CAPS_DEVICE_USB_SERIAL);
DO_TEST("mach-virt-console-native",
QEMU_CAPS_DEVICE_PL011,
QEMU_CAPS_NODEFCONFIG);
DO_TEST("mach-virt-console-virtio",
QEMU_CAPS_NODEFCONFIG);
......@@ -2500,11 +2504,13 @@ mymain(void)
DO_TEST("arm-virt-virtio",
QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DTB,
QEMU_CAPS_DEVICE_VIRTIO_MMIO,
QEMU_CAPS_DEVICE_PL011,
QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM);
DO_TEST("aarch64-virt-virtio",
QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DTB,
QEMU_CAPS_DEVICE_VIRTIO_MMIO,
QEMU_CAPS_DEVICE_PL011,
QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM);
/* Demonstrates the virtio-pci default... namely that there isn't any!
......@@ -2520,6 +2526,7 @@ mymain(void)
QEMU_CAPS_PCI_MULTIFUNCTION,
QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
QEMU_CAPS_DEVICE_IOH3420,
QEMU_CAPS_DEVICE_PL011,
QEMU_CAPS_VIRTIO_SCSI);
DO_TEST("aarch64-virt-2.6-virtio-pci-default",
QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DTB,
......@@ -2528,6 +2535,7 @@ mymain(void)
QEMU_CAPS_OBJECT_GPEX, QEMU_CAPS_DEVICE_PCI_BRIDGE,
QEMU_CAPS_PCI_MULTIFUNCTION,
QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
QEMU_CAPS_DEVICE_PL011,
QEMU_CAPS_DEVICE_IOH3420);
/* Example of using virtio-pci with no explicit PCI controller
but with manual PCI addresses */
......@@ -2646,6 +2654,7 @@ mymain(void)
QEMU_CAPS_MACH_VIRT_GIC_VERSION);
DO_TEST("aarch64-kvm-32-on-64",
QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DEVICE_VIRTIO_MMIO,
QEMU_CAPS_DEVICE_PL011,
QEMU_CAPS_KVM, QEMU_CAPS_CPU_AARCH64_OFF);
DO_TEST_FAILURE("aarch64-kvm-32-on-64",
QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DEVICE_VIRTIO_MMIO,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册