1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

qemu: domcaps: Report disk <enum name="model">

This generates new XML like:

    <disk>
      <enum name='model'>
        <value>virtio</value>
        <value>virtio-transitional</value>
        <value>virtio-non-transitional</value>
      </enum>
    </disk>

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2019-02-20 14:18:40 -05:00
parent 8270b3d0cd
commit aa42d364a5
28 changed files with 112 additions and 0 deletions

View File

@ -482,6 +482,7 @@ virDomainCapsDeviceDiskFormat(virBufferPtr buf,
ENUM_PROCESS(disk, diskDevice, virDomainDiskDeviceTypeToString);
ENUM_PROCESS(disk, bus, virDomainDiskBusTypeToString);
ENUM_PROCESS(disk, model, virDomainDiskModelTypeToString);
FORMAT_EPILOGUE(disk);
}

View File

@ -65,6 +65,7 @@ struct _virDomainCapsDeviceDisk {
bool supported;
virDomainCapsEnum diskDevice; /* Info about virDomainDiskDevice enum values */
virDomainCapsEnum bus; /* Info about virDomainDiskBus enum values */
virDomainCapsEnum model; /* Info about virDomainDiskModel enum values */
/* add new fields here */
};

View File

@ -5024,6 +5024,16 @@ virQEMUCapsFillDomainDeviceDiskCaps(virQEMUCapsPtr qemuCaps,
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_ICH9_AHCI))
VIR_DOMAIN_CAPS_ENUM_SET(disk->bus, VIR_DOMAIN_DISK_BUS_SATA);
/* disk->model values */
VIR_DOMAIN_CAPS_ENUM_SET(disk->model, VIR_DOMAIN_DISK_MODEL_VIRTIO);
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY) ||
virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL)) {
VIR_DOMAIN_CAPS_ENUM_SET(disk->model,
VIR_DOMAIN_DISK_MODEL_VIRTIO_TRANSITIONAL);
VIR_DOMAIN_CAPS_ENUM_SET(disk->model,
VIR_DOMAIN_DISK_MODEL_VIRTIO_NON_TRANSITIONAL);
}
return 0;
}

View File

@ -21,6 +21,7 @@
<value>virtio</value>
<value>sata</value>
</enum>
<enum name='model'/>
</disk>
<graphics supported='no'/>
<video supported='no'/>

View File

@ -30,6 +30,7 @@
<value>virtio</value>
<value>sata</value>
</enum>
<enum name='model'/>
</disk>
<graphics supported='yes'>
<enum name='type'>

View File

@ -30,6 +30,7 @@
<value>virtio</value>
<value>sata</value>
</enum>
<enum name='model'/>
</disk>
<graphics supported='no'/>
<video supported='no'/>

View File

@ -51,6 +51,12 @@
<value>sata</value>
<value>sd</value>
</enum>
<enum name='model'>
<value>default</value>
<value>virtio</value>
<value>virtio-transitional</value>
<value>virtio-non-transitional</value>
</enum>
</disk>
<graphics supported='yes'>
<enum name='type'>

View File

@ -34,6 +34,7 @@
<value>scsi</value>
<value>xen</value>
</enum>
<enum name='model'/>
</disk>
<graphics supported='yes'>
<enum name='type'>

View File

@ -24,6 +24,7 @@
<value>scsi</value>
<value>xen</value>
</enum>
<enum name='model'/>
</disk>
<graphics supported='yes'>
<enum name='type'>

View File

@ -68,6 +68,9 @@
<value>usb</value>
<value>sata</value>
</enum>
<enum name='model'>
<value>virtio</value>
</enum>
</disk>
<graphics supported='yes'>
<enum name='type'>

View File

@ -74,6 +74,11 @@
<value>usb</value>
<value>sata</value>
</enum>
<enum name='model'>
<value>virtio</value>
<value>virtio-transitional</value>
<value>virtio-non-transitional</value>
</enum>
</disk>
<graphics supported='yes'>
<enum name='type'>

View File

@ -40,6 +40,11 @@
<value>usb</value>
<value>sata</value>
</enum>
<enum name='model'>
<value>virtio</value>
<value>virtio-transitional</value>
<value>virtio-non-transitional</value>
</enum>
</disk>
<graphics supported='yes'>
<enum name='type'>

View File

@ -133,6 +133,11 @@
<value>scsi</value>
<value>virtio</value>
</enum>
<enum name='model'>
<value>virtio</value>
<value>virtio-transitional</value>
<value>virtio-non-transitional</value>
</enum>
</disk>
<graphics supported='yes'>
<enum name='type'>

View File

@ -98,6 +98,11 @@
<value>usb</value>
<value>sata</value>
</enum>
<enum name='model'>
<value>virtio</value>
<value>virtio-transitional</value>
<value>virtio-non-transitional</value>
</enum>
</disk>
<graphics supported='yes'>
<enum name='type'>

View File

@ -71,6 +71,11 @@
<value>usb</value>
<value>sata</value>
</enum>
<enum name='model'>
<value>virtio</value>
<value>virtio-transitional</value>
<value>virtio-non-transitional</value>
</enum>
</disk>
<graphics supported='yes'>
<enum name='type'>

View File

@ -71,6 +71,11 @@
<value>usb</value>
<value>sata</value>
</enum>
<enum name='model'>
<value>virtio</value>
<value>virtio-transitional</value>
<value>virtio-non-transitional</value>
</enum>
</disk>
<graphics supported='yes'>
<enum name='type'>

View File

@ -44,6 +44,11 @@
<value>usb</value>
<value>sata</value>
</enum>
<enum name='model'>
<value>virtio</value>
<value>virtio-transitional</value>
<value>virtio-non-transitional</value>
</enum>
</disk>
<graphics supported='yes'>
<enum name='type'>

View File

@ -72,6 +72,11 @@
<value>usb</value>
<value>sata</value>
</enum>
<enum name='model'>
<value>virtio</value>
<value>virtio-transitional</value>
<value>virtio-non-transitional</value>
</enum>
</disk>
<graphics supported='yes'>
<enum name='type'>

View File

@ -38,6 +38,11 @@
<value>scsi</value>
<value>virtio</value>
</enum>
<enum name='model'>
<value>virtio</value>
<value>virtio-transitional</value>
<value>virtio-non-transitional</value>
</enum>
</disk>
<graphics supported='yes'>
<enum name='type'>

View File

@ -73,6 +73,11 @@
<value>usb</value>
<value>sata</value>
</enum>
<enum name='model'>
<value>virtio</value>
<value>virtio-transitional</value>
<value>virtio-non-transitional</value>
</enum>
</disk>
<graphics supported='yes'>
<enum name='type'>

View File

@ -119,6 +119,11 @@
<value>scsi</value>
<value>virtio</value>
</enum>
<enum name='model'>
<value>virtio</value>
<value>virtio-transitional</value>
<value>virtio-non-transitional</value>
</enum>
</disk>
<graphics supported='yes'>
<enum name='type'>

View File

@ -73,6 +73,11 @@
<value>usb</value>
<value>sata</value>
</enum>
<enum name='model'>
<value>virtio</value>
<value>virtio-transitional</value>
<value>virtio-non-transitional</value>
</enum>
</disk>
<graphics supported='yes'>
<enum name='type'>

View File

@ -81,6 +81,11 @@
<value>usb</value>
<value>sata</value>
</enum>
<enum name='model'>
<value>virtio</value>
<value>virtio-transitional</value>
<value>virtio-non-transitional</value>
</enum>
</disk>
<graphics supported='yes'>
<enum name='type'>

View File

@ -105,6 +105,11 @@
<value>usb</value>
<value>sata</value>
</enum>
<enum name='model'>
<value>virtio</value>
<value>virtio-transitional</value>
<value>virtio-non-transitional</value>
</enum>
</disk>
<graphics supported='yes'>
<enum name='type'>

View File

@ -82,6 +82,11 @@
<value>usb</value>
<value>sata</value>
</enum>
<enum name='model'>
<value>virtio</value>
<value>virtio-transitional</value>
<value>virtio-non-transitional</value>
</enum>
</disk>
<graphics supported='yes'>
<enum name='type'>

View File

@ -139,6 +139,11 @@
<value>scsi</value>
<value>virtio</value>
</enum>
<enum name='model'>
<value>virtio</value>
<value>virtio-transitional</value>
<value>virtio-non-transitional</value>
</enum>
</disk>
<graphics supported='yes'>
<enum name='type'>

View File

@ -99,6 +99,11 @@
<value>usb</value>
<value>sata</value>
</enum>
<enum name='model'>
<value>virtio</value>
<value>virtio-transitional</value>
<value>virtio-non-transitional</value>
</enum>
</disk>
<graphics supported='yes'>
<enum name='type'>

View File

@ -94,6 +94,7 @@ fillAllCaps(virDomainCapsPtr domCaps)
disk->supported = true;
SET_ALL_BITS(disk->diskDevice);
SET_ALL_BITS(disk->bus);
SET_ALL_BITS(disk->model);
graphics->supported = true;
SET_ALL_BITS(graphics->type);