MCPcopy Create free account
hub / github.com/axboe/liburing / cmd_dev_del_by_kill

Function cmd_dev_del_by_kill

test/uring_cmd_ublk.c:910–935  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

908}
909
910static int cmd_dev_del_by_kill(int number)
911{
912 struct ublk_dev *dev;
913 int ret;
914
915 dev = ublk_ctrl_init();
916 dev->dev_info.dev_id = number;
917
918 ret = ublk_ctrl_get_info(dev);
919 if (ret < 0)
920 goto fail;
921
922 /* simulate one ublk daemon panic */
923 kill(dev->dev_info.ublksrv_pid, 9);
924
925 ret = ublk_stop_io_daemon(dev);
926 if (ret < 0)
927 ublk_err("%s: can't stop daemon id %d\n", __func__, number);
928 ublk_ctrl_del_dev(dev);
929fail:
930 if (ret >= 0)
931 ret = ublk_ctrl_get_info(dev);
932 ublk_ctrl_deinit(dev);
933
934 return (ret != 0) ? 0 : -EIO;
935}
936
937/****************** part 2: target implementation ********************/
938

Callers 1

test_del_ublk_with_ioFunction · 0.85

Calls 6

ublk_ctrl_initFunction · 0.85
ublk_ctrl_get_infoFunction · 0.85
ublk_stop_io_daemonFunction · 0.85
ublk_errFunction · 0.85
ublk_ctrl_del_devFunction · 0.85
ublk_ctrl_deinitFunction · 0.85

Tested by 1

test_del_ublk_with_ioFunction · 0.68