]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Check for drop-cache capability
authorJiri Denemark <jdenemar@redhat.com>
Tue, 13 Aug 2019 13:17:36 +0000 (15:17 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 14 Aug 2019 07:36:43 +0000 (09:36 +0200)
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>
src/qemu/qemu_capabilities.c
src/qemu/qemu_capabilities.h
tests/qemucapabilitiesdata/caps_4.0.0.aarch64.xml
tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml
tests/qemucapabilitiesdata/caps_4.0.0.riscv32.xml
tests/qemucapabilitiesdata/caps_4.0.0.riscv64.xml
tests/qemucapabilitiesdata/caps_4.0.0.s390x.xml
tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml
tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml

index 405bc3f288431fe30b15bbb1014efe38b2445539..c9677315ab7afae8467de2b74a2a7db961b97159 100644 (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;
index d7c6df20c7e4500956afc7be4546e698a1cdc8f7..68ef6c49b40b744dfa0cbc84574cd67676bd99b6 100644 (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;
index 8fe369f518a1cf48c60e338fd3c8a313c763c83d..20f119665b9e1bc5f3c622cf502f896a6ac0eb25 100644 (file)
   <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>
index 2df230c4f719ee3a8fb257f1e5560df3b92525dc..9ea6f4d0464915305dcae0f71ccec7be3984cbae 100644 (file)
   <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>
index f4acda457a7748492f096e89cf2eae65150ef86d..7503c2dbcdc5d2f8c72a5dce30974d31f4f17edd 100644 (file)
   <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>
index e71d83ee06e8c3096f032c51726e4863e4f8c292..4a94179ee7ace2ecdb56506071aff62e5ca85e10 100644 (file)
   <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>
index a1ac2587a038db0f56b5315b9e0d7e36b46eda48..ef802f3d1f4219723b9a101f6869cd7351a28f2a 100644 (file)
   <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>
index 1d44a5a1ba9f9d58006541a7066c63402e2d225c..87c95f4d189380d5ca45335a9bb1c456b7b2f141 100644 (file)
   <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>
index f336aeb48c0917cadb6f229e0eb1cee5be7f9424..f4583d7fe7d28387b154788037435dc733112206 100644 (file)
   <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>