thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-migration-omit-drive-ref-as-we-have-bdrv_ref-now.patch

9ae3a8
From 375004355689da9457ce5df62849d74cebd1c0c0 Mon Sep 17 00:00:00 2001
9ae3a8
From: Fam Zheng <famz@redhat.com>
9ae3a8
Date: Fri, 17 Jan 2014 03:07:49 +0100
9ae3a8
Subject: [PATCH 06/34] migration: omit drive ref as we have bdrv_ref now
9ae3a8
9ae3a8
RH-Author: Fam Zheng <famz@redhat.com>
9ae3a8
Message-id: <1389928083-8921-5-git-send-email-famz@redhat.com>
9ae3a8
Patchwork-id: 56766
9ae3a8
O-Subject: [RHEL-7 qemu-kvm PATCH 04/18] migration: omit drive ref as we have bdrv_ref now
9ae3a8
Bugzilla: 1041301
9ae3a8
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
9ae3a8
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
9ae3a8
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
9ae3a8
block-migration.c does not actually use DriveInfo anywhere.  Hence it's
9ae3a8
safe to drive ref code, we really only care about referencing BDS.
9ae3a8
9ae3a8
Signed-off-by: Fam Zheng <famz@redhat.com>
9ae3a8
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
(cherry picked from commit 8442cfd0346de849264494c5adedbac12553867e)
9ae3a8
Signed-off-by: Fam Zheng <famz@redhat.com>
9ae3a8
---
9ae3a8
 block-migration.c | 4 ++--
9ae3a8
 1 file changed, 2 insertions(+), 2 deletions(-)
9ae3a8
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 block-migration.c |    4 ++--
9ae3a8
 1 files changed, 2 insertions(+), 2 deletions(-)
9ae3a8
9ae3a8
diff --git a/block-migration.c b/block-migration.c
9ae3a8
index 1844066..fc4ef93 100644
9ae3a8
--- a/block-migration.c
9ae3a8
+++ b/block-migration.c
9ae3a8
@@ -336,8 +336,8 @@ static void init_blk_migration_it(void *opaque, BlockDriverState *bs)
9ae3a8
         bmds->completed_sectors = 0;
9ae3a8
         bmds->shared_base = block_mig_state.shared_base;
9ae3a8
         alloc_aio_bitmap(bmds);
9ae3a8
-        drive_get_ref(drive_get_by_blockdev(bs));
9ae3a8
         bdrv_set_in_use(bs, 1);
9ae3a8
+        bdrv_ref(bs);
9ae3a8
 
9ae3a8
         block_mig_state.total_sector_sum += sectors;
9ae3a8
 
9ae3a8
@@ -575,7 +575,7 @@ static void blk_mig_cleanup(void)
9ae3a8
     while ((bmds = QSIMPLEQ_FIRST(&block_mig_state.bmds_list)) != NULL) {
9ae3a8
         QSIMPLEQ_REMOVE_HEAD(&block_mig_state.bmds_list, entry);
9ae3a8
         bdrv_set_in_use(bmds->bs, 0);
9ae3a8
-        drive_put_ref(drive_get_by_blockdev(bmds->bs));
9ae3a8
+        bdrv_unref(bmds->bs);
9ae3a8
         g_free(bmds->aio_bitmap);
9ae3a8
         g_free(bmds);
9ae3a8
     }
9ae3a8
-- 
9ae3a8
1.7.1
9ae3a8