qemu: Check for drop-cache capability

QEMU 4.0.0 and newer automatically drops caches at the end of migration.
Let's check for this capability so that we can allow migration when disk
cache is turned on.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Acked-By: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Jiri Denemark 2019-08-13 15:17:36 +02:00
parent 4748f8df29
commit 598ec0db68
9 changed files with 10 additions and 0 deletions

View File

@ -536,6 +536,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
/* 335 */
"bochs-display",
"migration-file-drop-cache",
);
@ -1279,6 +1280,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] = {
{ "query-iothreads/ret-type/poll-max-ns", QEMU_CAPS_IOTHREAD_POLLING },
{ "query-display-options/ret-type/+egl-headless/rendernode", QEMU_CAPS_EGL_HEADLESS_RENDERNODE },
{ "nbd-server-add/arg-type/bitmap", QEMU_CAPS_NBD_BITMAP },
{ "blockdev-add/arg-type/+file/drop-cache", QEMU_CAPS_MIGRATION_FILE_DROP_CACHE },
};
typedef struct _virQEMUCapsObjectTypeProps virQEMUCapsObjectTypeProps;

View File

@ -517,6 +517,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
/* 335 */
QEMU_CAPS_DEVICE_BOCHS_DISPLAY, /* -device bochs-display */
QEMU_CAPS_MIGRATION_FILE_DROP_CACHE, /* migration with disk cache on is safe for type='file' disks */
QEMU_CAPS_LAST /* this must always be the last item */
} virQEMUCapsFlags;

View File

@ -164,6 +164,7 @@
<flag name='bitmap-merge'/>
<flag name='nbd-bitmap'/>
<flag name='bochs-display'/>
<flag name='migration-file-drop-cache'/>
<version>4000000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>61700758</microcodeVersion>

View File

@ -169,6 +169,7 @@
<flag name='bitmap-merge'/>
<flag name='nbd-bitmap'/>
<flag name='bochs-display'/>
<flag name='migration-file-drop-cache'/>
<version>4000000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>42900758</microcodeVersion>

View File

@ -167,6 +167,7 @@
<flag name='bitmap-merge'/>
<flag name='nbd-bitmap'/>
<flag name='bochs-display'/>
<flag name='migration-file-drop-cache'/>
<version>4000000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>0</microcodeVersion>

View File

@ -167,6 +167,7 @@
<flag name='bitmap-merge'/>
<flag name='nbd-bitmap'/>
<flag name='bochs-display'/>
<flag name='migration-file-drop-cache'/>
<version>4000000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>0</microcodeVersion>

View File

@ -131,6 +131,7 @@
<flag name='query-current-machine'/>
<flag name='bitmap-merge'/>
<flag name='nbd-bitmap'/>
<flag name='migration-file-drop-cache'/>
<version>4000000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>39100758</microcodeVersion>

View File

@ -206,6 +206,7 @@
<flag name='nbd-bitmap'/>
<flag name='x86-max-cpu'/>
<flag name='bochs-display'/>
<flag name='migration-file-drop-cache'/>
<version>4000000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>43100758</microcodeVersion>

View File

@ -208,6 +208,7 @@
<flag name='cpu-unavailable-features'/>
<flag name='canonical-cpu-features'/>
<flag name='bochs-display'/>
<flag name='migration-file-drop-cache'/>
<version>4000050</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>43100759</microcodeVersion>