qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3 0/3] Add bdrv_get_device_or_node_name()
@ 2015-03-20 14:33 Alberto Garcia
  2015-03-20 14:33 ` [Qemu-devel] [PATCH 1/3] block: add bdrv_get_device_or_node_name() Alberto Garcia
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Alberto Garcia @ 2015-03-20 14:33 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Alberto Garcia, Markus Armbruster, Max Reitz,
	Stefan Hajnoczi

One more try.

v3:
- The node-name field in BLOCK_IMAGE_CORRUPTED is now Since: 2.4
- Remove the QERR_ macros instead of updating them. The text message
  is adapted to each case where applicable, and 'device' is renamed to
  'node' only where it makes sense.

v2:
- bdrv_get_device_or_node_name() includes a comment explaining its
  usage.
- The error messages have been updated to say 'node' instead of
  'device' where appropriate.
- The BLOCK_IMAGE_CORRUPTED event has a new 'node-name' field.

Regards,

Berto

Alberto Garcia (3):
  block: add bdrv_get_device_or_node_name()
  block: use bdrv_get_device_or_node_name() in error messages
  block: add 'node-name' field to BLOCK_IMAGE_CORRUPTED

 block.c                   | 33 +++++++++++++++++++++------------
 block/qcow.c              |  8 ++++----
 block/qcow2.c             | 10 +++++++---
 block/qed.c               |  2 +-
 block/quorum.c            |  5 +----
 block/snapshot.c          | 12 ++++++------
 block/vdi.c               |  6 +++---
 block/vhdx.c              |  6 +++---
 block/vmdk.c              |  8 ++++----
 block/vpc.c               |  6 +++---
 block/vvfat.c             |  7 ++++---
 blockdev.c                |  9 +++++----
 docs/qmp/qmp-events.txt   | 16 +++++++++-------
 include/block/block.h     |  1 +
 include/qapi/qmp/qerror.h |  6 ------
 qapi/block-core.json      | 13 ++++++++-----
 16 files changed, 80 insertions(+), 68 deletions(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 19+ messages in thread
* [Qemu-devel] [PATCH v4 0/3] Add bdrv_get_device_or_node_name()
@ 2015-04-08  9:29 Alberto Garcia
  2015-04-08  9:29 ` [Qemu-devel] [PATCH 2/3] block: use bdrv_get_device_or_node_name() in error messages Alberto Garcia
  0 siblings, 1 reply; 19+ messages in thread
From: Alberto Garcia @ 2015-04-08  9:29 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Alberto Garcia, qemu-block, Markus Armbruster,
	Max Reitz, Stefan Hajnoczi

This series contains a couple of minor changes suggested by Markus in
the previous one. I removed the Reviewed-by line by Max in the
modified patch even if the changes are small, hope that's ok.

v4:
- Fix documentation of the 'node-name' field in BLOCK_IMAGE_CORRUPTED.
  Its annotation is now (json-string, optional).
- Clarify that the 'device' field can be empty even if it's always
  present for compatibility reasons.

v3:
- The node-name field in BLOCK_IMAGE_CORRUPTED is now Since: 2.4
- Remove the QERR_ macros instead of updating them. The text message
  is adapted to each case where applicable, and 'device' is renamed to
  'node' only where it makes sense.

v2:
- bdrv_get_device_or_node_name() includes a comment explaining its
  usage.
- The error messages have been updated to say 'node' instead of
  'device' where appropriate.
- The BLOCK_IMAGE_CORRUPTED event has a new 'node-name' field.

Regards,

Berto

Alberto Garcia (3):
  block: add bdrv_get_device_or_node_name()
  block: use bdrv_get_device_or_node_name() in error messages
  block: add 'node-name' field to BLOCK_IMAGE_CORRUPTED

 block.c                   | 33 +++++++++++++++++++++------------
 block/qcow.c              |  8 ++++----
 block/qcow2.c             | 10 +++++++---
 block/qed.c               |  2 +-
 block/quorum.c            |  5 +----
 block/snapshot.c          | 12 ++++++------
 block/vdi.c               |  6 +++---
 block/vhdx.c              |  6 +++---
 block/vmdk.c              |  8 ++++----
 block/vpc.c               |  6 +++---
 block/vvfat.c             |  7 ++++---
 blockdev.c                |  9 +++++----
 docs/qmp/qmp-events.txt   | 21 +++++++++++++--------
 include/block/block.h     |  1 +
 include/qapi/qmp/qerror.h |  6 ------
 qapi/block-core.json      | 17 +++++++++++------
 16 files changed, 87 insertions(+), 70 deletions(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 19+ messages in thread
* [Qemu-devel] [PATCH v2 0/3] Add bdrv_get_device_or_node_name()
@ 2015-03-20 10:19 Alberto Garcia
  2015-03-20 10:19 ` [Qemu-devel] [PATCH 2/3] block: use bdrv_get_device_or_node_name() in error messages Alberto Garcia
  0 siblings, 1 reply; 19+ messages in thread
From: Alberto Garcia @ 2015-03-20 10:19 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Alberto Garcia, Markus Armbruster, Max Reitz,
	Stefan Hajnoczi

Second version of the series.

v2:
- bdrv_get_device_or_node_name() includes a comment explaining its
  usage.
- The error messages have been updated to say 'node' instead of
  'device' where appropriate.
- The BLOCK_IMAGE_CORRUPTED event has a new 'node-name' field.

Regards,

Berto

Alberto Garcia (3):
  block: add bdrv_get_device_or_node_name()
  block: use bdrv_get_device_or_node_name() in error messages
  block: add 'node-name' field to BLOCK_IMAGE_CORRUPTED

 block.c                   | 30 ++++++++++++++++++++----------
 block/qcow.c              |  4 ++--
 block/qcow2.c             | 10 +++++++---
 block/qed.c               |  2 +-
 block/quorum.c            |  5 +----
 block/vdi.c               |  2 +-
 block/vhdx.c              |  2 +-
 block/vmdk.c              |  4 ++--
 block/vpc.c               |  2 +-
 block/vvfat.c             |  3 ++-
 blockdev.c                |  4 ++--
 docs/qmp/qmp-events.txt   | 16 +++++++++-------
 include/block/block.h     |  1 +
 include/qapi/qmp/qerror.h |  8 ++++----
 qapi/block-core.json      | 13 ++++++++-----
 15 files changed, 62 insertions(+), 44 deletions(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 19+ messages in thread
* [Qemu-devel] [PATCH 0/3] Add bdrv_get_device_or_node_name()
@ 2015-03-19 15:43 Alberto Garcia
  2015-03-19 15:43 ` [Qemu-devel] [PATCH 2/3] block: use bdrv_get_device_or_node_name() in error messages Alberto Garcia
  0 siblings, 1 reply; 19+ messages in thread
From: Alberto Garcia @ 2015-03-19 15:43 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Alberto Garcia, Stefan Hajnoczi

We have several cases of error messages related to BlockDriverState that expect it to have a device name.

However many of those can happen in nodes that don't have a device name associated so the generated error messages are not very meaningful.

This series adds a new function bdrv_get_device_or_node_name(), that returns the node name if there is no device name for that node. Since both the device and the node name live in the same namespace, there's no ambiguity. And since it gives preference to the device name, it maintains backward compatibility.

It also updates all calls to bdrv_get_device_name() where it makes sense: several error messages and the BLOCK_IMAGE_CORRUPTED event.

I wrote this thinking on the case where any arbitrary node will be able to own a block job, but I think it's useful already for the reasons explained above.

Berto

Alberto Garcia (3):
  block: add bdrv_get_device_or_node_name()
  block: use bdrv_get_device_or_node_name() in error messages
  block: allow BLOCK_IMAGE_CORRUPTED to have a node name

 block.c                 | 18 ++++++++++++------
 block/qcow.c            |  4 ++--
 block/qcow2.c           |  7 ++++---
 block/qed.c             |  2 +-
 block/quorum.c          |  5 +----
 block/vdi.c             |  2 +-
 block/vhdx.c            |  2 +-
 block/vmdk.c            |  4 ++--
 block/vpc.c             |  2 +-
 block/vvfat.c           |  3 ++-
 docs/qmp/qmp-events.txt |  2 +-
 include/block/block.h   |  1 +
 qapi/block-core.json    |  2 +-
 13 files changed, 30 insertions(+), 24 deletions(-)

-- 
2.1.4

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

end of thread, other threads:[~2015-04-09  8:25 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-20 14:33 [Qemu-devel] [PATCH v3 0/3] Add bdrv_get_device_or_node_name() Alberto Garcia
2015-03-20 14:33 ` [Qemu-devel] [PATCH 1/3] block: add bdrv_get_device_or_node_name() Alberto Garcia
2015-03-20 19:11   ` Max Reitz
2015-03-20 14:33 ` [Qemu-devel] [PATCH 2/3] block: use bdrv_get_device_or_node_name() in error messages Alberto Garcia
2015-03-20 19:24   ` Max Reitz
2015-03-20 14:33 ` [Qemu-devel] [PATCH 3/3] block: add 'node-name' field to BLOCK_IMAGE_CORRUPTED Alberto Garcia
2015-03-20 19:26   ` Max Reitz
2015-03-23  9:20   ` Markus Armbruster
2015-03-23  9:53     ` Alberto Garcia
2015-03-23 11:55       ` Markus Armbruster
  -- strict thread matches above, loose matches on Subject: below --
2015-04-08  9:29 [Qemu-devel] [PATCH v4 0/3] Add bdrv_get_device_or_node_name() Alberto Garcia
2015-04-08  9:29 ` [Qemu-devel] [PATCH 2/3] block: use bdrv_get_device_or_node_name() in error messages Alberto Garcia
2015-04-08 16:27   ` Eric Blake
2015-04-09  8:25     ` Alberto Garcia
2015-03-20 10:19 [Qemu-devel] [PATCH v2 0/3] Add bdrv_get_device_or_node_name() Alberto Garcia
2015-03-20 10:19 ` [Qemu-devel] [PATCH 2/3] block: use bdrv_get_device_or_node_name() in error messages Alberto Garcia
2015-03-20 13:22   ` Max Reitz
2015-03-20 13:57     ` Markus Armbruster
2015-03-19 15:43 [Qemu-devel] [PATCH 0/3] Add bdrv_get_device_or_node_name() Alberto Garcia
2015-03-19 15:43 ` [Qemu-devel] [PATCH 2/3] block: use bdrv_get_device_or_node_name() in error messages Alberto Garcia
2015-03-19 19:37   ` Max Reitz
2015-03-20  7:52   ` Markus Armbruster

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