On 16.09.2014 20:12, Markus Armbruster wrote:
device_name[] can become non-empty only in bdrv_new_root() and
bdrv_move_feature_fields().  The latter is used only to undo damage
done by bdrv_swap().  The former is called only by blk_new_with_bs().
Therefore, when a BlockDriverState's device_name[] is non-empty, then
it's been created with a BlockBackend, and vice versa.  Furthermore,
blk_new_with_bs() keeps the two names equal.

Therefore, device_name[] is redundant.  Eliminate it.

Signed-off-by: Markus Armbruster <arm...@redhat.com>
---
  block-migration.c         | 12 ++++----
  block.c                   | 70 ++++++++++++++++++++---------------------------
  block/block-backend.c     | 14 ++++++----
  block/cow.c               |  2 +-
  block/mirror.c            |  3 +-
  block/qapi.c              |  6 ++--
  block/qcow.c              |  4 +--
  block/qcow2.c             |  4 +--
  block/qed.c               |  2 +-
  block/quorum.c            |  4 +--
  block/vdi.c               |  2 +-
  block/vhdx.c              |  2 +-
  block/vmdk.c              |  4 +--
  block/vpc.c               |  2 +-
  block/vvfat.c             |  2 +-
  blockjob.c                |  3 +-
  include/block/block.h     |  4 +--
  include/block/block_int.h |  2 --
  18 files changed, 67 insertions(+), 75 deletions(-)

Reviewed-by: Max Reitz <mre...@redhat.com>

Reply via email to