mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-26 18:41:17 +00:00
Fix raw storage volume creation for allocation < capacity.
CreateXMLFrom changes accidentally caused all raw volume creation to be fully allocated (as though allocation == capacity). Fix this. Also force CreateXMLFrom to maintain the previous behavior: sparseness should still be maintained since we search for holes when copying, and the clone behavior hasn't been tested with anything but the broken behavior.
This commit is contained in:
parent
c1b2aea80c
commit
5ea25b7801
12
ChangeLog
12
ChangeLog
@ -1,3 +1,15 @@
|
|||||||
|
Mon Jun 22 12:31:38 EDT 2009 Cole Robinson <crobinso@redhat.com>
|
||||||
|
|
||||||
|
* src/storage_backend_fs.c src/storage_driver.c:
|
||||||
|
Fix raw storage volume creation for allocation < capacity.
|
||||||
|
|
||||||
|
CreateXMLFrom changes accidentally caused all raw volume creation to be
|
||||||
|
fully allocated (as though allocation == capacity). Fix this.
|
||||||
|
|
||||||
|
Also force CreateXMLFrom to maintain the previous behavior: sparseness
|
||||||
|
should still be maintained since we search for holes when copying, and the
|
||||||
|
clone behavior hasn't been tested with anything but the broken behavior.
|
||||||
|
|
||||||
Mon Jun 22 11:09:18 EDT 2009 Cole Robinson <crobinso@redhat.com>
|
Mon Jun 22 11:09:18 EDT 2009 Cole Robinson <crobinso@redhat.com>
|
||||||
|
|
||||||
* src/test.c: Fix domain ID after redefining a running VM
|
* src/test.c: Fix domain ID after redefining a running VM
|
||||||
|
@ -1047,7 +1047,7 @@ static int createRaw(virConnectPtr conn,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
remain = vol->capacity;
|
remain = vol->allocation;
|
||||||
|
|
||||||
if (inputfd != -1) {
|
if (inputfd != -1) {
|
||||||
int amtread = -1;
|
int amtread = -1;
|
||||||
|
@ -1379,6 +1379,11 @@ storageVolumeCreateXMLFrom(virStoragePoolPtr obj,
|
|||||||
if (newvol->capacity < origvol->capacity)
|
if (newvol->capacity < origvol->capacity)
|
||||||
newvol->capacity = origvol->capacity;
|
newvol->capacity = origvol->capacity;
|
||||||
|
|
||||||
|
/* Make sure allocation is at least as large as the destination cap,
|
||||||
|
* to make absolutely sure we copy all possible contents */
|
||||||
|
if (newvol->allocation < origvol->capacity)
|
||||||
|
newvol->allocation = origvol->capacity;
|
||||||
|
|
||||||
if (!backend->buildVolFrom) {
|
if (!backend->buildVolFrom) {
|
||||||
virStorageReportError(obj->conn, VIR_ERR_NO_SUPPORT,
|
virStorageReportError(obj->conn, VIR_ERR_NO_SUPPORT,
|
||||||
"%s", _("storage pool does not support volume creation from an existing volume"));
|
"%s", _("storage pool does not support volume creation from an existing volume"));
|
||||||
|
Loading…
Reference in New Issue
Block a user