/// Create iscsi portal and initiator group which will be used later when
/// creating iscsi targets.
Create iscsi portal and initiator group which will be used later when
creating iscsi targets.
Create iscsi portal and initiator group which will be used later when creating iscsi targets .
pub fn init(address: &str) -> Result<()> {
    create_portal_group(
        address,
        ISCSI_PORT_REPLICA,
        ISCSI_PORTAL_GROUP_REPLICA,
    )?;
    if let Err(e) =
        create_portal_group(address, ISCSI_PORT_NEXUS, ISCSI_PORTAL_GROUP_NEXUS)
    {
        destroy_portal_group(ISCSI_PORTAL_GROUP_REPLICA);
        return Err(e);
    }
    if let Err(e) = create_initiator_group(ISCSI_INITIATOR_GROUP) {
        destroy_portal_group(ISCSI_PORTAL_GROUP_REPLICA);
        destroy_portal_group(ISCSI_PORTAL_GROUP_NEXUS);
        return Err(e);
    }
    ADDRESS.with(move |addr| {
        *addr.borrow_mut() = Some(address.to_owned());
    });
    debug!("Created default iscsi initiator group and portal groups for address {}", address);
    Ok(())
}
pub fn init ( address : & str ) -> Result < ( ) > { create_portal_group ( address , ISCSI_PORT_REPLICA , ISCSI_PORTAL_GROUP_REPLICA , ) ? ; if let Err ( e ) = create_portal_group ( address , ISCSI_PORT_NEXUS , ISCSI_PORTAL_GROUP_NEXUS ) { destroy_portal_group ( ISCSI_PORTAL_GROUP_REPLICA ) ; return Err ( e ) ; } if let Err ( e ) = create_initiator_group ( ISCSI_INITIATOR_GROUP ) { destroy_portal_group ( ISCSI_PORTAL_GROUP_REPLICA ) ; destroy_portal_group ( ISCSI_PORTAL_GROUP_NEXUS ) ; return Err ( e ) ; } ADDRESS . with ( move | addr | { * addr . borrow_mut ( ) = Some ( address . to_owned ( ) ) ; } ) ; debug ! ( " " address ) ; Ok ( ( ) ) }
Create iscsi portal and initiator group which will be used later when
creating iscsi targets.
Create iscsi portal and initiator group which will be used later when creating iscsi targets .
address
&str