autotest / virt-test

Linux Virtualization Tests
Other
97 stars 139 forks source link

Return lun number in setup_or_cleanup_iscsi. #2293

Closed rbian closed 9 years ago

rbian commented 9 years ago

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.

waynesun09 commented 9 years ago

ACK

PandaWei commented 9 years ago

@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.

rbian commented 9 years ago

@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.

PandaWei commented 9 years ago

@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.

waynesun09 commented 9 years ago

Thanks @rbian @PandaWei , merge now.