[PATCH 4/8] backup: Move file format check from parser to qemu driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It's a technical detail in qemu that QCOW2 is needed for a pull-mode
backup.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/conf/backup_conf.c |  5 -----
 src/qemu/qemu_backup.c | 10 +++++++++-
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/conf/backup_conf.c b/src/conf/backup_conf.c
index ea812cc432..47e3bc1d60 100644
--- a/src/conf/backup_conf.c
+++ b/src/conf/backup_conf.c
@@ -204,11 +204,6 @@ virDomainBackupDiskDefParseXML(xmlNodePtr node,
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                            _("unknown disk backup driver '%s'"), driver);
             return -1;
-        } else if (!push && def->store->format != VIR_STORAGE_FILE_QCOW2) {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                           _("pull mode requires qcow2 driver, not '%s'"),
-                           driver);
-            return -1;
         }
     }

diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c
index 09f7921ea7..b2340eb1cf 100644
--- a/src/qemu/qemu_backup.c
+++ b/src/qemu/qemu_backup.c
@@ -266,8 +266,16 @@ qemuBackupDiskPrepareDataOne(virDomainObjPtr vm,
     if (!qemuDomainDiskBlockJobIsSupported(vm, dd->domdisk))
         return -1;

-    if (!dd->store->format)
+    if (dd->store->format == VIR_STORAGE_FILE_NONE) {
         dd->store->format = VIR_STORAGE_FILE_QCOW2;
+    } else if (dd->store->format != VIR_STORAGE_FILE_QCOW2) {
+        if (pull) {
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                           _("pull mode backup for disk '%s' requires qcow2 driver"),
+                           dd->backupdisk->name);
+            return -1;
+        }
+    }

     /* calculate backing store to use:
      * push mode:
-- 
2.28.0




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux