]> git.proxmox.com Git - mirror_qemu.git/blobdiff - qemu-nbd.c
input: Decrement queue count on kbd delay
[mirror_qemu.git] / qemu-nbd.c
index e4f00e26ddf3705084df0c6855c34718fd9e9883..3b55ffa6eeb22c0f6099b69438fb9cead8bbe096 100644 (file)
@@ -324,7 +324,7 @@ out:
 
 static int nbd_can_accept(void)
 {
-    return nb_fds < shared;
+    return state == RUNNING && nb_fds < shared;
 }
 
 static void nbd_export_closed(NBDExport *exp)
@@ -335,10 +335,10 @@ static void nbd_export_closed(NBDExport *exp)
 
 static void nbd_update_server_watch(void);
 
-static void nbd_client_closed(NBDClient *client)
+static void nbd_client_closed(NBDClient *client, bool negotiated)
 {
     nb_fds--;
-    if (nb_fds == 0 && !persistent && state == RUNNING) {
+    if (negotiated && nb_fds == 0 && !persistent && state == RUNNING) {
         state = TERMINATE;
     }
     nbd_update_server_watch();