[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 02/13] block migration: Fix test for read-only dr
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PATCH v2 02/13] block migration: Fix test for read-only drive |
Date: |
Tue, 6 Jul 2010 14:08:45 +0200 |
init_blk_migration_it() skips drives with type hint BDRV_TYPE_CDROM.
The intention is to skip read-only drives. However, BDRV_TYPE_CDROM
is only a hint. It is currently sufficent for read-only. But it's
not necessary, and it may not remain sufficient.
Use bdrv_is_read_only() instead.
Signed-off-by: Markus Armbruster <address@hidden>
---
block-migration.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/block-migration.c b/block-migration.c
index 7d04d6d..7337349 100644
--- a/block-migration.c
+++ b/block-migration.c
@@ -236,7 +236,7 @@ static void init_blk_migration_it(void *opaque,
BlockDriverState *bs)
BlkMigDevState *bmds;
int64_t sectors;
- if (bs->type == BDRV_TYPE_HD) {
+ if (!bdrv_is_read_only(bs)) {
sectors = bdrv_getlength(bs) >> BDRV_SECTOR_BITS;
if (sectors == 0) {
return;
--
1.6.6.1
- [Qemu-devel] [PATCH v2 07/13] error: New qemu_opts_loc_restore(), (continued)
- [Qemu-devel] [PATCH v2 07/13] error: New qemu_opts_loc_restore(), Markus Armbruster, 2010/07/06
- [Qemu-devel] [PATCH v2 09/13] ide: Improve error messages, Markus Armbruster, 2010/07/06
- [Qemu-devel] [PATCH v2 04/13] fdc: Reject unimplemented error actions, Markus Armbruster, 2010/07/06
- [Qemu-devel] [PATCH v2 05/13] qdev: Don't hw_error() in qdev_init_nofail(), Markus Armbruster, 2010/07/06
- [Qemu-devel] [PATCH v2 01/13] blockdev: Clean up how readonly persists across virtual media change, Markus Armbruster, 2010/07/06
- [Qemu-devel] [PATCH v2 02/13] block migration: Fix test for read-only drive,
Markus Armbruster <=
- [Qemu-devel] [PATCH v2 03/13] raw-posix: Fix test for host CD-ROM, Markus Armbruster, 2010/07/06
- [Qemu-devel] [PATCH v2 06/13] scsi: Reject unimplemented error actions, Markus Armbruster, 2010/07/06
- [Qemu-devel] Re: [PATCH v2 00/13] Still more block related fixes and cleanups, Kevin Wolf, 2010/07/06