Skip to contentSkip to conversation

qmp: add interface query-images.

PATCH Wenchao Xia 5 participants 9 messages Mar 4, 2013 – Mar 5, 2013 10 messages not in the archive

lore
Share & tools
lore
#4 lore raw
In reply to a message not in the archive
Quoted 18 lines
Quoted 8 lines

Review

Quoted 5 lines
   
   ##
(quoted diff) +3 -0
+# @query-images:
+#
+# Get a list of DeviceImageInfo for all virtual block devices.

# Get block device image information

OK.

Quoted 8 lines

Review

Quoted 5 lines
(quoted diff) +5 -0
+#
+# @device: #optional the name of the device to get image info from. If not
+#          specified, all block devices will be queried
+# @backing: #optional true to show information on backing images, false or
+#          omitted to show just the top image of a block device

I'm not sure these flags are necessary.

Quoted 4 lines

These flag seems more flex to me. Always querying all info require
caller do a filter operation on what he got, but in many times caller may be interested on only one device.

Coding for next version, I still feel flag may bring flexbility.
Markus, are u OK with this?

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
(quoted diff) +9 -0
+#
+# Returns: a list of @DeviceImageInfo describing each virtual block device
+#
+# Since: 1.5
+##
+{ 'command': 'query-images',
+  'data': { '*device': 'str', '*backing': 'bool' },
+  'returns': ['DeviceImageInfo'] }
+
Signature · 3 lines
Best Regards

Wenchao Xia
#9 lore raw

Re: [Qemu-devel] [PATCH V7 09/14] block: move bdrv_snapshot_find() to block.c

In reply to a message not in the archive
Quoted 18 lines · Wenchao Xia
Quoted 17 lines · Kevin Wolf

Am 27.02.2013 um 17:04 hat Markus Armbruster geschrieben:

Quoted 15 lines
Quoted 7 lines · Wenchao Xia
---
  block.c               |   24 ++++++++++++++++++++++++
  include/block/block.h |    2 ++
  savevm.c              |   22 ----------------------
  3 files changed, 26 insertions(+), 22 deletions(-)

Perhaps savevm.c isn't the best home for snapshot stuff, but I don't like it in block.c any better. block.c is already unwieldy, and I'd like us to try limiting it to core block stuff.

Kevin, Stefan, any ideas?

Quoted 9 lines
Quoted 5 lines

Take some more snapshot related functions from block.c and move them to block/snapshot.c?

Kevin

Hi, Stefan
Do you also agree about adding new file block/snapshot.c?

Hi,
I am going to add include/block/snapshot.h and block/snapshot.c,
all internal snapshot function in block.c will be moved there. external backing file related function will not be touched and remain in block.c. This consume many effort and once done it will be hard to revert back to form an incremental commit in this serials, so before coding, please give your opinion if u don't agree about it.

Signature · 3 lines
Best Regards

Wenchao Xia
#10 lore raw

Re: [Qemu-devel] [PATCH V7 09/14] block: move bdrv_snapshot_find() to block.c

In reply to a message not in the archive
Quoted 17 lines · Kevin Wolf
Quoted 17 lines

Am 27.02.2013 um 17:04 hat Markus Armbruster geschrieben:

Quoted 15 lines
Quoted 7 lines · Wenchao Xia
---
 block.c               |   24 ++++++++++++++++++++++++
 include/block/block.h |    2 ++
 savevm.c              |   22 ----------------------
 3 files changed, 26 insertions(+), 22 deletions(-)

Perhaps savevm.c isn't the best home for snapshot stuff, but I don't like it in block.c any better. block.c is already unwieldy, and I'd like us to try limiting it to core block stuff.

Kevin, Stefan, any ideas?

Quoted 7 lines
Quoted 5 lines

Take some more snapshot related functions from block.c and move them to block/snapshot.c?

Kevin

Hi, Stefan
Do you also agree about adding new file block/snapshot.c?

Yes, I agree.

Stefan

#17 lore raw

Re: [Qemu-devel] [PATCH V7 00/14] add qmp/hmp interfaces for internal snapshot info

In reply to a message not in the archive
Quoted 23 lines · Wenchao Xia
Quoted 22 lines · Stefan Hajnoczi
Quoted 20 lines · Wenchao Xia

This serial of patches does two things: merge some info code
in qemu-img, and add following interfaces:
1) qmp: query-images
2) qmp: query-snapshots
3) hmp: show internal snapshot info on a single block device These patches follows the rule that use qmp to retieve information,
hmp layer just do a translation from qmp object it got, so almost every hmp interface may have a correlated qmp interface.
To make code graceful, snapshot retrieving code in qemu and qemu-img
are merged into block.c, and some function name was adjusted to make it tips better. Now it works as:

qemu qemu-img

dump_monitor dump_stdout

     |--------------|
            |
           qmp
            |
          block
Quoted 7 lines
Quoted 6 lines

This summary does not explain how the new commands relate to query-block or why they are necessary.

It is also useful to include QMP examples or the QMP docs in the cover letter so reviewers know what you are trying to achieve.

OK, a better explaination would be added in the cover-letter.

Thanks. When reviewers don't know your goal at the start of their review, they may object to things that make sense at the end of the series because they do not have enough context yet. A series where the goal is unclear also risks a higher number of review-fix cycles because the reviewers haven't bought into the idea yet.

It is in everyone's interest to explain the goal in the cover letter. Then the patches get reviewed more smoothly and merged faster.

This is a general thought I wanted to share and I struggle with it myself sometimes when I submit patch series.

Stefan

#18 lore raw

Re: [Qemu-devel] [PATCH V7 00/14] add qmp/hmp interfaces for internal snapshot info

Quoted 5 lines · Stefan Hajnoczi
Quoted 4 lines
Quoted 3 lines

It is also useful to include QMP examples or the QMP docs in the cover letter so reviewers know what you are trying to achieve.

OK, a better explaination would be added in the cover-letter.

Quoted 8 lines

Thanks. When reviewers don't know your goal at the start of their review, they may object to things that make sense at the end of the series because they do not have enough context yet. A series where the goal is unclear also risks a higher number of review-fix cycles because the reviewers haven't bought into the idea yet.

It is in everyone's interest to explain the goal in the cover letter. Then the patches get reviewed more smoothly and merged faster.

This is good advice - so good that I added it to the wiki:
http://wiki.qemu.org/Contribute/SubmitAPatch

Quoted 3 lines

This is a general thought I wanted to share and I struggle with it myself sometimes when I submit patch series.

Me too - but the nice thing about open source is that we can all learn best practices from one another and become better at it :)

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#11 lore raw

Re: [Qemu-devel] [PATCH V7 09/14] block: move bdrv_snapshot_find() to block.c

In reply to Stefan Hajnoczi
Quoted 21 lines · Stefan Hajnoczi
Quoted 20 lines · Kevin Wolf
Quoted 20 lines

Am 27.02.2013 um 17:04 hat Markus Armbruster geschrieben:

Quoted 10 lines
Quoted 7 lines · Wenchao Xia
---
  block.c               |   24 ++++++++++++++++++++++++
  include/block/block.h |    2 ++
  savevm.c              |   22 ----------------------
  3 files changed, 26 insertions(+), 22 deletions(-)
Quoted 5 lines

Perhaps savevm.c isn't the best home for snapshot stuff, but I don't like it in block.c any better. block.c is already unwieldy, and I'd like us to try limiting it to core block stuff.

Kevin, Stefan, any ideas?

Take some more snapshot related functions from block.c and move them to block/snapshot.c?

Quoted 9 lines
Quoted 4 lines
Quoted 2 lines

Kevin

Hi, Stefan
Do you also agree about adding new file block/snapshot.c?

Yes, I agree.

Stefan

great. Also there are some other functions such as image info collecting, do you think new file block/misc.c is suitable to store those functions there?

Signature · 3 lines
Best Regards

Wenchao Xia
#12 lore raw

Re: [Qemu-devel] [PATCH V7 09/14] block: move bdrv_snapshot_find() to block.c

Quoted 27 lines · Wenchao Xia
Quoted 26 lines · Stefan Hajnoczi
Quoted 24 lines · Kevin Wolf
Quoted 15 lines

Am 27.02.2013 um 17:04 hat Markus Armbruster geschrieben:

Quoted 14 lines
Quoted 7 lines · Wenchao Xia
---
 block.c               |   24 ++++++++++++++++++++++++
 include/block/block.h |    2 ++
 savevm.c              |   22 ----------------------
 3 files changed, 26 insertions(+), 22 deletions(-)

Perhaps savevm.c isn't the best home for snapshot stuff, but I don't like it in block.c any better. block.c is already unwieldy, and I'd like us to try limiting it to core block stuff.

Quoted 7 lines
Quoted 1 line

Kevin, Stefan, any ideas?

Take some more snapshot related functions from block.c and move them to block/snapshot.c?

Kevin

Hi, Stefan
Do you also agree about adding new file block/snapshot.c?

Quoted 7 lines
Quoted 4 lines

Yes, I agree.

Stefan

great. Also there are some other functions such as image info collecting, do you think new file block/misc.c is suitable to store those functions there?

As discussed on IRC, it's fine by me. If a better way to organize these functions becomes clear in the future they can be moved.

Stefan

#13 lore raw

Re: [Qemu-devel] [PATCH V7 09/14] block: move bdrv_snapshot_find() to block.c

Am 05.03.2013 um 10:21 hat Stefan Hajnoczi geschrieben:

Quoted 8 lines · Wenchao Xia
Quoted 7 lines
Quoted 6 lines · Stefan Hajnoczi
Quoted 2 lines · Kevin Wolf

Hi, Stefan
Do you also agree about adding new file block/snapshot.c?

Yes, I agree.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Stefan

great. Also there are some other functions such as image info collecting, do you think new file block/misc.c is suitable to store those functions there?

As discussed on IRC, it's fine by me. If a better way to organize these functions becomes clear in the future they can be moved.

As also discussed on IRC, I'm not excited by having a block/misc.c. We already have something for "everything block related that doesn't fit elsewhere" and it's block.c. I couldn't tell if a function belong into block.c or block/misc.c.

I suggested having a file that concentrates all function related to QAPI, the monitor and JSON (including the qemu-img JSON output) and call it something like block/qapi.c (I'm open for better suggestions). This would at least make it clear if a function should be in there or not.

Kevin

#14 lore raw

Re: [Qemu-devel] [PATCH V7 09/14] block: move bdrv_snapshot_find() to block.c

Il 05/03/2013 11:08, Kevin Wolf ha scritto:

Quoted 8 lines
Quoted 3 lines
Quoted 3 lines

As discussed on IRC, it's fine by me. If a better way to organize these functions becomes clear in the future they can be moved.

As also discussed on IRC, I'm not excited by having a block/misc.c. We already have something for "everything block related that doesn't fit elsewhere" and it's block.c. I couldn't tell if a function belong into block.c or block/misc.c.

Quoted 4 lines

I suggested having a file that concentrates all function related to QAPI, the monitor and JSON (including the qemu-img JSON output) and call it something like block/qapi.c (I'm open for better suggestions). This would at least make it clear if a function should be in there or not.

I agree with Kevin.

Paolo