]> xenbits.xensource.com Git - libvirt.git/commitdiff
Revert "qemu: Adjust size for qcow2/qed if not on sector boundary"
authorJohn Ferlan <jferlan@redhat.com>
Mon, 12 May 2014 14:10:11 +0000 (10:10 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 13 May 2014 11:26:03 +0000 (07:26 -0400)
This reverts commit e3d66229a1026cd33319714c0ededf650cd261c2.

src/qemu/qemu_driver.c

index e1e7f4cab4550e95b1ff3f578a5e99931ffecd97..1fadabc08c35c2a66b90c4cd1d920f2a0bc955ca 100644 (file)
@@ -9413,7 +9413,6 @@ qemuDomainBlockResize(virDomainPtr dom,
     virDomainObjPtr vm;
     qemuDomainObjPrivatePtr priv;
     int ret = -1, idx;
-    unsigned long long size_up;
     char *device = NULL;
     virDomainDiskDefPtr disk = NULL;
 
@@ -9434,12 +9433,6 @@ qemuDomainBlockResize(virDomainPtr dom,
             return -1;
         }
         size *= 1024;
-        size_up = size;
-    } else {
-        /* For 'qcow2' and 'qed', qemu resize blocks expects values
-         * on sector boundary, so round our value up to prepare
-         */
-        size_up = VIR_ROUND_UP(size, 512);
     }
 
     if (!(vm = qemuDomObjFromDomain(dom)))
@@ -9466,21 +9459,6 @@ qemuDomainBlockResize(virDomainPtr dom,
     }
     disk = vm->def->disks[idx];
 
-    /* qcow2 and qed must be sized appropriately, so be sure our value
-     * is sized appropriately and will fit
-     */
-    if (size != size_up &&
-        (disk->src.format == VIR_STORAGE_FILE_QCOW2 ||
-         disk->src.format == VIR_STORAGE_FILE_QED)) {
-        if (size_up > ULLONG_MAX) {
-            virReportError(VIR_ERR_OVERFLOW,
-                           _("size must be less than %llu KiB"),
-                           ULLONG_MAX / 1024);
-            goto endjob;
-        }
-        size = size_up;
-    }
-
     if (virAsprintf(&device, "%s%s", QEMU_DRIVE_HOST_PREFIX,
                     disk->info.alias) < 0)
         goto endjob;