Shahar Havivi has uploaded a new change for review. Change subject: Engine: set device-id in payload constructor ......................................................................
Engine: set device-id in payload constructor When adding a new payload its device id need to set since it is inherit from VmDevice now - This is true for the default constructor. Change-Id: I33bdc975070d71923ae21985a371b53d427b61d8 Bug-Url: https://bugzilla.redhat.com/1158010 Signed-off-by: Shahar Havivi <[email protected]> --- M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmPayload.java 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/84/34584/1 diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmPayload.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmPayload.java index 9a41735..a198295 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmPayload.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmPayload.java @@ -7,6 +7,7 @@ import org.ovirt.engine.core.common.config.ConfigValues; import org.ovirt.engine.core.common.utils.ObjectUtils; import org.ovirt.engine.core.common.utils.VmDeviceType; +import org.ovirt.engine.core.compat.Guid; public class VmPayload extends VmDevice implements Serializable { @@ -18,12 +19,19 @@ private String volumeId; private HashMap<String, String> files; // file data is base64-encoded + // Use the constructor with the vmid if you have it! public VmPayload() { + this.setId(new VmDeviceId(Guid.newGuid(), Guid.newGuid())); setDeviceType(VmDeviceType.CDROM); this.volumeId = null; this.files = new HashMap<String, String>(); } + public VmPayload(Guid vmid) { + this(); + this.setId(new VmDeviceId(Guid.newGuid(), vmid)); + } + @SuppressWarnings("unchecked") public VmPayload(VmDevice dev) { super(dev.getId(), dev.getType(), dev.getDevice(), -- To view, visit http://gerrit.ovirt.org/34584 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I33bdc975070d71923ae21985a371b53d427b61d8 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Shahar Havivi <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
