qemu: caps: Add capability for 'write-cache' parameter of disk frontends

QEMU translates the cache mode of a disk internally into 3 flags.
'write-cache' is a flag of the frontend while others are flag of the
backing storage. Add capability which will allow expressing it via the
frontend attribute.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Peter Krempa 2018-04-03 19:11:22 +02:00
parent cf44d63a83
commit 955df88de6
18 changed files with 22 additions and 0 deletions

View File

@ -472,6 +472,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
/* 290 */
"query-cpus-fast",
"disk-write-cache",
);
@ -1118,6 +1119,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBlk[] = {
{ "disable-legacy", QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY },
{ "iommu_platform", QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM },
{ "ats", QEMU_CAPS_VIRTIO_PCI_ATS },
{ "write-cache", QEMU_CAPS_DISK_WRITE_CACHE },
};
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioNet[] = {
@ -1155,11 +1157,13 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsSCSIDisk[] = {
{ "channel", QEMU_CAPS_SCSI_DISK_CHANNEL },
{ "wwn", QEMU_CAPS_SCSI_DISK_WWN },
{ "share-rw", QEMU_CAPS_DISK_SHARE_RW },
{ "write-cache", QEMU_CAPS_DISK_WRITE_CACHE },
};
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsIDEDrive[] = {
{ "wwn", QEMU_CAPS_IDE_DRIVE_WWN },
{ "share-rw", QEMU_CAPS_DISK_SHARE_RW },
{ "write-cache", QEMU_CAPS_DISK_WRITE_CACHE },
};
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsPiix4PM[] = {
@ -1191,6 +1195,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQ35PCIHost[] = {
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUSBStorage[] = {
{ "removable", QEMU_CAPS_USB_STORAGE_REMOVABLE },
{ "share-rw", QEMU_CAPS_DISK_SHARE_RW },
{ "write-cache", QEMU_CAPS_DISK_WRITE_CACHE },
};
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsKVMPit[] = {

View File

@ -456,6 +456,7 @@ typedef enum {
/* 290 */
QEMU_CAPS_QUERY_CPUS_FAST, /* query-cpus-fast command */
QEMU_CAPS_DISK_WRITE_CACHE, /* qemu block frontends support write-cache param */
QEMU_CAPS_LAST /* this must always be the last item */
} virQEMUCapsFlags;

View File

@ -152,6 +152,7 @@
<flag name='pl011'/>
<flag name='dump-completed'/>
<flag name='qcow2-luks'/>
<flag name='disk-write-cache'/>
<version>2010000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>303541</microcodeVersion>

View File

@ -151,6 +151,7 @@
<flag name='machine.pseries.max-cpu-compat'/>
<flag name='dump-completed'/>
<flag name='qcow2-luks'/>
<flag name='disk-write-cache'/>
<version>2010000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>382824</microcodeVersion>

View File

@ -112,6 +112,7 @@
<flag name='iscsi.password-secret'/>
<flag name='dump-completed'/>
<flag name='qcow2-luks'/>
<flag name='disk-write-cache'/>
<version>2010000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>303326</microcodeVersion>

View File

@ -195,6 +195,7 @@
<flag name='isa-serial'/>
<flag name='dump-completed'/>
<flag name='qcow2-luks'/>
<flag name='disk-write-cache'/>
<version>2010000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>344938</microcodeVersion>

View File

@ -117,6 +117,7 @@
<flag name='virtio-tablet-ccw'/>
<flag name='qcow2-luks'/>
<flag name='seccomp-blacklist'/>
<flag name='disk-write-cache'/>
<version>2011000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>342058</microcodeVersion>

View File

@ -156,6 +156,7 @@
<flag name='pcie-pci-bridge'/>
<flag name='seccomp-blacklist'/>
<flag name='query-cpus-fast'/>
<flag name='disk-write-cache'/>
<version>2011090</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>342346</microcodeVersion>

View File

@ -153,6 +153,7 @@
<flag name='qcow2-luks'/>
<flag name='seccomp-blacklist'/>
<flag name='query-cpus-fast'/>
<flag name='disk-write-cache'/>
<version>2011090</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>419215</microcodeVersion>

View File

@ -118,6 +118,7 @@
<flag name='qcow2-luks'/>
<flag name='seccomp-blacklist'/>
<flag name='query-cpus-fast'/>
<flag name='disk-write-cache'/>
<version>2011090</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>0</microcodeVersion>

View File

@ -194,6 +194,7 @@
<flag name='pcie-pci-bridge'/>
<flag name='seccomp-blacklist'/>
<flag name='query-cpus-fast'/>
<flag name='disk-write-cache'/>
<version>2011090</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>390060</microcodeVersion>

View File

@ -102,6 +102,7 @@
<flag name='virtio-blk.num-queues'/>
<flag name='sclplmconsole'/>
<flag name='dump-completed'/>
<flag name='disk-write-cache'/>
<version>2007000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>216732</microcodeVersion>

View File

@ -175,6 +175,7 @@
<flag name='virtio-blk.num-queues'/>
<flag name='isa-serial'/>
<flag name='dump-completed'/>
<flag name='disk-write-cache'/>
<version>2007000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>239029</microcodeVersion>

View File

@ -104,6 +104,7 @@
<flag name='virtio-blk.num-queues'/>
<flag name='sclplmconsole'/>
<flag name='dump-completed'/>
<flag name='disk-write-cache'/>
<version>2007093</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>241633</microcodeVersion>

View File

@ -177,6 +177,7 @@
<flag name='virtio-blk.num-queues'/>
<flag name='isa-serial'/>
<flag name='dump-completed'/>
<flag name='disk-write-cache'/>
<version>2008000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>255684</microcodeVersion>

View File

@ -143,6 +143,7 @@
<flag name='iscsi.password-secret'/>
<flag name='isa-serial'/>
<flag name='dump-completed'/>
<flag name='disk-write-cache'/>
<version>2009000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>346538</microcodeVersion>

View File

@ -107,6 +107,7 @@
<flag name='disk-share-rw'/>
<flag name='iscsi.password-secret'/>
<flag name='dump-completed'/>
<flag name='disk-write-cache'/>
<version>2009000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>265051</microcodeVersion>

View File

@ -190,6 +190,7 @@
<flag name='iscsi.password-secret'/>
<flag name='isa-serial'/>
<flag name='dump-completed'/>
<flag name='disk-write-cache'/>
<version>2009000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>320947</microcodeVersion>