#user-interface #implemention #group #iscsi #iscsi-scst

scst

iscsi-scst user interface implemention by rust

7 releases

0.3.3 Oct 18, 2024
0.3.2 Oct 18, 2024
0.2.2 Oct 17, 2024

#247 in Operating systems

Download history 583/week @ 2024-10-12 87/week @ 2024-10-19 1/week @ 2024-10-26

271 downloads per month

MIT/Apache

74KB
2K SLoC

Introduce

Scst is iscsi-scst user interface implemention by rust.

Scst in action

use scst::{Scst, Options}

fun main() {
    let mut scst = Scst::init()?;

    scst.add_device(
        "vdisk_blockio",
        "vol",
        "/dev/zvol/tank/vol",
        &Options::new(),
    )?;

    let target = scst
        .iscsi_mut()
        .add_target("iqn.2018-11.com.vine:vol", &Options::new())?;
    target.enable()?;

    let group = target.create_ini_group("vol")?;
    group.add_lun("vol", 0, &Options::new())?;
    group.add_initiator("iqn.1988-12.com.oracle:d4ebaa45254b")?;

    let handlers = scst.handlers();
    let s = serde_yml::to_string(handlers)?;
    println!("{}", s);

    let targets = scst.iscsi().targets();
    let s = serde_yml::to_string(targets)?;
    println!("{}", s);

    let tgt = scst
        .iscsi()
        .get_target("iqn.2018-11.com.vine:vol")
        .unwrap();
    let stat = serde_yml::to_string(&tgt.io_stat()?)?;
    println!("target stat: {}", stat);

    let sessions = serde_yml::to_string(&tgt.sessions()?)?;
    println!("target session: {}", sessions);
}

Dependencies

~4.5–6.5MB
~120K SLoC