qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL v3 0/8] NBD patches through 2020-10-08
@ 2020-10-09 20:07 Eric Blake
  2020-10-09 20:07 ` [PULL v3 6/8] qemu-nbd: Honor SIGINT and SIGHUP Eric Blake
  2020-10-11 13:33 ` [PULL v3 0/8] NBD patches through 2020-10-08 Peter Maydell
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Blake @ 2020-10-09 20:07 UTC (permalink / raw)
  To: qemu-devel

The following changes since commit 4a7c0bd9dcb08798c6f82e55b5a3423f7ee669f1:

  Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-5.2-20201009' into staging (2020-10-09 15:48:04 +0100)

are available in the Git repository at:

  https://repo.or.cz/qemu/ericb.git tags/pull-nbd-2020-10-08-v3

for you to fetch changes up to ebd57062a1957307a175a810441af87259d7dbe9:

  nbd: Simplify meta-context parsing (2020-10-09 15:05:08 -0500)

v2: fix BSD build
v3: fix mingw build (only the affected patch resent)

----------------------------------------------------------------
nbd patches for 2020-10-08

- silence compilation warnings
- more fixes to prevent reconnect hangs
- improve 'qemu-nbd' termination behavior
- cleaner NBD protocol compliance on string handling

----------------------------------------------------------------
Christian Borntraeger (1):
      nbd: silence maybe-uninitialized warnings

Eric Blake (3):
      qemu-nbd: Honor SIGINT and SIGHUP
      nbd/server: Reject embedded NUL in NBD strings
      nbd: Simplify meta-context parsing

Vladimir Sementsov-Ogievskiy (4):
      block/nbd: fix drain dead-lock because of nbd reconnect-delay
      block/nbd: correctly use qio_channel_detach_aio_context when needed
      block/nbd: fix reconnect-delay
      block/nbd: nbd_co_reconnect_loop(): don't connect if drained

 block/nbd.c  |  71 ++++++++++++++++---
 nbd/server.c | 221 ++++++++++++++++++++++++-----------------------------------
 qemu-nbd.c   |  15 ++--
 3 files changed, 157 insertions(+), 150 deletions(-)

-- 
2.28.0



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PULL v3 6/8] qemu-nbd: Honor SIGINT and SIGHUP
  2020-10-09 20:07 [PULL v3 0/8] NBD patches through 2020-10-08 Eric Blake
@ 2020-10-09 20:07 ` Eric Blake
  2020-10-11 13:33 ` [PULL v3 0/8] NBD patches through 2020-10-08 Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Blake @ 2020-10-09 20:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: Vladimir Sementsov-Ogievskiy, open list:Network Block Dev...

Honoring just SIGTERM on Linux is too weak; we also want to handle
other common signals, and do so even on BSD.  Why?  Because at least
'qemu-nbd -B bitmap' needs a chance to clean up the in-use bit on
bitmaps when the server is shut down via a signal.

See also: http://bugzilla.redhat.com/1883608

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200930121105.667049-2-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
[eblake: apply comment tweak suggested by Vladimir; fix ifdef around
termsig_handler]
Signed-off-by: Eric Blake <eblake@redhat.com>
---
 qemu-nbd.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/qemu-nbd.c b/qemu-nbd.c
index bacb69b0898b..bc644a0670b6 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -154,13 +154,13 @@ QEMU_COPYRIGHT "\n"
     , name);
 }

-#if HAVE_NBD_DEVICE
+#ifdef CONFIG_POSIX
 static void termsig_handler(int signum)
 {
     qatomic_cmpxchg(&state, RUNNING, TERMINATE);
     qemu_notify_event();
 }
-#endif /* HAVE_NBD_DEVICE */
+#endif /* CONFIG_POSIX */

 static int qemu_nbd_client_list(SocketAddress *saddr, QCryptoTLSCreds *tls,
                                 const char *hostname)
@@ -581,17 +581,18 @@ int main(int argc, char **argv)
     const char *pid_file_name = NULL;
     BlockExportOptions *export_opts;

-#if HAVE_NBD_DEVICE
-    /* The client thread uses SIGTERM to interrupt the server.  A signal
-     * handler ensures that "qemu-nbd -v -c" exits with a nice status code.
+#ifdef CONFIG_POSIX
+    /*
+     * Exit gracefully on various signals, which includes SIGTERM used
+     * by 'qemu-nbd -v -c'.
      */
     struct sigaction sa_sigterm;
     memset(&sa_sigterm, 0, sizeof(sa_sigterm));
     sa_sigterm.sa_handler = termsig_handler;
     sigaction(SIGTERM, &sa_sigterm, NULL);
-#endif /* HAVE_NBD_DEVICE */
+    sigaction(SIGINT, &sa_sigterm, NULL);
+    sigaction(SIGHUP, &sa_sigterm, NULL);

-#ifdef CONFIG_POSIX
     signal(SIGPIPE, SIG_IGN);
 #endif

-- 
2.28.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PULL v3 0/8] NBD patches through 2020-10-08
  2020-10-09 20:07 [PULL v3 0/8] NBD patches through 2020-10-08 Eric Blake
  2020-10-09 20:07 ` [PULL v3 6/8] qemu-nbd: Honor SIGINT and SIGHUP Eric Blake
@ 2020-10-11 13:33 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2020-10-11 13:33 UTC (permalink / raw)
  To: Eric Blake; +Cc: QEMU Developers

On Fri, 9 Oct 2020 at 21:15, Eric Blake <eblake@redhat.com> wrote:
>
> The following changes since commit 4a7c0bd9dcb08798c6f82e55b5a3423f7ee669f1:
>
>   Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-5.2-20201009' into staging (2020-10-09 15:48:04 +0100)
>
> are available in the Git repository at:
>
>   https://repo.or.cz/qemu/ericb.git tags/pull-nbd-2020-10-08-v3
>
> for you to fetch changes up to ebd57062a1957307a175a810441af87259d7dbe9:
>
>   nbd: Simplify meta-context parsing (2020-10-09 15:05:08 -0500)
>
> v2: fix BSD build
> v3: fix mingw build (only the affected patch resent)
>
> ----------------------------------------------------------------
> nbd patches for 2020-10-08
>
> - silence compilation warnings
> - more fixes to prevent reconnect hangs
> - improve 'qemu-nbd' termination behavior
> - cleaner NBD protocol compliance on string handling
>

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/5.2
for any user-visible changes.

-- PMM


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-10-11 13:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-09 20:07 [PULL v3 0/8] NBD patches through 2020-10-08 Eric Blake
2020-10-09 20:07 ` [PULL v3 6/8] qemu-nbd: Honor SIGINT and SIGHUP Eric Blake
2020-10-11 13:33 ` [PULL v3 0/8] NBD patches through 2020-10-08 Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).