From: Marcelo Tosatti <mtosatti@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Markus Armbruster <armbru@redhat.com>
Subject: [Qemu-devel] [patch 3/5] block-migration: add reference to target DriveInfo
Date: Wed, 26 Jan 2011 12:12:33 -0200 [thread overview]
Message-ID: <20110126141348.270390844@redhat.com> (raw)
In-Reply-To: 20110126141230.637895847@redhat.com
[-- Attachment #1: 02-block-migration-use-drive-ref --]
[-- Type: text/plain, Size: 1196 bytes --]
So that ejection of attached device by guest does not free data
in use by block migration instance.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
CC: Markus Armbruster <armbru@redhat.com>
Index: qemu/block-migration.c
===================================================================
--- qemu.orig/block-migration.c
+++ qemu/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 *
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;
@@ -532,6 +534,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);
}
next prev parent reply other threads:[~2011-01-26 14:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-26 14:12 [Qemu-devel] [patch 0/5] block migration interaction fixes Marcelo Tosatti
2011-01-26 14:12 ` [Qemu-devel] [patch 1/5] block-migration: actually disable dirty tracking on cleanup Marcelo Tosatti
2011-01-26 14:12 ` [Qemu-devel] [patch 2/5] blockdev: add refcount to DriveInfo Marcelo Tosatti
2011-01-26 14:12 ` Marcelo Tosatti [this message]
2011-01-26 14:12 ` [Qemu-devel] [patch 4/5] Add flag to indicate external users to block device Marcelo Tosatti
2011-01-26 14:12 ` [Qemu-devel] [patch 5/5] block: enable in_use flag Marcelo Tosatti
2011-02-07 11:27 ` [Qemu-devel] Re: [patch 0/5] block migration interaction fixes Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110126141348.270390844@redhat.com \
--to=mtosatti@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).