Skip to content

Fix bugs in rmc lookup for sgpath

When we are getting the geometry of the library after the start of rmcd, the rmc_send_scsi_cmd method compares major number of the hardcoded "sg0" device to the major number of the device provided. If they match, it uses the given path as the sg device path directly. This works in most cases, but when we attach devices via iSCSI, there will be no "sg0" on the remote machine, therefore this check will fail. The subsequent find_sgpath assumes the given path is a tape device, not a media changer device and therefore looks first at the scsi_tape path to find tape devices with matching major and minor numbers. It does not find any at which point the find_sgpath exits returning an empty string as the sgpath which rmc will fail to open.