[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 12/14] block-migration: add reference to target Driv
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 12/14] block-migration: add reference to target DriveInfo |
Date: |
Mon, 7 Feb 2011 13:40:28 +0100 |
From: Marcelo Tosatti <address@hidden>
So that ejection of attached device by guest does not free data
in use by block migration instance.
Signed-off-by: Marcelo Tosatti <address@hidden>
CC: Markus Armbruster <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block-migration.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/block-migration.c b/block-migration.c
index 483ca7b..323e1e2 100644
--- a/block-migration.c
+++ b/block-migration.c
@@ -19,6 +19,7 @@
#include "monitor.h"
#include "block-migration.h"
#include "migration.h"
+#include "blockdev.h"
#include <assert.h>
#define BLOCK_SIZE (BDRV_SECTORS_PER_DIRTY_CHUNK << BDRV_SECTOR_BITS)
@@ -299,6 +300,7 @@ static void init_blk_migration_it(void *opaque,
BlockDriverState *bs)
bmds->completed_sectors = 0;
bmds->shared_base = block_mig_state.shared_base;
alloc_aio_bitmap(bmds);
+ drive_get_ref(drive_get_by_blockdev(bs));
block_mig_state.total_sector_sum += sectors;
@@ -537,6 +539,7 @@ static void blk_mig_cleanup(Monitor *mon)
while ((bmds = QSIMPLEQ_FIRST(&block_mig_state.bmds_list)) != NULL) {
QSIMPLEQ_REMOVE_HEAD(&block_mig_state.bmds_list, entry);
+ drive_put_ref(drive_get_by_blockdev(bmds->bs));
qemu_free(bmds->aio_bitmap);
qemu_free(bmds);
}
--
1.7.2.3
- [Qemu-devel] [PATCH 03/14] block/vdi: Fix wrong size in conditionally used memset, memcmp, (continued)
- [Qemu-devel] [PATCH 03/14] block/vdi: Fix wrong size in conditionally used memset, memcmp, Kevin Wolf, 2011/02/07
- [Qemu-devel] [PATCH 05/14] ahci: add license header in ahci.h, Kevin Wolf, 2011/02/07
- [Qemu-devel] [PATCH 07/14] ahci: send init d2h fis on fis enable, Kevin Wolf, 2011/02/07
- [Qemu-devel] [PATCH 04/14] ahci: split ICH9 from core, Kevin Wolf, 2011/02/07
- [Qemu-devel] [PATCH 06/14] ahci: split ICH and AHCI even more, Kevin Wolf, 2011/02/07
- [Qemu-devel] [PATCH 08/14] ahci: Implement HBA reset, Kevin Wolf, 2011/02/07
- [Qemu-devel] [PATCH 09/14] ahci: make number of ports runtime determined, Kevin Wolf, 2011/02/07
- [Qemu-devel] [PATCH 10/14] block-migration: actually disable dirty tracking on cleanup, Kevin Wolf, 2011/02/07
- [Qemu-devel] [PATCH 11/14] blockdev: add refcount to DriveInfo, Kevin Wolf, 2011/02/07
- [Qemu-devel] [PATCH 13/14] Add flag to indicate external users to block device, Kevin Wolf, 2011/02/07
- [Qemu-devel] [PATCH 12/14] block-migration: add reference to target DriveInfo,
Kevin Wolf <=
- [Qemu-devel] [PATCH 14/14] block: enable in_use flag, Kevin Wolf, 2011/02/07
- [Qemu-devel] Re: [PULL 00/14] Block patches for master, Anthony Liguori, 2011/02/07