mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
nbd: Forbid nbd-server-stop when server is not running
Since we already forbid other nbd-server commands when not in the right state, it is unlikely that any caller was relying on a second stop to behave as a silent no-op. Update iotest 223 to show the improved behavior. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20190111194720.15671-3-eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
This commit is contained in:
parent
2d2fd67428
commit
7801c3a7fd
3 changed files with 7 additions and 2 deletions
|
@ -214,6 +214,11 @@ void qmp_nbd_server_remove(const char *name,
|
|||
|
||||
void qmp_nbd_server_stop(Error **errp)
|
||||
{
|
||||
if (!nbd_server) {
|
||||
error_setg(errp, "NBD server not running");
|
||||
return;
|
||||
}
|
||||
|
||||
nbd_export_close_all();
|
||||
|
||||
nbd_server_free(nbd_server);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue