-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new ListVolumeBitmaps command to list all bitmaps on a image/volume. This will be used to validate the bitmaps in the database. Signed-off-by: Jean-Louis Dupond <[email protected]>
- Loading branch information
Showing
7 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
.../src/main/java/org/ovirt/engine/core/bll/storage/disk/image/ListVolumeBitmapsCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.ovirt.engine.core.bll.storage.disk.image; | ||
|
||
import org.ovirt.engine.core.bll.InternalCommandAttribute; | ||
import org.ovirt.engine.core.bll.NonTransactiveCommandAttribute; | ||
import org.ovirt.engine.core.bll.context.CommandContext; | ||
import org.ovirt.engine.core.common.action.VolumeBitmapCommandParameters; | ||
import org.ovirt.engine.core.common.vdscommands.VDSCommandType; | ||
import org.ovirt.engine.core.compat.Guid; | ||
|
||
@NonTransactiveCommandAttribute(forceCompensation = true) | ||
@InternalCommandAttribute | ||
public class ListVolumeBitmapsCommand<T extends VolumeBitmapCommandParameters> extends | ||
VolumeBitmapCommandBase<T> { | ||
|
||
public ListVolumeBitmapsCommand(Guid commandId) { | ||
super(commandId); | ||
} | ||
|
||
public ListVolumeBitmapsCommand(T parameters, CommandContext commandContext) { | ||
super(parameters, commandContext); | ||
} | ||
|
||
@Override | ||
protected VDSCommandType getBitmapAction() { | ||
return VDSCommandType.ListVolumeBitmaps; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
.../src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/ListVolumeBitmapsVDSCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package org.ovirt.engine.core.vdsbroker.vdsbroker; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.stream.Collectors; | ||
import java.util.stream.Stream; | ||
|
||
import org.ovirt.engine.core.common.vdscommands.VolumeBitmapVDSCommandParameters; | ||
import org.ovirt.engine.core.compat.Guid; | ||
import org.ovirt.engine.core.vdsbroker.irsbroker.UUIDListReturn; | ||
|
||
public class ListVolumeBitmapsVDSCommand<P extends VolumeBitmapVDSCommandParameters> extends VdsBrokerCommand<P> { | ||
|
||
private UUIDListReturn uuidListReturn; | ||
|
||
public ListVolumeBitmapsVDSCommand(P parameters) { | ||
super(parameters); | ||
} | ||
|
||
@Override | ||
protected void executeVdsBrokerCommand() { | ||
Map<String, Object> volume = new HashMap<>(); | ||
volume.put("sd_id", getParameters().getStorageDomainId().toString()); | ||
volume.put("img_id", getParameters().getImageGroupId().toString()); | ||
volume.put("vol_id", getParameters().getImageId().toString()); | ||
volume.put("generation", getParameters().getGeneration()); | ||
|
||
uuidListReturn = getBroker().listBitmaps(getParameters().getJobId().toString(), volume); | ||
proceedProxyReturnValue(); | ||
|
||
setReturnValue(Stream.of(uuidListReturn.getUUIDList()).map(Guid::new).collect(Collectors.toList())); | ||
} | ||
|
||
@Override | ||
protected Status getReturnStatus() { | ||
return uuidListReturn.getStatus(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters