• J
    iscsi: Add exit status checking for virISCSIGetSession · 8f54e0d6
    John Ferlan 提交于
    Utilize the exit status parameter for virCommandRunRegex in order to
    check the return error from the 'iscsiadm --mode session' command.
    Without this enabled, if there are no sessions running then virCommandRun
    would have displayed an error such as:
    
        2016-05-13 15:17:15.165+0000: 10920: error : virCommandWait:2553 :
                   internal error: Child process (iscsiadm --mode session)
                   unexpected exit status 21: iscsiadm: No active sessions.
    
    It is possible that for certain paths (when probe is true) we only care
    whether it's running or not to make certain decisions.  Spitting out
    the error for those paths is unnecessary.
    
    If we do have a situation where probe = false and there's an error,
    then display the error from iscsiadm if it's there.
    8f54e0d6
viriscsi.c 14.3 KB