Skip to content

block: fix spurious DEVICE_TRAY_MOVED events on shutdown

Pavel Hrdina qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 1 replyIn review
  2. v32 patches 2 repliesSuperseded
  3. v22 patches 15 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3block: make bdrv_dev_change_media_cb() publicblock.c include/block/block.h+2 -20 replies
2/3block: move the bdrv_dev_change_media_cb()block.c blockdev.c+5 -80 replies
3/3blockdev: do not open block device if password is not required but user provides oneblockdev.c+5 -21 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [Qemu-devel] [PATCH v4 0/3] block: fix spurious DEVICE_TRAY_MOVED events on shutdown

This fixes a regression introduced by commit 9ca111544.

The first commit is done by Luiz and I'm just using it as it is.

The second commit moves the bdrv_dev_change_media_cb() into eject_device(), called by QMP and HMP eject command, and into qmp_bdrv_open_encrypted(), called by QMP and HMP change command. These are the only place where I think that should call the bdrv_dev_change_media_cb() function.

As we discussed the third patch fixes the issue that user can provide a password for device not requiring any password. The device is opened with an error as warning. We should fail and don't open the device at all.

There is no reason to call this function while we are removing the device from the guest, for example while closing and deleting all devices on shutdown.

* changes from v1:
- used the first patch from Luiz's series

* changes from v2:
- added comment that the error QERR_DEVICE_NOT_ENCRYPTED is used as warning

* changes from v3:
- added more info into second commit
- added new patch to fix the issue with providing password for device not requiring password

Luiz Capitulino (1):
block: make bdrv_dev_change_media_cb() public

Pavel Hrdina (2):
block: move the bdrv_dev_change_media_cb()
blockdev: do not open block device if password is not required but
user provides one

 block.c               | 11 +----------
 blockdev.c            | 12 ++++++++++--
 include/block/block.h |  1 +
 3 files changed, 12 insertions(+), 12 deletions(-)
Signature · 1 line
1.8.1.4