extern "C" fn event_cb(
        event: spdk_bdev_event_type,
        bdev: *mut spdk_bdev,
        _ctx: *mut c_void,
    ) {
        let bdev = Bdev(NonNull::new(bdev).unwrap());
        // Take the appropriate action for the given event type
        match event {
            spdk_sys::SPDK_BDEV_EVENT_REMOVE => {
                info!("Received remove event for bdev {}", bdev.name());
                if let Some(child) = lookup_child_from_bdev(&bdev.name()) {
                    child.remove();
                }
            }
            spdk_sys::SPDK_BDEV_EVENT_RESIZE => {
                info!("Received resize event for bdev {}", bdev.name())
            }
            spdk_sys::SPDK_BDEV_EVENT_MEDIA_MANAGEMENT => info!(
                "Received media management event for bdev {}",
                bdev.name()
            ),
            _ => error!(
                "Received unknown event {} for bdev {}",
                event,
                bdev.name()
            ),
        }
    }
/// Called by spdk when there is an asynchronous bdev event i.e. removal.
Called by spdk when there is an asynchronous bdev event i.e. removal.
Called by spdk when there is an asynchronous bdev event i . e . removal .
extern "C" fn event_cb(
        event: spdk_bdev_event_type,
        bdev: *mut spdk_bdev,
        _ctx: *mut c_void,
    ) {
        let bdev = Bdev(NonNull::new(bdev).unwrap());
        // Take the appropriate action for the given event type
        match event {
            spdk_sys::SPDK_BDEV_EVENT_REMOVE => {
                info!("Received remove event for bdev {}", bdev.name());
                if let Some(child) = lookup_child_from_bdev(&bdev.name()) {
                    child.remove();
                }
            }
            spdk_sys::SPDK_BDEV_EVENT_RESIZE => {
                info!("Received resize event for bdev {}", bdev.name())
            }
            spdk_sys::SPDK_BDEV_EVENT_MEDIA_MANAGEMENT => info!(
                "Received media management event for bdev {}",
                bdev.name()
            ),
            _ => error!(
                "Received unknown event {} for bdev {}",
                event,
                bdev.name()
            ),
        }
    }
extern " " fn event_cb ( event : spdk_bdev_event_type , bdev : * mut spdk_bdev , _ctx : * mut c_void , ) { let bdev = Bdev ( NonNull :: new ( bdev ) . unwrap ( ) ) ; // Take the appropriate action for the given event type match event { spdk_sys :: SPDK_BDEV_EVENT_REMOVE => { info ! ( " " bdev name ( ) ) ; if let Some ( child ) = lookup_child_from_bdev ( & bdev . name ( ) ) { child . remove ( ) ; } } spdk_sys :: SPDK_BDEV_EVENT_RESIZE => { info ! ( " " bdev name ( ) ) } spdk_sys :: SPDK_BDEV_EVENT_MEDIA_MANAGEMENT => info ! ( " " bdev name ( ) ) , _ => error ! ( " " event bdev name ( ) ) , } }
Called by spdk when there is an asynchronous bdev event i.e.
Called by spdk when there is an asynchronous bdev event i . e .
event
spdk_bdev_event_type
bdev
*mut spdk_bdev
_ctx
*mut c_void