diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index d88c0833ad..cca9d06786 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -3137,7 +3137,9 @@ doCoreDump(virQEMUDriver *driver, goto cleanup; if (qemuMigrationSrcToFile(driver, vm, path, &fd, compressor, - dump_params, dump_flags, VIR_ASYNC_JOB_DUMP) < 0) + dump_params, + (dump_flags & VIR_DUMP_BYPASS_CACHE), + VIR_ASYNC_JOB_DUMP) < 0) goto cleanup; } diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 4f9b649b63..1371742529 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -7210,7 +7210,7 @@ qemuMigrationSrcToSparseFile(virQEMUDriver *driver, virDomainObj *vm, const char *path, int *fd, - unsigned int flags, + bool bypassCache, virDomainAsyncJob asyncJob) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); @@ -7222,7 +7222,7 @@ qemuMigrationSrcToSparseFile(virQEMUDriver *driver, /* When using directio with mapped-ram, qemu needs two fds. One with * O_DIRECT set writing the memory, and another without it set for * writing small bits of unaligned state. */ - if ((flags & VIR_DOMAIN_SAVE_BYPASS_CACHE)) { + if (bypassCache) { directFlag = virFileDirectFdFlag(); if (directFlag < 0) { virReportError(VIR_ERR_OPERATION_FAILED, "%s", @@ -7259,7 +7259,7 @@ qemuMigrationSrcToFile(virQEMUDriver *driver, virDomainObj *vm, int *fd, virCommand *compressor, qemuMigrationParams *migParams, - unsigned int flags, + bool bypassCache, virDomainAsyncJob asyncJob) { qemuDomainObjPrivate *priv = vm->privateData; @@ -7293,7 +7293,7 @@ qemuMigrationSrcToFile(virQEMUDriver *driver, virDomainObj *vm, if (migParams && qemuMigrationParamsCapEnabled(migParams, QEMU_MIGRATION_CAP_MAPPED_RAM)) - rc = qemuMigrationSrcToSparseFile(driver, vm, path, fd, flags, asyncJob); + rc = qemuMigrationSrcToSparseFile(driver, vm, path, fd, bypassCache, asyncJob); else rc = qemuMigrationSrcToLegacyFile(driver, vm, *fd, compressor, asyncJob); diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h index 50910ecb1f..51341f453d 100644 --- a/src/qemu/qemu_migration.h +++ b/src/qemu/qemu_migration.h @@ -244,7 +244,7 @@ qemuMigrationSrcToFile(virQEMUDriver *driver, int *fd, virCommand *compressor, qemuMigrationParams *migParams, - unsigned int flags, + bool bypassCache, virDomainAsyncJob asyncJob) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; diff --git a/src/qemu/qemu_saveimage.c b/src/qemu/qemu_saveimage.c index 58a3f96575..1b68a09595 100644 --- a/src/qemu/qemu_saveimage.c +++ b/src/qemu/qemu_saveimage.c @@ -501,7 +501,9 @@ qemuSaveImageCreate(virQEMUDriver *driver, goto cleanup; /* Perform the migration */ - if (qemuMigrationSrcToFile(driver, vm, path, &fd, compressor, saveParams, flags, asyncJob) < 0) + if (qemuMigrationSrcToFile(driver, vm, path, &fd, compressor, saveParams, + (flags & VIR_DOMAIN_SAVE_BYPASS_CACHE), + asyncJob) < 0) goto cleanup; /* Touch up file header to mark image complete. */