提交 85a117a5 编写于 作者: J John Ferlan

Revert "qemu: Adjust size for qcow2/qed if not on sector boundary"

This reverts commit e3d66229.
上级 31b140eb
...@@ -9413,7 +9413,6 @@ qemuDomainBlockResize(virDomainPtr dom, ...@@ -9413,7 +9413,6 @@ qemuDomainBlockResize(virDomainPtr dom,
virDomainObjPtr vm; virDomainObjPtr vm;
qemuDomainObjPrivatePtr priv; qemuDomainObjPrivatePtr priv;
int ret = -1, idx; int ret = -1, idx;
unsigned long long size_up;
char *device = NULL; char *device = NULL;
virDomainDiskDefPtr disk = NULL; virDomainDiskDefPtr disk = NULL;
...@@ -9434,12 +9433,6 @@ qemuDomainBlockResize(virDomainPtr dom, ...@@ -9434,12 +9433,6 @@ qemuDomainBlockResize(virDomainPtr dom,
return -1; return -1;
} }
size *= 1024; 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))) if (!(vm = qemuDomObjFromDomain(dom)))
...@@ -9466,21 +9459,6 @@ qemuDomainBlockResize(virDomainPtr dom, ...@@ -9466,21 +9459,6 @@ qemuDomainBlockResize(virDomainPtr dom,
} }
disk = vm->def->disks[idx]; 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, if (virAsprintf(&device, "%s%s", QEMU_DRIVE_HOST_PREFIX,
disk->info.alias) < 0) disk->info.alias) < 0)
goto endjob; goto endjob;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册