summaryrefslogtreecommitdiff
path: root/block-migration.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2014-10-07 13:59:11 +0200
committerKevin Wolf <kwolf@redhat.com>2014-10-20 13:41:26 +0200
commitbfb197e0d998bea8741c65492b2b42f443729249 (patch)
treec7b9a48dc7dd7790d678a7a13f5ba245931876ad /block-migration.c
parentfea68bb6e9fa65c7cc6caa6adda810d1d0fdbde4 (diff)
downloadqemu-bfb197e0d998bea8741c65492b2b42f443729249.tar.gz
block: Eliminate BlockDriverState member device_name[]
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 <armbru@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block-migration.c')
-rw-r--r--block-migration.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/block-migration.c b/block-migration.c
index cb3e16c9d9..da30e93158 100644
--- a/block-migration.c
+++ b/block-migration.c
@@ -14,7 +14,9 @@
*/
#include "qemu-common.h"
-#include "block/block_int.h"
+#include "block/block.h"
+#include "qemu/error-report.h"
+#include "qemu/main-loop.h"
#include "hw/hw.h"
#include "qemu/queue.h"
#include "qemu/timer.h"
@@ -130,9 +132,9 @@ static void blk_send(QEMUFile *f, BlkMigBlock * blk)
| flags);
/* device name */
- len = strlen(blk->bmds->bs->device_name);
+ len = strlen(bdrv_get_device_name(blk->bmds->bs));
qemu_put_byte(f, len);
- qemu_put_buffer(f, (uint8_t *)blk->bmds->bs->device_name, len);
+ qemu_put_buffer(f, (uint8_t *)bdrv_get_device_name(blk->bmds->bs), len);
/* if a block is zero we need to flush here since the network
* bandwidth is now a lot higher than the storage device bandwidth.
@@ -382,9 +384,9 @@ static void init_blk_migration(QEMUFile *f)
if (bmds->shared_base) {
DPRINTF("Start migration for %s with shared base image\n",
- bs->device_name);
+ bdrv_get_device_name(bs));
} else {
- DPRINTF("Start full migration for %s\n", bs->device_name);
+ DPRINTF("Start full migration for %s\n", bdrv_get_device_name(bs));
}
QSIMPLEQ_INSERT_TAIL(&block_mig_state.bmds_list, bmds, entry);