[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH 16/17] qemu-io: fix the alloc command
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [RFC PATCH 16/17] qemu-io: fix the alloc command |
Date: |
Thu, 8 Mar 2012 18:15:16 +0100 |
Signed-off-by: Paolo Bonzini <address@hidden>
---
qemu-io.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/qemu-io.c b/qemu-io.c
index bb5f7b8..c1bc053 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -1513,7 +1513,7 @@ out:
static int alloc_f(int argc, char **argv)
{
- int64_t offset;
+ int64_t offset, sector_num;
int nb_sectors, remaining;
char s1[64];
int num, sum_alloc;
@@ -1534,8 +1534,10 @@ static int alloc_f(int argc, char **argv)
remaining = nb_sectors;
sum_alloc = 0;
+ sector_num = offset >> 9;
while (remaining) {
- ret = bdrv_is_allocated(bs, offset >> 9, nb_sectors, &num);
+ ret = bdrv_is_allocated(bs, sector_num, remaining, &num);
+ sector_num += num;
remaining -= num;
if (ret) {
sum_alloc += num;
--
1.7.7.6
- Re: [Qemu-devel] [RFC PATCH 04/17] qed: implement bdrv_aio_discard, (continued)
- [Qemu-devel] [RFC PATCH 10/17] ide/scsi: add discard_zeroes_data property, Paolo Bonzini, 2012/03/08
- [Qemu-devel] [RFC PATCH 09/17] ide: issue discard asynchronously but serialize the pieces, Paolo Bonzini, 2012/03/08
- [Qemu-devel] [RFC PATCH 05/17] block: pass around qiov for write_zeroes operation, Paolo Bonzini, 2012/03/08
- [Qemu-devel] [RFC PATCH 12/17] ide/scsi: turn on discard, Paolo Bonzini, 2012/03/08
- [Qemu-devel] [RFC PATCH 01/17] qemu-iotests: add a simple test for write_zeroes, Paolo Bonzini, 2012/03/08
- [Qemu-devel] [RFC PATCH 11/17] ide/scsi: prepare for flipping the discard defaults, Paolo Bonzini, 2012/03/08
- [Qemu-devel] [RFC PATCH 16/17] qemu-io: fix the alloc command,
Paolo Bonzini <=
- [Qemu-devel] [RFC PATCH 07/17] block: make high level discard operation always zero, Paolo Bonzini, 2012/03/08
[Qemu-devel] [RFC PATCH 08/17] block: kill the write zeroes operation, Paolo Bonzini, 2012/03/08
[Qemu-devel] [RFC PATCH 15/17] raw: add get_info, Paolo Bonzini, 2012/03/08
[Qemu-devel] [RFC PATCH 14/17] block: support FALLOC_FL_PUNCH_HOLE trimming, Paolo Bonzini, 2012/03/08