cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

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

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