Idan Shaby has uploaded a new change for review.

Change subject: core: Store iSCSI Target Address instead of IP Address in DB
......................................................................

core: Store iSCSI Target Address instead of IP Address in DB

When discovering a new iSCSI target, we send VDSM the address
we got from the user's input (which can be an IP address or a DNS name).
Since VDSM translates any address to an IP address and sends it back to
the engine, we don't want to store this address in the DB, but the original
one that we got from the user.

Change-Id: Idf6d385606e130f4f529a0b374a9f731310a7f9f
Bug-Url: https://bugzilla.redhat.com/1086310
Signed-off-by: Idan Shaby <ish...@redhat.com>
---
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/DiscoverSendTargetsVDSCommand.java
1 file changed, 7 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/12/34412/1

diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/DiscoverSendTargetsVDSCommand.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/DiscoverSendTargetsVDSCommand.java
index faf0c76..82d7d18 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/DiscoverSendTargetsVDSCommand.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/DiscoverSendTargetsVDSCommand.java
@@ -43,10 +43,16 @@
             String[] address = tokens[0].split(":");
             String[] literals = tokens[1].split(" ");
 
-            con.setconnection(address[0]);
             con.setport(address[1]);
             con.setportal(literals[0]);
             con.setiqn(literals[1]);
+
+            // address[0] is the IP address of the target as returned from 
VDSM.
+            // Since we want to use the original address from the user's input 
(which can also be a DNS name),
+            // and since VDSM always returns the IP address of the target, we 
don't want to override it
+            // by calling con.setconnection(address[0]).
+            log.infoFormat("Connection to {0} requested, VDSM returned {1}.", 
con.getconnection(), address[0]);
+
             connections.add(con);
         }
 


-- 
To view, visit http://gerrit.ovirt.org/34412
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idf6d385606e130f4f529a0b374a9f731310a7f9f
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Idan Shaby <ish...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to