mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 17:34:18 +03:00
qemu: Drop QEMU_CAPS_PCI_ROMBAR
The only QEMU versions that don't have such capability are <0.12, which we no longer support anyway. Additionally, this solves the issue of some QEMU binaries being reported as not having such capability just because they lacked the {kvm-}pci-assign QMP object.
This commit is contained in:
parent
1222a3032b
commit
8531b85ba6
@ -1303,19 +1303,6 @@ virQEMUCapsComputeCmdFlags(const char *help,
|
||||
if (version >= 13000)
|
||||
virQEMUCapsSet(qemuCaps, QEMU_CAPS_PCI_MULTIFUNCTION);
|
||||
|
||||
/* Although very new versions of qemu advertise the presence of
|
||||
* the rombar option in the output of "qemu -device pci-assign,?",
|
||||
* this advertisement was added to the code long after the option
|
||||
* itself. According to qemu developers, though, rombar is
|
||||
* available in all qemu binaries from release 0.12 onward.
|
||||
* Setting the capability this way makes it available in more
|
||||
* cases where it might be needed, and shouldn't cause any false
|
||||
* positives (in the case that it did, qemu would produce an error
|
||||
* log and refuse to start, so it would be immediately obvious).
|
||||
*/
|
||||
if (version >= 12000)
|
||||
virQEMUCapsSet(qemuCaps, QEMU_CAPS_PCI_ROMBAR);
|
||||
|
||||
if (version >= 11000)
|
||||
virQEMUCapsSet(qemuCaps, QEMU_CAPS_CPU_HOST);
|
||||
|
||||
@ -1614,7 +1601,6 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioSCSI[] = {
|
||||
};
|
||||
|
||||
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsPCIAssign[] = {
|
||||
{ "rombar", QEMU_CAPS_PCI_ROMBAR },
|
||||
{ "configfd", QEMU_CAPS_PCI_CONFIGFD },
|
||||
{ "bootindex", QEMU_CAPS_PCI_BOOTINDEX },
|
||||
};
|
||||
|
@ -152,7 +152,7 @@ typedef enum {
|
||||
|
||||
/* 75 */
|
||||
QEMU_CAPS_DRIVE_CACHE_UNSAFE, /* Is cache=unsafe supported? */
|
||||
QEMU_CAPS_PCI_ROMBAR, /* -device rombar=0|1 */
|
||||
X_QEMU_CAPS_PCI_ROMBAR, /* -device rombar=0|1 */
|
||||
QEMU_CAPS_ICH9_AHCI, /* -device ich9-ahci */
|
||||
QEMU_CAPS_NO_ACPI, /* -no-acpi */
|
||||
QEMU_CAPS_FSDEV_READONLY, /* -fsdev readonly supported */
|
||||
|
@ -508,8 +508,7 @@ qemuBuildDeviceAddressStr(virBufferPtr buf,
|
||||
|
||||
static int
|
||||
qemuBuildRomStr(virBufferPtr buf,
|
||||
virDomainDeviceInfoPtr info,
|
||||
virQEMUCapsPtr qemuCaps)
|
||||
virDomainDeviceInfoPtr info)
|
||||
{
|
||||
if (info->rombar || info->romfile) {
|
||||
if (info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) {
|
||||
@ -517,11 +516,6 @@ qemuBuildRomStr(virBufferPtr buf,
|
||||
"%s", _("rombar and romfile are supported only for PCI devices"));
|
||||
return -1;
|
||||
}
|
||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_ROMBAR)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
"%s", _("rombar and romfile not supported in this QEMU binary"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch (info->rombar) {
|
||||
case VIR_TRISTATE_SWITCH_OFF:
|
||||
@ -3400,7 +3394,7 @@ qemuBuildNicDevStr(virDomainDefPtr def,
|
||||
virMacAddrFormat(&net->mac, macaddr));
|
||||
if (qemuBuildDeviceAddressStr(&buf, def, &net->info, qemuCaps) < 0)
|
||||
goto error;
|
||||
if (qemuBuildRomStr(&buf, &net->info, qemuCaps) < 0)
|
||||
if (qemuBuildRomStr(&buf, &net->info) < 0)
|
||||
goto error;
|
||||
if (bootindex && virQEMUCapsGet(qemuCaps, QEMU_CAPS_BOOTINDEX))
|
||||
virBufferAsprintf(&buf, ",bootindex=%u", bootindex);
|
||||
@ -4469,7 +4463,7 @@ qemuBuildPCIHostdevDevStr(const virDomainDef *def,
|
||||
virBufferAsprintf(&buf, ",bootindex=%u", bootIndex);
|
||||
if (qemuBuildDeviceAddressStr(&buf, def, dev->info, qemuCaps) < 0)
|
||||
goto error;
|
||||
if (qemuBuildRomStr(&buf, dev->info, qemuCaps) < 0)
|
||||
if (qemuBuildRomStr(&buf, dev->info) < 0)
|
||||
goto error;
|
||||
|
||||
if (virBufferCheckError(&buf) < 0)
|
||||
|
@ -51,7 +51,6 @@
|
||||
<flag name='usb-hub'/>
|
||||
<flag name='no-shutdown'/>
|
||||
<flag name='cache-unsafe'/>
|
||||
<flag name='rombar'/>
|
||||
<flag name='ich9-ahci'/>
|
||||
<flag name='no-acpi'/>
|
||||
<flag name='fsdev-readonly'/>
|
||||
|
@ -51,7 +51,6 @@
|
||||
<flag name='usb-hub'/>
|
||||
<flag name='no-shutdown'/>
|
||||
<flag name='cache-unsafe'/>
|
||||
<flag name='rombar'/>
|
||||
<flag name='ich9-ahci'/>
|
||||
<flag name='no-acpi'/>
|
||||
<flag name='fsdev-readonly'/>
|
||||
|
@ -50,7 +50,6 @@
|
||||
<flag name='usb-hub'/>
|
||||
<flag name='no-shutdown'/>
|
||||
<flag name='cache-unsafe'/>
|
||||
<flag name='rombar'/>
|
||||
<flag name='ich9-ahci'/>
|
||||
<flag name='no-acpi'/>
|
||||
<flag name='fsdev-readonly'/>
|
||||
|
@ -51,7 +51,6 @@
|
||||
<flag name='usb-hub'/>
|
||||
<flag name='no-shutdown'/>
|
||||
<flag name='cache-unsafe'/>
|
||||
<flag name='rombar'/>
|
||||
<flag name='ich9-ahci'/>
|
||||
<flag name='no-acpi'/>
|
||||
<flag name='fsdev-readonly'/>
|
||||
|
@ -51,7 +51,6 @@
|
||||
<flag name='usb-hub'/>
|
||||
<flag name='no-shutdown'/>
|
||||
<flag name='cache-unsafe'/>
|
||||
<flag name='rombar'/>
|
||||
<flag name='ich9-ahci'/>
|
||||
<flag name='no-acpi'/>
|
||||
<flag name='fsdev-readonly'/>
|
||||
|
@ -52,7 +52,6 @@
|
||||
<flag name='usb-hub'/>
|
||||
<flag name='no-shutdown'/>
|
||||
<flag name='cache-unsafe'/>
|
||||
<flag name='rombar'/>
|
||||
<flag name='ich9-ahci'/>
|
||||
<flag name='no-acpi'/>
|
||||
<flag name='fsdev-readonly'/>
|
||||
|
@ -51,7 +51,6 @@
|
||||
<flag name='usb-hub'/>
|
||||
<flag name='no-shutdown'/>
|
||||
<flag name='cache-unsafe'/>
|
||||
<flag name='rombar'/>
|
||||
<flag name='ich9-ahci'/>
|
||||
<flag name='no-acpi'/>
|
||||
<flag name='fsdev-readonly'/>
|
||||
|
@ -51,7 +51,6 @@
|
||||
<flag name='usb-hub'/>
|
||||
<flag name='no-shutdown'/>
|
||||
<flag name='cache-unsafe'/>
|
||||
<flag name='rombar'/>
|
||||
<flag name='ich9-ahci'/>
|
||||
<flag name='no-acpi'/>
|
||||
<flag name='fsdev-readonly'/>
|
||||
|
@ -51,7 +51,6 @@
|
||||
<flag name='usb-hub'/>
|
||||
<flag name='no-shutdown'/>
|
||||
<flag name='cache-unsafe'/>
|
||||
<flag name='rombar'/>
|
||||
<flag name='ich9-ahci'/>
|
||||
<flag name='no-acpi'/>
|
||||
<flag name='fsdev-readonly'/>
|
||||
|
@ -167,7 +167,6 @@ mymain(void)
|
||||
QEMU_CAPS_VGA_NONE,
|
||||
QEMU_CAPS_DRIVE_AIO,
|
||||
QEMU_CAPS_NO_SHUTDOWN,
|
||||
QEMU_CAPS_PCI_ROMBAR,
|
||||
QEMU_CAPS_NO_ACPI,
|
||||
QEMU_CAPS_VIRTIO_BLK_SG_IO,
|
||||
QEMU_CAPS_CPU_HOST,
|
||||
@ -204,7 +203,6 @@ mymain(void)
|
||||
QEMU_CAPS_PIIX4_USB_UHCI,
|
||||
QEMU_CAPS_USB_HUB,
|
||||
QEMU_CAPS_NO_SHUTDOWN,
|
||||
QEMU_CAPS_PCI_ROMBAR,
|
||||
QEMU_CAPS_NO_ACPI,
|
||||
QEMU_CAPS_VIRTIO_BLK_SG_IO,
|
||||
QEMU_CAPS_CPU_HOST,
|
||||
@ -243,7 +241,6 @@ mymain(void)
|
||||
QEMU_CAPS_VGA_NONE,
|
||||
QEMU_CAPS_DRIVE_AIO,
|
||||
QEMU_CAPS_NO_SHUTDOWN,
|
||||
QEMU_CAPS_PCI_ROMBAR,
|
||||
QEMU_CAPS_NO_ACPI,
|
||||
QEMU_CAPS_VIRTIO_BLK_SG_IO,
|
||||
QEMU_CAPS_CPU_HOST,
|
||||
@ -286,7 +283,6 @@ mymain(void)
|
||||
QEMU_CAPS_PCI_OHCI,
|
||||
QEMU_CAPS_USB_HUB,
|
||||
QEMU_CAPS_NO_SHUTDOWN,
|
||||
QEMU_CAPS_PCI_ROMBAR,
|
||||
QEMU_CAPS_NO_ACPI,
|
||||
QEMU_CAPS_VIRTIO_BLK_SG_IO,
|
||||
QEMU_CAPS_CPU_HOST,
|
||||
@ -344,7 +340,6 @@ mymain(void)
|
||||
QEMU_CAPS_PIIX4_USB_UHCI,
|
||||
QEMU_CAPS_USB_HUB,
|
||||
QEMU_CAPS_NO_SHUTDOWN,
|
||||
QEMU_CAPS_PCI_ROMBAR,
|
||||
QEMU_CAPS_NO_ACPI,
|
||||
QEMU_CAPS_VIRTIO_BLK_SCSI,
|
||||
QEMU_CAPS_VIRTIO_BLK_SG_IO,
|
||||
@ -407,7 +402,6 @@ mymain(void)
|
||||
QEMU_CAPS_ICH9_USB_EHCI1,
|
||||
QEMU_CAPS_USB_HUB,
|
||||
QEMU_CAPS_NO_SHUTDOWN,
|
||||
QEMU_CAPS_PCI_ROMBAR,
|
||||
QEMU_CAPS_NO_ACPI,
|
||||
QEMU_CAPS_VIRTIO_BLK_SCSI,
|
||||
QEMU_CAPS_VIRTIO_BLK_SG_IO,
|
||||
@ -470,7 +464,6 @@ mymain(void)
|
||||
QEMU_CAPS_PCI_OHCI,
|
||||
QEMU_CAPS_USB_HUB,
|
||||
QEMU_CAPS_NO_SHUTDOWN,
|
||||
QEMU_CAPS_PCI_ROMBAR,
|
||||
QEMU_CAPS_ICH9_AHCI,
|
||||
QEMU_CAPS_NO_ACPI,
|
||||
QEMU_CAPS_FSDEV_READONLY,
|
||||
@ -548,7 +541,6 @@ mymain(void)
|
||||
QEMU_CAPS_PCI_OHCI,
|
||||
QEMU_CAPS_USB_HUB,
|
||||
QEMU_CAPS_NO_SHUTDOWN,
|
||||
QEMU_CAPS_PCI_ROMBAR,
|
||||
QEMU_CAPS_ICH9_AHCI,
|
||||
QEMU_CAPS_NO_ACPI,
|
||||
QEMU_CAPS_FSDEV_READONLY,
|
||||
|
@ -1233,8 +1233,7 @@ mymain(void)
|
||||
QEMU_CAPS_PCIDEVICE,
|
||||
QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DEVICE_VFIO_PCI);
|
||||
DO_TEST("pci-rom",
|
||||
QEMU_CAPS_PCIDEVICE, QEMU_CAPS_NODEFCONFIG,
|
||||
QEMU_CAPS_PCI_ROMBAR);
|
||||
QEMU_CAPS_PCIDEVICE, QEMU_CAPS_NODEFCONFIG);
|
||||
|
||||
DO_TEST_FULL("restore-v2", "exec:cat", 7, 0, 0, NONE);
|
||||
DO_TEST_FULL("restore-v2-fd", "stdio", 7, 0, 0, NONE);
|
||||
|
Loading…
Reference in New Issue
Block a user