[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] qed: make qed_alloc_clusters round up offset to nea
From: |
Devin Nakamura |
Subject: |
[Qemu-devel] [PATCH] qed: make qed_alloc_clusters round up offset to nearest cluster |
Date: |
Tue, 16 Aug 2011 14:03:40 -0400 |
On Tue, Aug 16, 2011 at 12:22 PM, Stefan Hajnoczi <address@hidden> wrote:
> On Mon, Aug 15, 2011 at 07:16:10PM -0400, Devin Nakamura wrote:
>> @@ -263,6 +263,8 @@ static int qed_read_string(BlockDriverState *file,
>> uint64_t offset, size_t n,
>> */
>> static uint64_t qed_alloc_clusters(BDRVQEDState *s, unsigned int n)
>> {
>> + s->file_size = qed_start_of_cluster(s, s->file_size +
>> + s->header.cluster_size - 1);
>
> Why do you need this? QED cluster aligns the file size on open.
> file_size should always be cluster-aligned.
>
> Stefan
>
I was running into problems when I was doing in-place conversion from
qcow2. But I suppose I could cluster align the file offset when I open
the conversion target. I just seemed this way was safer.