Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: always update volume size when creating a new image #267

Merged
merged 2 commits into from May 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -27,6 +27,7 @@
import org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType;
import org.ovirt.engine.core.common.businessentities.StorageDomain;
import org.ovirt.engine.core.common.businessentities.VMStatus;
import org.ovirt.engine.core.common.businessentities.storage.DiskContentType;
import org.ovirt.engine.core.common.businessentities.storage.DiskImage;
import org.ovirt.engine.core.common.errors.EngineException;
import org.ovirt.engine.core.common.errors.EngineMessage;
Expand Down Expand Up @@ -279,7 +280,7 @@ protected void endSuccessfully() {
private DiskImage getMemoryDumpDisk(List<ActionReturnValue> returnValues) {
for (ActionReturnValue returnValue : returnValues) {
DiskImage disk = returnValue.getActionReturnValue();
if (disk.getSize() != MemoryUtils.METADATA_SIZE_IN_BYTES) {
if (disk.getContentType() == DiskContentType.MEMORY_DUMP_VOLUME) {
return disk;
}
}
Expand All @@ -290,7 +291,7 @@ private DiskImage getMemoryDumpDisk(List<ActionReturnValue> returnValues) {
private DiskImage getMemoryMetadataDisk(List<ActionReturnValue> returnValues) {
for (ActionReturnValue returnValue : returnValues) {
DiskImage disk = returnValue.getActionReturnValue();
if (disk.getSize() == MemoryUtils.METADATA_SIZE_IN_BYTES) {
if (disk.getContentType() == DiskContentType.MEMORY_METADATA_VOLUME) {
return disk;
}
}
Expand Down
Expand Up @@ -384,6 +384,9 @@ protected void endSuccessfully() {
newStorageDomainID,
getDestinationDiskImage());
}

// Update image's size if it's changed
getDestinationDiskImage().setSize(newImageIRS.getSize());
}
} catch (EngineException e) {
// Logging only
Expand Down