Skip to content

Commit

Permalink
core: override storage domain id when creating target disk
Browse files Browse the repository at this point in the history
When copying from a traditional domain to an MBS domain we create a new
ManagedBlockStorageDisk that is based on the source disk with updated
paramteters.

Currently createManagedBlockDiskFromDiskImage adds the target
Storage Domain to the target's disk list, however, this list already
contains the source domain, which makes the disk present on two Storage
Domains.

This patch overrides the original disks Storage Domain list.
  • Loading branch information
bennyz committed Jun 2, 2022
1 parent 6fcc5e7 commit 0e5d532
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.ovirt.engine.core.bll.storage.disk.image;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

Expand Down Expand Up @@ -329,7 +330,7 @@ private ManagedBlockStorageDisk createManagedBlockDiskFromDiskImage(DiskImage di
managedBlockDisk.setImageId(getParameters().getDestinationImageId());
managedBlockDisk.setDiskAlias(getParameters().getDiskAlias());
managedBlockDisk.setDiskDescription(getParameters().getDescription());
managedBlockDisk.getStorageIds().add(getParameters().getDestDomain());
managedBlockDisk.setStorageIds(Arrays.asList(getParameters().getDestDomain()));

return managedBlockDisk;
}
Expand Down

0 comments on commit 0e5d532

Please sign in to comment.