Closed rbian closed 9 years ago
ACK
@waynesun09 and @rbian In my opinion, It's not a good idea that return (emulated_target, _iscsi.luns) . Not all of the caller of setup_or_cleanup_iscsi() needs the lun number. And this PR involves a lot of functions. we should try our best to control the scope of the changes.
We can add function named get_luns(), which obtain the lun number by emulated_target or emulated_target at the class of _IscsiComm . and call it when we need it.
@PandaWei , I have thought about it. As we can get the lun number during the initialization time, the easiest way is to return the value by setup_or_cleanup_iscsi. If we add new mothed get_luns to the class of _IscsiComm, we must have a Iscsi object to call the function, the object can be seen in setup_or_cleanup_iscsi, and it's not in tp-libvirt. We also can't get lun number except return the Iscsi object to tp-libvirt.
@rbian Yes, No Iscsi object is a problem. and It seems that there's no good idea to avoid it so far. I'm OK for this PR.
Thanks @rbian @PandaWei , merge now.
Lun number is needed to build domain xml for iscsi disk, store the lun number during iscsi setup and make it available to iscsi object.