All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL v2 0/8] NBD patches through 2020-10-08
@ 2020-10-09 13:54 Eric Blake
  2020-10-09 13:54 ` [PULL v2 6/8] qemu-nbd: Honor SIGINT and SIGHUP Eric Blake
  2020-10-09 18:50 ` [PULL v2 0/8] NBD patches through 2020-10-08 Peter Maydell
  0 siblings, 2 replies; 4+ messages in thread
From: Eric Blake @ 2020-10-09 13:54 UTC (permalink / raw)
  To: qemu-devel

The following changes since commit 497d415d76b9f59fcae27f22df1ca2c3fa4df64e:

  Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20201008-1' into staging (2020-10-08 21:41:20 +0100)

are available in the Git repository at:

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

for you to fetch changes up to 351a587410eff515ee28da619867030217b62457:

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

v2: fix BSD compilation error

----------------------------------------------------------------
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] 4+ messages in thread

* [PULL v2 6/8] qemu-nbd: Honor SIGINT and SIGHUP
  2020-10-09 13:54 [PULL v2 0/8] NBD patches through 2020-10-08 Eric Blake
@ 2020-10-09 13:54 ` Eric Blake
  2020-10-09 18:50 ` [PULL v2 0/8] NBD patches through 2020-10-08 Peter Maydell
  1 sibling, 0 replies; 4+ messages in thread
From: Eric Blake @ 2020-10-09 13:54 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..241cc8cefbf4 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -154,13 +154,13 @@ QEMU_COPYRIGHT "\n"
     , name);
 }

-#if HAVE_NBD_DEVICE
+#if 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] 4+ messages in thread

* Re: [PULL v2 0/8] NBD patches through 2020-10-08
  2020-10-09 13:54 [PULL v2 0/8] NBD patches through 2020-10-08 Eric Blake
  2020-10-09 13:54 ` [PULL v2 6/8] qemu-nbd: Honor SIGINT and SIGHUP Eric Blake
@ 2020-10-09 18:50 ` Peter Maydell
  2020-10-09 19:52   ` Eric Blake
  1 sibling, 1 reply; 4+ messages in thread
From: Peter Maydell @ 2020-10-09 18:50 UTC (permalink / raw)
  To: Eric Blake; +Cc: QEMU Developers

On Fri, 9 Oct 2020 at 14:57, Eric Blake <eblake@redhat.com> wrote:
>
> The following changes since commit 497d415d76b9f59fcae27f22df1ca2c3fa4df64e:
>
>   Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20201008-1' into staging (2020-10-08 21:41:20 +0100)
>
> are available in the Git repository at:
>
>   https://repo.or.cz/qemu/ericb.git tags/pull-nbd-2020-10-08-v2
>
> for you to fetch changes up to 351a587410eff515ee28da619867030217b62457:
>
>   nbd: Simplify meta-context parsing (2020-10-09 08:34:15 -0500)
>
> v2: fix BSD compilation error

Compile failure on Windows:
../../qemu-nbd.c:157:5: error: "CONFIG_POSIX" is not defined [-Werror=undef]
 #if CONFIG_POSIX
     ^

thanks
-- PMM


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

* Re: [PULL v2 0/8] NBD patches through 2020-10-08
  2020-10-09 18:50 ` [PULL v2 0/8] NBD patches through 2020-10-08 Peter Maydell
@ 2020-10-09 19:52   ` Eric Blake
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Blake @ 2020-10-09 19:52 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers


[-- Attachment #1.1: Type: text/plain, Size: 975 bytes --]

On 10/9/20 1:50 PM, Peter Maydell wrote:
> On Fri, 9 Oct 2020 at 14:57, Eric Blake <eblake@redhat.com> wrote:
>>
>> The following changes since commit 497d415d76b9f59fcae27f22df1ca2c3fa4df64e:
>>
>>   Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20201008-1' into staging (2020-10-08 21:41:20 +0100)
>>
>> are available in the Git repository at:
>>
>>   https://repo.or.cz/qemu/ericb.git tags/pull-nbd-2020-10-08-v2
>>
>> for you to fetch changes up to 351a587410eff515ee28da619867030217b62457:
>>
>>   nbd: Simplify meta-context parsing (2020-10-09 08:34:15 -0500)
>>
>> v2: fix BSD compilation error
> 
> Compile failure on Windows:
> ../../qemu-nbd.c:157:5: error: "CONFIG_POSIX" is not defined [-Werror=undef]
>  #if CONFIG_POSIX
>      ^

Oh, everywhere else uses #ifdef.  Urgh. v3 coming up.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2020-10-09 20:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-09 13:54 [PULL v2 0/8] NBD patches through 2020-10-08 Eric Blake
2020-10-09 13:54 ` [PULL v2 6/8] qemu-nbd: Honor SIGINT and SIGHUP Eric Blake
2020-10-09 18:50 ` [PULL v2 0/8] NBD patches through 2020-10-08 Peter Maydell
2020-10-09 19:52   ` Eric Blake

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.