Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions pkg/spdk/client/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -1587,3 +1587,27 @@ func (c *Client) SpdkKillInstance(sig string) (result bool, err error) {

return result, json.Unmarshal(cmdOutput, &result)
}

// BdevNvmeSetHotplug enables or disables the NVMe hotplug poller.
//
// "enable": true to enable hotplug, false to disable.
//
// "periodUs": Polling period in microseconds.
func (c *Client) BdevNvmeSetHotplug(enable bool, periodUs uint64) (bool, error) {
params := map[string]interface{}{
"enable": enable,
"period_us": periodUs,
}

var result bool
cmdOutput, err := c.jsonCli.SendCommand("bdev_nvme_set_hotplug", params)
if err != nil {
return false, err
}

if err := json.Unmarshal(cmdOutput, &result); err != nil {
return false, err
}

return result, nil
}
Loading