[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/6] libqblock APIs
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 1/6] libqblock APIs |
Date: |
Tue, 04 Sep 2012 09:29:54 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 |
Il 04/09/2012 09:05, Wenchao Xia ha scritto:
>> That said, QEMU's internal bdrv_is_allocated function does have one not
>> entirely appealing property: the block at start + *pnum might have the
>> same state as the block at start + *pnum - 1, even if *pnum < length.
>> We may want to work around this in libqblock, but we could also simply
>> document it.
>>
>> Paolo
>>
> int bdrv_is_allocated(BlockDriverState *bs, int64_t sector_num,
> int nb_sectors,int *pnum)
> will the issue happen when nb_sectors > *pnum? if so it seems a bug,
> because caller is asking a range of sectors's allocation status, and
> *pnum did not reflect the real status.
Actually it does.
bdrv_is_allocated says it didn't find out anything about sector start +
*pnum and later.
>>> Either way, I think you are supplying too
>>> many parameters for how I envision checking for allocated sectors.
>>
> yes, it is a bit confusing, how about:
>
> int qb_check_allocate_status(struct QBroker *broker,
> struct QBlockState *qbs,
> offset sector_start,
> size_t sector_number,
> size_t *pnum,
> int *status)
> user input sector_start and sector_number to ask check it in this range,
> following parameter receive the status, return indicate exception.
That's ok too.
But do not use size_t for sectors. Testing, or reading, or writing 2 TB
with a single call is more than enough.
Paolo
- [Qemu-devel] [PATCH 0/6] libqblock, qemu block layer library, Wenchao Xia, 2012/09/03
- Re: [Qemu-devel] [PATCH 1/6] libqblock APIs, Eric Blake, 2012/09/03
- Re: [Qemu-devel] [PATCH 1/6] libqblock APIs, Wenchao Xia, 2012/09/04
- Re: [Qemu-devel] [PATCH 1/6] libqblock APIs, Eric Blake, 2012/09/04
- Re: [Qemu-devel] [PATCH 1/6] libqblock APIs, Paolo Bonzini, 2012/09/04
Re: [Qemu-devel] [PATCH 1/6] libqblock APIs, Blue Swirl, 2012/09/03
[Qemu-devel] [PATCH 3/6] libqblock error handling, Wenchao Xia, 2012/09/03
[Qemu-devel] [PATCH 5/6] libqblock test example, Wenchao Xia, 2012/09/03