diff options
Diffstat (limited to 'hmp.c')
-rw-r--r-- | hmp.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -2226,10 +2226,18 @@ void hmp_nbd_server_add(Monitor *mon, const QDict *qdict) Error *local_err = NULL; qmp_nbd_server_add(device, !!name, name, true, writable, &local_err); + hmp_handle_error(mon, &local_err); +} - if (local_err != NULL) { - hmp_handle_error(mon, &local_err); - } +void hmp_nbd_server_remove(Monitor *mon, const QDict *qdict) +{ + const char *name = qdict_get_str(qdict, "name"); + bool force = qdict_get_try_bool(qdict, "force", false); + Error *err = NULL; + + /* Rely on NBD_SERVER_REMOVE_MODE_SAFE being the default */ + qmp_nbd_server_remove(name, force, NBD_SERVER_REMOVE_MODE_HARD, &err); + hmp_handle_error(mon, &err); } void hmp_nbd_server_stop(Monitor *mon, const QDict *qdict) |