提交 47e84b06 编写于 作者: J Ján Tomko

qemu: add QEMU_CAPS_STORAGE_WERROR

Detect the werror property on SCSI and virtio disks.
But clear it if the QEMU supports usb-storage device without it
also supporting this option for usb-storage.
Signed-off-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
上级 248d2051
...@@ -567,6 +567,7 @@ VIR_ENUM_IMPL(virQEMUCaps, ...@@ -567,6 +567,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
"query-named-block-nodes.flat", "query-named-block-nodes.flat",
"blockdev-snapshot.allow-write-only-overlay", "blockdev-snapshot.allow-write-only-overlay",
"blockdev-reopen", "blockdev-reopen",
"storage.werror",
); );
...@@ -1304,6 +1305,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBlk[] = { ...@@ -1304,6 +1305,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBlk[] = {
{ "iommu_platform", QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM }, { "iommu_platform", QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM },
{ "ats", QEMU_CAPS_VIRTIO_PCI_ATS }, { "ats", QEMU_CAPS_VIRTIO_PCI_ATS },
{ "write-cache", QEMU_CAPS_DISK_WRITE_CACHE }, { "write-cache", QEMU_CAPS_DISK_WRITE_CACHE },
{ "werror", QEMU_CAPS_STORAGE_WERROR },
}; };
static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioNet[] = { static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioNet[] = {
...@@ -1339,6 +1341,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsSCSIDisk[] = { ...@@ -1339,6 +1341,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsSCSIDisk[] = {
{ "share-rw", QEMU_CAPS_DISK_SHARE_RW }, { "share-rw", QEMU_CAPS_DISK_SHARE_RW },
{ "write-cache", QEMU_CAPS_DISK_WRITE_CACHE }, { "write-cache", QEMU_CAPS_DISK_WRITE_CACHE },
{ "device_id", QEMU_CAPS_SCSI_DISK_DEVICE_ID }, { "device_id", QEMU_CAPS_SCSI_DISK_DEVICE_ID },
{ "werror", QEMU_CAPS_STORAGE_WERROR },
}; };
static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsIDEDrive[] = { static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsIDEDrive[] = {
...@@ -4853,6 +4856,11 @@ virQEMUCapsInitProcessCapsInterlock(virQEMUCapsPtr qemuCaps) ...@@ -4853,6 +4856,11 @@ virQEMUCapsInitProcessCapsInterlock(virQEMUCapsPtr qemuCaps)
{ {
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV))
virQEMUCapsClear(qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP); virQEMUCapsClear(qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP);
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_USB_STORAGE) &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_USB_STORAGE_WERROR)) {
virQEMUCapsClear(qemuCaps, QEMU_CAPS_STORAGE_WERROR);
}
} }
......
...@@ -548,6 +548,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ ...@@ -548,6 +548,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
QEMU_CAPS_QMP_QUERY_NAMED_BLOCK_NODES_FLAT, /* query-named-block-nodes supports the 'flat' option */ QEMU_CAPS_QMP_QUERY_NAMED_BLOCK_NODES_FLAT, /* query-named-block-nodes supports the 'flat' option */
QEMU_CAPS_BLOCKDEV_SNAPSHOT_ALLOW_WRITE_ONLY, /* blockdev-snapshot has the 'allow-write-only-overlay' feature */ QEMU_CAPS_BLOCKDEV_SNAPSHOT_ALLOW_WRITE_ONLY, /* blockdev-snapshot has the 'allow-write-only-overlay' feature */
QEMU_CAPS_BLOCKDEV_REOPEN, /* 'blockdev-reopen' qmp command is supported */ QEMU_CAPS_BLOCKDEV_REOPEN, /* 'blockdev-reopen' qmp command is supported */
QEMU_CAPS_STORAGE_WERROR, /* virtio-blk,scsi-hd.werror */
QEMU_CAPS_LAST /* this must always be the last item */ QEMU_CAPS_LAST /* this must always be the last item */
} virQEMUCapsFlags; } virQEMUCapsFlags;
......
...@@ -106,6 +106,7 @@ ...@@ -106,6 +106,7 @@
<flag name='iothread.poll-max-ns'/> <flag name='iothread.poll-max-ns'/>
<flag name='query-cpu-model-baseline'/> <flag name='query-cpu-model-baseline'/>
<flag name='query-cpu-model-comparison'/> <flag name='query-cpu-model-comparison'/>
<flag name='storage.werror'/>
<version>2010000</version> <version>2010000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>39100287</microcodeVersion> <microcodeVersion>39100287</microcodeVersion>
......
...@@ -113,6 +113,7 @@ ...@@ -113,6 +113,7 @@
<flag name='iothread.poll-max-ns'/> <flag name='iothread.poll-max-ns'/>
<flag name='query-cpu-model-baseline'/> <flag name='query-cpu-model-baseline'/>
<flag name='query-cpu-model-comparison'/> <flag name='query-cpu-model-comparison'/>
<flag name='storage.werror'/>
<version>2011000</version> <version>2011000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>39100288</microcodeVersion> <microcodeVersion>39100288</microcodeVersion>
......
...@@ -125,6 +125,7 @@ ...@@ -125,6 +125,7 @@
<flag name='query-cpu-model-baseline'/> <flag name='query-cpu-model-baseline'/>
<flag name='query-cpu-model-comparison'/> <flag name='query-cpu-model-comparison'/>
<flag name='drive-nvme'/> <flag name='drive-nvme'/>
<flag name='storage.werror'/>
<version>2012000</version> <version>2012000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>39100289</microcodeVersion> <microcodeVersion>39100289</microcodeVersion>
......
...@@ -90,6 +90,7 @@ ...@@ -90,6 +90,7 @@
<flag name='virtual-css-bridge'/> <flag name='virtual-css-bridge'/>
<flag name='sdl-gl'/> <flag name='sdl-gl'/>
<flag name='zpci'/> <flag name='zpci'/>
<flag name='storage.werror'/>
<version>2007000</version> <version>2007000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>39100245</microcodeVersion> <microcodeVersion>39100245</microcodeVersion>
......
...@@ -95,6 +95,7 @@ ...@@ -95,6 +95,7 @@
<flag name='zpci'/> <flag name='zpci'/>
<flag name='query-cpu-model-baseline'/> <flag name='query-cpu-model-baseline'/>
<flag name='query-cpu-model-comparison'/> <flag name='query-cpu-model-comparison'/>
<flag name='storage.werror'/>
<version>2007093</version> <version>2007093</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>39100246</microcodeVersion> <microcodeVersion>39100246</microcodeVersion>
......
...@@ -100,6 +100,7 @@ ...@@ -100,6 +100,7 @@
<flag name='iothread.poll-max-ns'/> <flag name='iothread.poll-max-ns'/>
<flag name='query-cpu-model-baseline'/> <flag name='query-cpu-model-baseline'/>
<flag name='query-cpu-model-comparison'/> <flag name='query-cpu-model-comparison'/>
<flag name='storage.werror'/>
<version>2009000</version> <version>2009000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>39100247</microcodeVersion> <microcodeVersion>39100247</microcodeVersion>
......
...@@ -95,6 +95,7 @@ ...@@ -95,6 +95,7 @@
<flag name='memory-backend-file.align'/> <flag name='memory-backend-file.align'/>
<flag name='ramfb'/> <flag name='ramfb'/>
<flag name='drive-nvme'/> <flag name='drive-nvme'/>
<flag name='storage.werror'/>
<version>3000000</version> <version>3000000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>0</microcodeVersion> <microcodeVersion>0</microcodeVersion>
......
...@@ -95,6 +95,7 @@ ...@@ -95,6 +95,7 @@
<flag name='memory-backend-file.align'/> <flag name='memory-backend-file.align'/>
<flag name='ramfb'/> <flag name='ramfb'/>
<flag name='drive-nvme'/> <flag name='drive-nvme'/>
<flag name='storage.werror'/>
<version>3000000</version> <version>3000000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>0</microcodeVersion> <microcodeVersion>0</microcodeVersion>
......
...@@ -128,6 +128,7 @@ ...@@ -128,6 +128,7 @@
<flag name='query-cpu-model-comparison'/> <flag name='query-cpu-model-comparison'/>
<flag name='ramfb'/> <flag name='ramfb'/>
<flag name='drive-nvme'/> <flag name='drive-nvme'/>
<flag name='storage.werror'/>
<version>3000000</version> <version>3000000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>39100239</microcodeVersion> <microcodeVersion>39100239</microcodeVersion>
......
...@@ -203,6 +203,7 @@ ...@@ -203,6 +203,7 @@
<flag name='ramfb'/> <flag name='ramfb'/>
<flag name='drive-nvme'/> <flag name='drive-nvme'/>
<flag name='i8042'/> <flag name='i8042'/>
<flag name='storage.werror'/>
<version>3000000</version> <version>3000000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>43100239</microcodeVersion> <microcodeVersion>43100239</microcodeVersion>
......
...@@ -160,6 +160,7 @@ ...@@ -160,6 +160,7 @@
<flag name='bochs-display'/> <flag name='bochs-display'/>
<flag name='drive-nvme'/> <flag name='drive-nvme'/>
<flag name='i8042'/> <flag name='i8042'/>
<flag name='storage.werror'/>
<version>3000091</version> <version>3000091</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>42900240</microcodeVersion> <microcodeVersion>42900240</microcodeVersion>
......
...@@ -206,6 +206,7 @@ ...@@ -206,6 +206,7 @@
<flag name='ramfb'/> <flag name='ramfb'/>
<flag name='drive-nvme'/> <flag name='drive-nvme'/>
<flag name='i8042'/> <flag name='i8042'/>
<flag name='storage.werror'/>
<version>3000092</version> <version>3000092</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>43100240</microcodeVersion> <microcodeVersion>43100240</microcodeVersion>
......
...@@ -169,6 +169,7 @@ ...@@ -169,6 +169,7 @@
<flag name='ramfb'/> <flag name='ramfb'/>
<flag name='arm-max-cpu'/> <flag name='arm-max-cpu'/>
<flag name='drive-nvme'/> <flag name='drive-nvme'/>
<flag name='storage.werror'/>
<version>4000000</version> <version>4000000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>61700240</microcodeVersion> <microcodeVersion>61700240</microcodeVersion>
......
...@@ -174,6 +174,7 @@ ...@@ -174,6 +174,7 @@
<flag name='machine.pseries.cap-ccf-assist'/> <flag name='machine.pseries.cap-ccf-assist'/>
<flag name='drive-nvme'/> <flag name='drive-nvme'/>
<flag name='i8042'/> <flag name='i8042'/>
<flag name='storage.werror'/>
<version>4000000</version> <version>4000000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>42900240</microcodeVersion> <microcodeVersion>42900240</microcodeVersion>
......
...@@ -170,6 +170,7 @@ ...@@ -170,6 +170,7 @@
<flag name='bochs-display'/> <flag name='bochs-display'/>
<flag name='migration-file-drop-cache'/> <flag name='migration-file-drop-cache'/>
<flag name='drive-nvme'/> <flag name='drive-nvme'/>
<flag name='storage.werror'/>
<version>4000000</version> <version>4000000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>0</microcodeVersion> <microcodeVersion>0</microcodeVersion>
......
...@@ -170,6 +170,7 @@ ...@@ -170,6 +170,7 @@
<flag name='bochs-display'/> <flag name='bochs-display'/>
<flag name='migration-file-drop-cache'/> <flag name='migration-file-drop-cache'/>
<flag name='drive-nvme'/> <flag name='drive-nvme'/>
<flag name='storage.werror'/>
<version>4000000</version> <version>4000000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>0</microcodeVersion> <microcodeVersion>0</microcodeVersion>
......
...@@ -136,6 +136,7 @@ ...@@ -136,6 +136,7 @@
<flag name='query-cpu-model-baseline'/> <flag name='query-cpu-model-baseline'/>
<flag name='query-cpu-model-comparison'/> <flag name='query-cpu-model-comparison'/>
<flag name='drive-nvme'/> <flag name='drive-nvme'/>
<flag name='storage.werror'/>
<version>4000000</version> <version>4000000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>39100240</microcodeVersion> <microcodeVersion>39100240</microcodeVersion>
......
...@@ -211,6 +211,7 @@ ...@@ -211,6 +211,7 @@
<flag name='ramfb'/> <flag name='ramfb'/>
<flag name='drive-nvme'/> <flag name='drive-nvme'/>
<flag name='i8042'/> <flag name='i8042'/>
<flag name='storage.werror'/>
<version>4000000</version> <version>4000000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>43100240</microcodeVersion> <microcodeVersion>43100240</microcodeVersion>
......
...@@ -217,6 +217,7 @@ ...@@ -217,6 +217,7 @@
<flag name='drive-nvme'/> <flag name='drive-nvme'/>
<flag name='smp-dies'/> <flag name='smp-dies'/>
<flag name='i8042'/> <flag name='i8042'/>
<flag name='storage.werror'/>
<version>4001000</version> <version>4001000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>43100241</microcodeVersion> <microcodeVersion>43100241</microcodeVersion>
......
...@@ -179,6 +179,7 @@ ...@@ -179,6 +179,7 @@
<flag name='rng-builtin'/> <flag name='rng-builtin'/>
<flag name='virtio-net.failover'/> <flag name='virtio-net.failover'/>
<flag name='vhost-user-fs'/> <flag name='vhost-user-fs'/>
<flag name='storage.werror'/>
<version>4001050</version> <version>4001050</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>61700242</microcodeVersion> <microcodeVersion>61700242</microcodeVersion>
......
...@@ -179,6 +179,7 @@ ...@@ -179,6 +179,7 @@
<flag name='smp-dies'/> <flag name='smp-dies'/>
<flag name='i8042'/> <flag name='i8042'/>
<flag name='rng-builtin'/> <flag name='rng-builtin'/>
<flag name='storage.werror'/>
<version>4001050</version> <version>4001050</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>42900242</microcodeVersion> <microcodeVersion>42900242</microcodeVersion>
......
...@@ -138,6 +138,7 @@ ...@@ -138,6 +138,7 @@
<flag name='smp-dies'/> <flag name='smp-dies'/>
<flag name='rng-builtin'/> <flag name='rng-builtin'/>
<flag name='vhost-user-fs'/> <flag name='vhost-user-fs'/>
<flag name='storage.werror'/>
<version>4001050</version> <version>4001050</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>39100242</microcodeVersion> <microcodeVersion>39100242</microcodeVersion>
......
...@@ -223,6 +223,7 @@ ...@@ -223,6 +223,7 @@
<flag name='rng-builtin'/> <flag name='rng-builtin'/>
<flag name='virtio-net.failover'/> <flag name='virtio-net.failover'/>
<flag name='vhost-user-fs'/> <flag name='vhost-user-fs'/>
<flag name='storage.werror'/>
<version>4002000</version> <version>4002000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>43100242</microcodeVersion> <microcodeVersion>43100242</microcodeVersion>
......
...@@ -181,6 +181,7 @@ ...@@ -181,6 +181,7 @@
<flag name='virtio-net.failover'/> <flag name='virtio-net.failover'/>
<flag name='cpu.kvm-no-adjvtime'/> <flag name='cpu.kvm-no-adjvtime'/>
<flag name='vhost-user-fs'/> <flag name='vhost-user-fs'/>
<flag name='storage.werror'/>
<version>4002050</version> <version>4002050</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>61700241</microcodeVersion> <microcodeVersion>61700241</microcodeVersion>
......
...@@ -189,6 +189,7 @@ ...@@ -189,6 +189,7 @@
<flag name='vhost-user-fs'/> <flag name='vhost-user-fs'/>
<flag name='query-named-block-nodes.flat'/> <flag name='query-named-block-nodes.flat'/>
<flag name='blockdev-snapshot.allow-write-only-overlay'/> <flag name='blockdev-snapshot.allow-write-only-overlay'/>
<flag name='storage.werror'/>
<version>4002050</version> <version>4002050</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>42900241</microcodeVersion> <microcodeVersion>42900241</microcodeVersion>
......
...@@ -226,6 +226,7 @@ ...@@ -226,6 +226,7 @@
<flag name='vhost-user-fs'/> <flag name='vhost-user-fs'/>
<flag name='query-named-block-nodes.flat'/> <flag name='query-named-block-nodes.flat'/>
<flag name='blockdev-snapshot.allow-write-only-overlay'/> <flag name='blockdev-snapshot.allow-write-only-overlay'/>
<flag name='storage.werror'/>
<version>4002050</version> <version>4002050</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>43100241</microcodeVersion> <microcodeVersion>43100241</microcodeVersion>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册