diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 2dc32fa01b..647c3f4d39 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -4964,7 +4964,15 @@ static int qemudDomainSaveFlag(virDomainPtr dom, const char *path, /* Due to way we append QEMU state on our header with dd, * we need to ensure there's a 512 byte boundary. Unfortunately * we don't have an explicit offset in the header, so we fake - * it by padding the XML string with NULLs */ + * it by padding the XML string with NULLs. + * + * XXX: This means there will be (QEMU_MONITOR_MIGRATE_TO_FILE_BS + * - strlen(xml)) bytes of wastage in each file. + * Unfortunately, a large BS is needed for reasonable + * performance. It would be nice to find a replacement for dd + * that could specify the start offset in bytes rather than + * blocks, to eliminate this waste. + */ if (offset % QEMU_MONITOR_MIGRATE_TO_FILE_BS) { unsigned long long pad = QEMU_MONITOR_MIGRATE_TO_FILE_BS - diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 1870b22440..e03b4dff19 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -261,7 +261,10 @@ int qemuMonitorMigrateToCommand(qemuMonitorPtr mon, unsigned int background, const char * const *argv); -# define QEMU_MONITOR_MIGRATE_TO_FILE_BS 512llu +/* In general, a larger BS means better domain save performance, + * at the expense of a larger resulting file - see qemu_driver.c + */ +# define QEMU_MONITOR_MIGRATE_TO_FILE_BS (1024llu * 1024) int qemuMonitorMigrateToFile(qemuMonitorPtr mon, unsigned int background,