Eli Mesika has uploaded a new change for review. Change subject: core:Hot Plug Nic/Disk creates incorre...(#855651) ......................................................................
core:Hot Plug Nic/Disk creates incorre...(#855651) core:Hot Plug Nic/Disk creates incorrect duplicate devices https://bugzilla.redhat.com/show_bug.cgi?id=855651 The Hot Plug Nic/Disk commands does not set the deviceId field. When we get run time info from VDSM, we are looking for the deviceId field, it is is not found, the device is assumed to be an unmanaged device reported to us as a new device by VDSM (i.e. does not exists in DB yet) This will result in a duplicate of each Nic/Disk that is marked as managed device with another device (with different GUID) in vm_device that is marked as an unmanaged device while the last (and incorrect device) will get the address and alias field updates. This patch sets the deviceId field in Nic/Disk Hot Plug command, since this field is not touched by VDSM and returned as is, we can match the returned hot-plug device when updates arrived with current hot plug devices and update the information instead adding new devices. Change-Id: Idac67477c800339b0c48f86a3281c90f3fd4ed7b Signed-off-by: Eli Mesika <[email protected]> --- M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HotPlugDiskVDSCommand.java M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HotPlugNicVDSCommand.java 2 files changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/81/7881/1 diff --git a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HotPlugDiskVDSCommand.java b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HotPlugDiskVDSCommand.java index 542a1fa..51b1345 100644 --- a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HotPlugDiskVDSCommand.java +++ b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HotPlugDiskVDSCommand.java @@ -43,6 +43,7 @@ drive.add(VdsProperties.Shareable, String.valueOf(disk.isShareable())); drive.add(VdsProperties.Optional, Boolean.FALSE.toString()); drive.add(VdsProperties.ReadOnly, String.valueOf(vmDevice.getIsReadOnly())); + drive.add(VdsProperties.DeviceId, vmDevice.getId().getDeviceId().toString()); if (disk.getDiskStorageType() == DiskStorageType.IMAGE) { DiskImage diskImage = (DiskImage) disk; diff --git a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HotPlugNicVDSCommand.java b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HotPlugNicVDSCommand.java index 6ab3898..f834dbb 100644 --- a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HotPlugNicVDSCommand.java +++ b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HotPlugNicVDSCommand.java @@ -41,6 +41,7 @@ addAddress(map, vmDevice.getAddress()); map.add("specParams", vmDevice.getSpecParams()); map.add("nicModel", VmInterfaceType.forValue(nic.getType()).name()); + map.add(VdsProperties.DeviceId, vmDevice.getId().getDeviceId().toString()); if (vmDevice.getBootOrder() > 0) { map.add("bootOrder", String.valueOf(vmDevice.getBootOrder())); } -- To view, visit http://gerrit.ovirt.org/7881 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idac67477c800339b0c48f86a3281c90f3fd4ed7b Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Eli Mesika <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
