]> git.proxmox.com Git - mirror_qemu.git/blobdiff - block/mirror.c
block: Convert bs->backing_hd to BdrvChild
[mirror_qemu.git] / block / mirror.c
index 1ca4aa0da000da7c8d9f46d80ff68e7bb700d3bc..5d3b8bbd9c7a74c4a27b6e72a4c75ca8513f3eba 100644 (file)
@@ -371,7 +371,7 @@ static void mirror_exit(BlockJob *job, void *opaque)
         if (s->common.driver->job_type == BLOCK_JOB_TYPE_COMMIT) {
             /* drop the bs loop chain formed by the swap: break the loop then
              * trigger the unref from the top one */
-            BlockDriverState *p = s->base->backing_hd;
+            BlockDriverState *p = backing_bs(s->base);
             bdrv_set_backing_hd(s->base, NULL);
             bdrv_unref(p);
         }
@@ -431,7 +431,7 @@ static void coroutine_fn mirror_run(void *opaque)
      */
     bdrv_get_backing_filename(s->target, backing_filename,
                               sizeof(backing_filename));
-    if (backing_filename[0] && !s->target->backing_hd) {
+    if (backing_filename[0] && !s->target->backing) {
         ret = bdrv_get_info(s->target, &bdi);
         if (ret < 0) {
             goto immediate_exit;
@@ -766,7 +766,7 @@ void mirror_start(BlockDriverState *bs, BlockDriverState *target,
         return;
     }
     is_none_mode = mode == MIRROR_SYNC_MODE_NONE;
-    base = mode == MIRROR_SYNC_MODE_TOP ? bs->backing_hd : NULL;
+    base = mode == MIRROR_SYNC_MODE_TOP ? backing_bs(bs) : NULL;
     mirror_start_job(bs, target, replaces,
                      speed, granularity, buf_size,
                      on_source_error, on_target_error, unmap, cb, opaque, errp,