Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge tag 'pull-nbd-2023-05-03' of https://repo.or.cz/qemu/ericb into…
… staging

nbd patches for 2023-05-03

- Eric Blake: clear LISTEN_FDNAMES when consuming systemd sockets
- Stefan Hajnoczi: clear export BlockDeviceOps in central location

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCAAdFiEEccLMIrHEYCkn0vOqp6FrSiUnQ2oFAmRSr2gACgkQp6FrSiUn
# Q2qGIQf/Yg7Qwplxz9U+1VZ2sLwMU4NukzeYQFb5K3cdJUz0UzcZW7EZ4eL5Ll1F
# g6UUni+1y+xnTnN+isz062uSo05WCOoLdV0MKYPWjILqe2HpqYLK7Kt2Y8Syh/ET
# aiGoFl2T510A3M8QTNrQIGnul7g3JBRR1ar3mm7u5SD9gKxjlRFftEQLU8GrAEZP
# Bms122pN8Cvu/vRnBraeReNcTwdtWSQYtOvg2BHL+gROWcmS+FAtSpPOjXgjSSTa
# /K5QgBoph5I4H9sJVpN/nbi5aJkhm/A559tv/VR7SP862u6qz3n+2rJSoxee5S7x
# FgxJ/o03ZeTVFfIE3LdVycvOokPMJw==
# =DNEY
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 03 May 2023 08:00:56 PM BST
# gpg:                using RSA key 71C2CC22B1C4602927D2F3AAA7A16B4A2527436A
# gpg: Good signature from "Eric Blake <eblake@redhat.com>" [full]
# gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" [full]
# gpg:                 aka "[jpeg image of size 6874]" [full]

* tag 'pull-nbd-2023-05-03' of https://repo.or.cz/qemu/ericb:
  block/export: call blk_set_dev_ops(blk, NULL, NULL)
  systemd: Also clear LISTEN_FDNAMES during systemd socket activation

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed May 4, 2023
2 parents 044f8cf + de79b52 commit 1488ccb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions block/export/export.c
Expand Up @@ -192,6 +192,7 @@ BlockExport *blk_exp_add(BlockExportOptions *export, Error **errp)
return exp;

fail:
blk_set_dev_ops(exp->blk, NULL, NULL);
blk_unref(blk);
aio_context_release(ctx);
if (exp) {
Expand Down Expand Up @@ -219,6 +220,7 @@ static void blk_exp_delete_bh(void *opaque)
assert(exp->refcount == 0);
QLIST_REMOVE(exp, next);
exp->drv->delete(exp);
blk_set_dev_ops(exp->blk, NULL, NULL);
blk_unref(exp->blk);
qapi_event_send_block_export_deleted(exp->id);
g_free(exp->id);
Expand Down
1 change: 0 additions & 1 deletion block/export/vduse-blk.c
Expand Up @@ -346,7 +346,6 @@ static void vduse_blk_exp_delete(BlockExport *exp)

blk_remove_aio_context_notifier(exp->blk, blk_aio_attached, blk_aio_detach,
vblk_exp);
blk_set_dev_ops(exp->blk, NULL, NULL);
ret = vduse_dev_destroy(vblk_exp->dev);
if (ret != -EBUSY) {
unlink(vblk_exp->recon_file);
Expand Down
1 change: 1 addition & 0 deletions util/systemd.c
Expand Up @@ -51,6 +51,7 @@ unsigned int check_socket_activation(void)
/* So these are not passed to any child processes we might start. */
unsetenv("LISTEN_FDS");
unsetenv("LISTEN_PID");
unsetenv("LISTEN_FDNAMES");

/* So the file descriptors don't leak into child processes. */
for (i = 0; i < nr_fds; ++i) {
Expand Down

0 comments on commit 1488ccb

Please sign in to comment.