Arik Hadas has posted comments on this change.
Change subject: core: add memory volume to snapshot entity
......................................................................
Patch Set 10: (8 inline comments)
@Allon, the memory volume is a comma-separated string of 6 uuids: <storage
domain id>,<storage pool id>,<image1 id>,<volume1 id>,<image2 id>,<volume2 id>.
that way the two volumes (one for the memory dump and one for the metadata) are
represented. there's no proper documentation for that, but that becoming a
standard (that we should probably change in the future) as this structure is
also used to represent the memory volumes of hibernation command
....................................................
File
backend/manager/dbscripts/upgrade/03_03_0142_add_memory_volume_column_snapshots.sql
Line 1: --Add memory volume into snapshots
Line 2: SELECT fn_db_add_column('snapshots', 'memory_volume', 'character
varying(255) NOT NULL DEFAULT ''''');
I see, I've changed the value in the DB to be nullable in order to get the
advantages you mention, and kept it not-nullable in the Java entity to keep the
clean API
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java
Line 754: SnapshotType.REGULAR,
Line 755: disk.getDescription(),
Line 756: disk.getLastModifiedDate(),
Line 757: disk.getAppList(),
Line 758: StringUtils.EMPTY));
Done
Line 759: }
Line 760: }
Line 761:
Line 762: /**
Line 772: SnapshotType.ACTIVE,
Line 773: "Active VM snapshot",
Line 774: new Date(),
Line 775: null,
Line 776: StringUtils.EMPTY));
Done
Line 777: }
Line 778:
Line 779: // the last image in each list is the leaf
Line 780: public static Map<Guid, List<DiskImage>>
getImagesLeaf(List<DiskImage> images) {
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/snapshots/SnapshotsManager.java
Line 155: snapshotType,
Line 156: description,
Line 157: new Date(),
Line 158: vm.getAppList(),
Line 159: StringUtils.EMPTY);
Done
Line 160:
Line 161: getSnapshotDao().save(snapshot);
Line 162: compensationContext.snapshotNewEntity(snapshot);
Line 163: return snapshot;
....................................................
File
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/GetAllVmSnapshotsByVmIdQueryTest.java
Line 41: public void setUp() throws Exception {
Line 42: super.setUp();
Line 43: vmId = Guid.NewGuid();
Line 44: snapshot =
Line 45: new Snapshot(Guid.NewGuid(), SnapshotStatus.OK, vmId,
null, SnapshotType.REGULAR, "", new Date(), "", "");
Done
Line 46: setUpDAOMocks();
Line 47: }
Line 48:
Line 49: private void setUpDAOMocks() {
....................................................
File
backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/SnapshotDaoTest.java
Line 45: RandomUtils.instance().nextEnum(SnapshotType.class),
Line 46: RandomUtils.instance().nextString(1000),
Line 47: new Date(),
Line 48: RandomUtils.instance().nextString(200000),
Line 49: StringUtils.EMPTY);
Done
Line 50: }
Line 51:
Line 52: @Override
Line 53: protected void updateExistingEntity() {
....................................................
File backend/manager/modules/dal/src/test/resources/fixtures.xml
Line 2420: <value>oVirt, Winamp, eclipse</value>
Line 2421: <value></value>
Line 2422: <value>2010-11-18 11:11:35</value>
Line 2423: <value>2010-11-18 11:11:35</value>
Line 2424: <value></value>
Done
Line 2425: </row>
Line 2426: <row>
Line 2427: <value>a7bb24df-9fdf-4bd6-b7a9-f5ce52da0f11</value>
Line 2428: <value>77296e00-0cad-4e5a-9299-008a7b6f4354</value>
Line 2433: <value>oVirt, Winamp, eclipse</value>
Line 2434: <value>test!</value>
Line 2435: <value>2010-11-18 11:11:35</value>
Line 2436: <value>2010-11-18 11:11:35</value>
Line 2437: <value></value>
Done
Line 2438: </row>
Line 2439: </table>
Line 2440:
Line 2441: <table name="images">
--
To view, visit http://gerrit.ovirt.org/14053
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iecda4c491fe6e207386edf2a9bf2488ec81a332a
Gerrit-PatchSet: 10
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Arik Hadas <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Arik Hadas <[email protected]>
Gerrit-Reviewer: Liron Ar <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Roy Golan <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches