Skip to content

Commit

Permalink
core: do not change qcow+preallocated volumes when moving disks
Browse files Browse the repository at this point in the history
Base volumes can be of QCOW format and preallocated type when the disk
is set with incremental-backup enabled. When moving disks, we now
propagate the incremental-backup settings forward to CreateVolume so it
will keep these volumes preallocated on the destination storage domain.

Bug-Url: https://bugzilla.redhat.com/2211608

Signed-off-by: Arik Hadas <ahadas@redhat.com>
  • Loading branch information
ahadas committed Jul 25, 2023
1 parent 3bfac2e commit b5d8737
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,7 @@ private List<DiskImage> prepareImageChainMap(DiskImage diskImage, Guid destImage
oldToNewDiskImageMap
.keySet()
.stream()
.collect(Collectors.toMap(d -> d.getImageId(),
d -> oldToNewDiskImageMap.get(d))));
.collect(Collectors.toMap(DiskImage::getImageId, oldToNewDiskImageMap::get)));
List<DiskImage> newChain = new ArrayList(oldToNewDiskImageMap.values());
ImagesHandler.sortImageList(newChain);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ private void createImage(DiskImage image, int imageIndex) {
parameters.setParentCommand(getActionType());
parameters.setParentParameters(getParameters());
parameters.setJobWeight(getParameters().getOperationsJobWeight().get(image.getImageId().toString()));
parameters.setBackup(image.getBackup());
runInternalActionWithTasksContext(ActionType.CreateVolumeContainer, parameters);
}

Expand Down

0 comments on commit b5d8737

Please sign in to comment.