qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3 0/4] Add 'x-blockdev-del' command
@ 2015-10-23 12:03 Alberto Garcia
  2015-10-23 12:03 ` [Qemu-devel] [PATCH v3 1/4] mirror: block all operations on the target image during the job Alberto Garcia
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Alberto Garcia @ 2015-10-23 12:03 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Alberto Garcia, qemu-block, Markus Armbruster,
	Max Reitz, Stefan Hajnoczi

This version uses op blockers for the target image in the drive-mirror
job, but the implementation of 'x-blockdev-del' remains the same. I
copy the description from the previous series:

The semantics of 'x-blockdev-del' try to mirror the semantics of
'blockdev-add' as I discussed with Kevin in the previous thread.
There's two parameters: 'id' and 'node-name' and only one can be
specified.

   1) 'x-blockdev-del id=foo' deletes the backend foo with its BDS, if
      and only if neither have more than 1 reference and the BDS has
      no parents and no op blockers.

   2) 'x-blockdev-del node-name=foo' deletes the BDS foo, if and only
      if it only has one reference, no parents, no op blockers AND it
      is not attached to any block backend.

Regards,

Berto

v3:
- Remove the extra references added in v2 to the mirror and backup
  jobs, and use op blockers instead (for the mirror case only).

v2: https://lists.gnu.org/archive/html/qemu-block/2015-10/msg00828.html
- Rename it as 'x-blockdev-del' and label it as experimental.
- Use two parameters instead of just one. If you try to delete a BDS,
  it must not be attached to any backend.
- New test cases.
- Hold extra references during the mirror and backup block jobs.

v1: https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg02999.html
- Initial implementation


Alberto Garcia (4):
  mirror: block all operations on the target image during the job
  block: Add blk_get_refcnt()
  block: Add 'x-blockdev-del' QMP command
  iotests: Add tests for the x-blockdev-del command

 block/block-backend.c          |   5 +
 block/mirror.c                 |   4 +
 blockdev.c                     |  66 +++++++
 include/sysemu/block-backend.h |   1 +
 qapi/block-core.json           |  32 +++-
 qmp-commands.hx                |  46 ++++-
 tests/qemu-iotests/139         | 408 +++++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/139.out     |   5 +
 tests/qemu-iotests/group       |   1 +
 9 files changed, 564 insertions(+), 4 deletions(-)
 create mode 100644 tests/qemu-iotests/139
 create mode 100644 tests/qemu-iotests/139.out

-- 
2.6.1

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

end of thread, other threads:[~2015-10-31 19:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-23 12:03 [Qemu-devel] [PATCH v3 0/4] Add 'x-blockdev-del' command Alberto Garcia
2015-10-23 12:03 ` [Qemu-devel] [PATCH v3 1/4] mirror: block all operations on the target image during the job Alberto Garcia
2015-10-31 17:32   ` Max Reitz
2015-10-23 12:03 ` [Qemu-devel] [PATCH v3 2/4] block: Add blk_get_refcnt() Alberto Garcia
2015-10-23 12:03 ` [Qemu-devel] [PATCH v3 3/4] block: Add 'x-blockdev-del' QMP command Alberto Garcia
2015-10-31 18:01   ` Max Reitz
2015-10-23 12:03 ` [Qemu-devel] [PATCH v3 4/4] iotests: Add tests for the x-blockdev-del command Alberto Garcia
2015-10-31 19:28   ` Max Reitz

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).