From 6c560b2d3aa2b2e4ecec44270c814ff9faf5c484 Mon Sep 17 00:00:00 2001 From: Jonathon Jongsma Date: Thu, 25 Jun 2020 15:18:22 -0500 Subject: [PATCH] qemu: ramfb video device doesn't support PCI address Although a ramfb video device is not a PCI device, we don't currently report an error for ramfb device definitions containing a PCI address. However, a guest configured with such a device will fail to start: # virsh start test1 error: Failed to start domain test1 error: internal error: qemu unexpectedly closed the monitor: 2020-06-16T05:23:02.759221Z qemu-kvm: -device ramfb,id=video0,bus=pcie.0,addr=0x1: Device 'ramfb' can't go on PCIE bus A better approach is to reject any device definitions that contain PCI addresses. While this is a change in behavior, any existing configurations were non-functional. https://bugzilla.redhat.com/show_bug.cgi?id=1847259 Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_validate.c | 8 +++++ ...video-ramfb-display-device-pci-address.xml | 30 +++++++++++++++++++ tests/qemuxml2argvtest.c | 1 + 3 files changed, 39 insertions(+) create mode 100644 tests/qemuxml2argvdata/video-ramfb-display-device-pci-address.xml diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 5082a29dc7..b13c03759e 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1925,6 +1925,14 @@ qemuValidateDomainDeviceDefVideo(const virDomainVideoDef *video, if (qemuValidateDomainVirtioOptions(video->virtio, qemuCaps) < 0) return -1; + if (video->type == VIR_DOMAIN_VIDEO_TYPE_RAMFB && + video->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("'address' is not supported for 'ramfb' video devices")); + return -1; + } + + return 0; } diff --git a/tests/qemuxml2argvdata/video-ramfb-display-device-pci-address.xml b/tests/qemuxml2argvdata/video-ramfb-display-device-pci-address.xml new file mode 100644 index 0000000000..db110560ac --- /dev/null +++ b/tests/qemuxml2argvdata/video-ramfb-display-device-pci-address.xml @@ -0,0 +1,30 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 1048576 + 1048576 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i386 + + + + +
+ + +