<feed xmlns='http://www.w3.org/2005/Atom'>
<title>bwlp/qemu.git/block/qcow2-cluster.c, branch spice_video_codecs</title>
<subtitle>Experimental fork of QEMU with video encoding patches</subtitle>
<id>https://git.openslx.org/bwlp/qemu.git/atom/block/qcow2-cluster.c?h=spice_video_codecs</id>
<link rel='self' href='https://git.openslx.org/bwlp/qemu.git/atom/block/qcow2-cluster.c?h=spice_video_codecs'/>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/'/>
<updated>2022-10-27T18:14:11+00:00</updated>
<entry>
<title>qcow2: switch to *_co_* functions</title>
<updated>2022-10-27T18:14:11+00:00</updated>
<author>
<name>Alberto Faria</name>
</author>
<published>2022-10-13T12:37:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=38505e2a147c4f9fade382ede4a40e287c7bd846'/>
<id>urn:sha1:38505e2a147c4f9fade382ede4a40e287c7bd846</id>
<content type='text'>
Signed-off-by: Alberto Faria &lt;afaria@redhat.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Message-Id: &lt;20221013123711.620631-20-pbonzini@redhat.com&gt;
Reviewed-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>qcow2: manually add more coroutine_fn annotations</title>
<updated>2022-10-27T18:14:11+00:00</updated>
<author>
<name>Paolo Bonzini</name>
</author>
<published>2022-10-13T12:36:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=a1b4ecfd6f4e7d8bfba3a3990150cb92577d92d4'/>
<id>urn:sha1:a1b4ecfd6f4e7d8bfba3a3990150cb92577d92d4</id>
<content type='text'>
The validity of these was double-checked with Alberto Faria's static
analyzer.

Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Message-Id: &lt;20221013123711.620631-13-pbonzini@redhat.com&gt;
Reviewed-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>qcow2: add missing coroutine_fn annotations</title>
<updated>2022-10-07T10:11:40+00:00</updated>
<author>
<name>Paolo Bonzini</name>
</author>
<published>2022-09-22T08:49:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=050ed2e7362c9086c07a86965ac754d1e46a7138'/>
<id>urn:sha1:050ed2e7362c9086c07a86965ac754d1e46a7138</id>
<content type='text'>
Callers of coroutine_fn must be coroutine_fn themselves, or the call
must be within "if (qemu_in_coroutine())".  Apply coroutine_fn to
functions where this holds.

Reviewed-by: Alberto Faria &lt;afaria@redhat.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Message-Id: &lt;20220922084924.201610-15-pbonzini@redhat.com&gt;
[kwolf: Fixed up coding style]
Reviewed-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>block: Change bdrv_{pread,pwrite,pwrite_sync}() param order</title>
<updated>2022-07-12T10:14:55+00:00</updated>
<author>
<name>Alberto Faria</name>
</author>
<published>2022-06-09T15:27:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=32cc71def9e3885f9527af713e6d8dc7521ddc08'/>
<id>urn:sha1:32cc71def9e3885f9527af713e6d8dc7521ddc08</id>
<content type='text'>
Swap 'buf' and 'bytes' around for consistency with
bdrv_co_{pread,pwrite}(), and in preparation to implement these
functions using generated_co_wrapper.

Callers were updated using this Coccinelle script:

    @@ expression child, offset, buf, bytes, flags; @@
    - bdrv_pread(child, offset, buf, bytes, flags)
    + bdrv_pread(child, offset, bytes, buf, flags)

    @@ expression child, offset, buf, bytes, flags; @@
    - bdrv_pwrite(child, offset, buf, bytes, flags)
    + bdrv_pwrite(child, offset, bytes, buf, flags)

    @@ expression child, offset, buf, bytes, flags; @@
    - bdrv_pwrite_sync(child, offset, buf, bytes, flags)
    + bdrv_pwrite_sync(child, offset, bytes, buf, flags)

Resulting overly-long lines were then fixed by hand.

Signed-off-by: Alberto Faria &lt;afaria@redhat.com&gt;
Reviewed-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Reviewed-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
Reviewed-by: Vladimir Sementsov-Ogievskiy &lt;vsementsov@yandex-team.ru&gt;
Message-Id: &lt;20220609152744.3891847-3-afaria@redhat.com&gt;
Reviewed-by: Hanna Reitz &lt;hreitz@redhat.com&gt;
Signed-off-by: Hanna Reitz &lt;hreitz@redhat.com&gt;
</content>
</entry>
<entry>
<title>block: Add a 'flags' param to bdrv_{pread,pwrite,pwrite_sync}()</title>
<updated>2022-07-12T10:14:55+00:00</updated>
<author>
<name>Alberto Faria</name>
</author>
<published>2022-06-09T15:27:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=53fb7844f03241a0e6de2c342c9e1b89df12da4d'/>
<id>urn:sha1:53fb7844f03241a0e6de2c342c9e1b89df12da4d</id>
<content type='text'>
For consistency with other I/O functions, and in preparation to
implement them using generated_co_wrapper.

Callers were updated using this Coccinelle script:

    @@ expression child, offset, buf, bytes; @@
    - bdrv_pread(child, offset, buf, bytes)
    + bdrv_pread(child, offset, buf, bytes, 0)

    @@ expression child, offset, buf, bytes; @@
    - bdrv_pwrite(child, offset, buf, bytes)
    + bdrv_pwrite(child, offset, buf, bytes, 0)

    @@ expression child, offset, buf, bytes; @@
    - bdrv_pwrite_sync(child, offset, buf, bytes)
    + bdrv_pwrite_sync(child, offset, buf, bytes, 0)

Resulting overly-long lines were then fixed by hand.

Signed-off-by: Alberto Faria &lt;afaria@redhat.com&gt;
Reviewed-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Reviewed-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
Reviewed-by: Vladimir Sementsov-Ogievskiy &lt;vsementsov@yandex-team.ru&gt;
Message-Id: &lt;20220609152744.3891847-2-afaria@redhat.com&gt;
Reviewed-by: Hanna Reitz &lt;hreitz@redhat.com&gt;
Signed-off-by: Hanna Reitz &lt;hreitz@redhat.com&gt;
</content>
</entry>
<entry>
<title>osdep: Move memalign-related functions to their own header</title>
<updated>2022-03-07T13:16:49+00:00</updated>
<author>
<name>Peter Maydell</name>
</author>
<published>2022-02-26T18:07:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=5df022cf2e5e24910a7d579d5780ae78bc24f247'/>
<id>urn:sha1:5df022cf2e5e24910a7d579d5780ae78bc24f247</id>
<content type='text'>
Move the various memalign-related functions out of osdep.h and into
their own header, which we include only where they are used.
While we're doing this, add some brief documentation comments.

Signed-off-by: Peter Maydell &lt;peter.maydell@linaro.org&gt;
Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Reviewed-by: Philippe Mathieu-Daudé &lt;f4bug@amsat.org&gt;
Message-id: 20220226180723.1706285-10-peter.maydell@linaro.org
</content>
</entry>
<entry>
<title>qcow2: Silence clang -m32 compiler warning</title>
<updated>2021-10-15T20:39:38+00:00</updated>
<author>
<name>Hanna Reitz</name>
</author>
<published>2021-10-11T15:50:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=e7e588d432d31ecebc26358e47201dd108db964c'/>
<id>urn:sha1:e7e588d432d31ecebc26358e47201dd108db964c</id>
<content type='text'>
With -m32, size_t is generally only a uint32_t.  That makes clang
complain that in the assertion

  assert(qiov-&gt;size &lt;= INT64_MAX);

the range of the type of qiov-&gt;size (size_t) is too small for any of its
values to ever exceed INT64_MAX.

Cast qiov-&gt;size to uint64_t to silence clang.

Fixes: f7ef38dd1310d7d9db76d0aa16899cbc5744f36d
       ("block: use int64_t instead of uint64_t in driver read
       handlers")
Signed-off-by: Hanna Reitz &lt;hreitz@redhat.com&gt;
Message-Id: &lt;20211011155031.149158-1-hreitz@redhat.com&gt;
Reviewed-by: Eric Blake &lt;eblake@redhat.com&gt;
Signed-off-by: Eric Blake &lt;eblake@redhat.com&gt;
</content>
</entry>
<entry>
<title>block: use int64_t instead of uint64_t in driver read handlers</title>
<updated>2021-09-29T18:46:31+00:00</updated>
<author>
<name>Vladimir Sementsov-Ogievskiy</name>
</author>
<published>2021-09-03T10:27:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=f7ef38dd1310d7d9db76d0aa16899cbc5744f36d'/>
<id>urn:sha1:f7ef38dd1310d7d9db76d0aa16899cbc5744f36d</id>
<content type='text'>
We are generally moving to int64_t for both offset and bytes parameters
on all io paths.

Main motivation is realization of 64-bit write_zeroes operation for
fast zeroing large disk chunks, up to the whole disk.

We chose signed type, to be consistent with off_t (which is signed) and
with possibility for signed return type (where negative value means
error).

So, convert driver read handlers parameters which are already 64bit to
signed type.

While being here, convert also flags parameter to be BdrvRequestFlags.

Now let's consider all callers. Simple

  git grep '\-&gt;bdrv_\(aio\|co\)_preadv\(_part\)\?'

shows that's there three callers of driver function:

 bdrv_driver_preadv() in block/io.c, passes int64_t, checked by
   bdrv_check_qiov_request() to be non-negative.

 qcow2_load_vmstate() does bdrv_check_qiov_request().

 do_perform_cow_read() has uint64_t argument. And a lot of things in
 qcow2 driver are uint64_t, so converting it is big job. But we must
 not work with requests that don't satisfy bdrv_check_qiov_request(),
 so let's just assert it here.

Still, the functions may be called directly, not only by drv-&gt;...
Let's check:

git grep '\.bdrv_\(aio\|co\)_preadv\(_part\)\?\s*=' | \
awk '{print $4}' | sed 's/,//' | sed 's/&amp;//' | sort | uniq | \
while read func; do git grep "$func(" | \
grep -v "$func(BlockDriverState"; done

The only one such caller:

    QEMUIOVector qiov = QEMU_IOVEC_INIT_BUF(qiov, &amp;data, 1);
    ...
    ret = bdrv_replace_test_co_preadv(bs, 0, 1, &amp;qiov, 0);

in tests/unit/test-bdrv-drain.c, and it's OK obviously.

Signed-off-by: Vladimir Sementsov-Ogievskiy &lt;vsementsov@virtuozzo.com&gt;
Message-Id: &lt;20210903102807.27127-4-vsementsov@virtuozzo.com&gt;
Reviewed-by: Eric Blake &lt;eblake@redhat.com&gt;
[eblake: fix typos]
Signed-off-by: Eric Blake &lt;eblake@redhat.com&gt;
</content>
</entry>
<entry>
<title>qcow2: introduce qcow2_parse_compressed_l2_entry() helper</title>
<updated>2021-09-15T16:42:38+00:00</updated>
<author>
<name>Vladimir Sementsov-Ogievskiy</name>
</author>
<published>2021-09-14T12:24:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=a6e098462ba6d8585a6f21729b406ab51a70eb03'/>
<id>urn:sha1:a6e098462ba6d8585a6f21729b406ab51a70eb03</id>
<content type='text'>
Add helper to parse compressed l2_entry and use it everywhere instead
of open-coding.

Note, that in most places we move to precise coffset/csize instead of
sector-aligned. Still it should work good enough for updating
refcounts.

Signed-off-by: Vladimir Sementsov-Ogievskiy &lt;vsementsov@virtuozzo.com&gt;
Reviewed-by: Eric Blake &lt;eblake@redhat.com&gt;
Reviewed-by: Hanna Reitz &lt;hreitz@redhat.com&gt;
Message-Id: &lt;20210914122454.141075-4-vsementsov@virtuozzo.com&gt;
Signed-off-by: Hanna Reitz &lt;hreitz@redhat.com&gt;
</content>
</entry>
<entry>
<title>qcow2: compressed read: simplify cluster descriptor passing</title>
<updated>2021-09-15T16:42:38+00:00</updated>
<author>
<name>Vladimir Sementsov-Ogievskiy</name>
</author>
<published>2021-09-14T12:24:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=9a3978a46bc12e0c49b7114983103b07d90cfa1c'/>
<id>urn:sha1:9a3978a46bc12e0c49b7114983103b07d90cfa1c</id>
<content type='text'>
Let's pass the whole L2 entry and not bother with
L2E_COMPRESSED_OFFSET_SIZE_MASK.

It also helps further refactoring that adds generic
qcow2_parse_compressed_l2_entry() helper.

Signed-off-by: Vladimir Sementsov-Ogievskiy &lt;vsementsov@virtuozzo.com&gt;
Reviewed-by: Eric Blake &lt;eblake@redhat.com&gt;
Reviewed-by: Alberto Garcia &lt;berto@igalia.com&gt;
Reviewed-by: Hanna Reitz &lt;hreitz@redhat.com&gt;
Message-Id: &lt;20210914122454.141075-3-vsementsov@virtuozzo.com&gt;
Signed-off-by: Hanna Reitz &lt;hreitz@redhat.com&gt;
</content>
</entry>
</feed>
