]> git.proxmox.com Git - mirror_qemu.git/blobdiff - qemu-nbd.c
exec: Add lock parameter to qemu_ram_ptr_length
[mirror_qemu.git] / qemu-nbd.c
index 14e7947a4c484a7b40381b1ca81ddba8847523f9..4208829a166d9ed745159bfaaea04b81e1c5b2a1 100644 (file)
@@ -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();
@@ -581,6 +581,10 @@ int main(int argc, char **argv)
     sa_sigterm.sa_handler = termsig_handler;
     sigaction(SIGTERM, &sa_sigterm, NULL);
 
+#ifdef CONFIG_POSIX
+    signal(SIGPIPE, SIG_IGN);
+#endif
+
     module_call_init(MODULE_INIT_TRACE);
     qcrypto_init(&error_fatal);