<feed xmlns='http://www.w3.org/2005/Atom'>
<title>bwlp/qemu.git/block/null.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/null.c?h=spice_video_codecs</id>
<link rel='self' href='https://git.openslx.org/bwlp/qemu.git/atom/block/null.c?h=spice_video_codecs'/>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/'/>
<updated>2021-09-29T18:46:31+00:00</updated>
<entry>
<title>block: use int64_t instead of uint64_t in driver write handlers</title>
<updated>2021-09-29T18:46:31+00:00</updated>
<author>
<name>Vladimir Sementsov-Ogievskiy</name>
</author>
<published>2021-09-03T10:28:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=e75abedab7e10043ed81b1cbc3033409aff0159e'/>
<id>urn:sha1:e75abedab7e10043ed81b1cbc3033409aff0159e</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 write 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\)_pwritev\(_part\)\?'

shows that's there three callers of driver function:

 bdrv_driver_pwritev() and bdrv_driver_pwritev_compressed() in
 block/io.c, both pass int64_t, checked by bdrv_check_qiov_request() to
 be non-negative.

 qcow2_save_vmstate() does bdrv_check_qiov_request().

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

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

shows several callers:

qcow2:
  qcow2_co_truncate() write at most up to @offset, which is checked in
    generic qcow2_co_truncate() by bdrv_check_request().
  qcow2_co_pwritev_compressed_task() pass the request (or part of the
    request) that already went through normal write path, so it should
    be OK

qcow:
  qcow_co_pwritev_compressed() pass int64_t, it's updated by this patch

quorum:
  quorum_co_pwrite_zeroes() pass int64_t and int - OK

throttle:
  throttle_co_pwritev_compressed() pass int64_t, it's updated by this
  patch

vmdk:
  vmdk_co_pwritev_compressed() pass int64_t, it's updated by this
  patch

Signed-off-by: Vladimir Sementsov-Ogievskiy &lt;vsementsov@virtuozzo.com&gt;
Message-Id: &lt;20210903102807.27127-5-vsementsov@virtuozzo.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>block/null: Implement bdrv_get_allocated_file_size</title>
<updated>2020-09-07T10:31:31+00:00</updated>
<author>
<name>Max Reitz</name>
</author>
<published>2020-06-22T11:58:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=07cd7b659a7169ed4c5c6b45b48d8351566ed4cb'/>
<id>urn:sha1:07cd7b659a7169ed4c5c6b45b48d8351566ed4cb</id>
<content type='text'>
It is trivial, so we might as well do it.

Remove _filter_actual_image_size from iotest 184, so we get to see the
result in its reference output.

Signed-off-by: Max Reitz &lt;mreitz@redhat.com&gt;
</content>
</entry>
<entry>
<title>replay: add BH oneshot event for block layer</title>
<updated>2019-10-14T15:12:48+00:00</updated>
<author>
<name>Pavel Dovgalyuk</name>
</author>
<published>2019-09-17T11:58:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=e4ec5ad464e48ab8d978b4dd8aacd05c1c4a87cc'/>
<id>urn:sha1:e4ec5ad464e48ab8d978b4dd8aacd05c1c4a87cc</id>
<content type='text'>
Replay is capable of recording normal BH events, but sometimes
there are single use callbacks scheduled with aio_bh_schedule_oneshot
function. This patch enables recording and replaying such callbacks.
Block layer uses these events for calling the completion function.
Replaying these calls makes the execution deterministic.

Signed-off-by: Pavel Dovgalyuk &lt;Pavel.Dovgaluk@ispras.ru&gt;
Acked-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>Include qemu/module.h where needed, drop it from qemu-common.h</title>
<updated>2019-06-12T11:18:33+00:00</updated>
<author>
<name>Markus Armbruster</name>
</author>
<published>2019-05-23T14:35:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=0b8fa32f551e863bb548a11394239239270dd3dc'/>
<id>urn:sha1:0b8fa32f551e863bb548a11394239239270dd3dc</id>
<content type='text'>
Signed-off-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Message-Id: &lt;20190523143508.25387-4-armbru@redhat.com&gt;
[Rebased with conflicts resolved automatically, except for
hw/usb/dev-hub.c hw/misc/exynos4210_rng.c hw/misc/bcm2835_rng.c
hw/misc/aspeed_scu.c hw/display/virtio-vga.c hw/arm/stm32f205_soc.c;
ui/cocoa.m fixed up]
</content>
</entry>
<entry>
<title>block/null: Generate filename even with latency-ns</title>
<updated>2019-02-25T14:11:27+00:00</updated>
<author>
<name>Max Reitz</name>
</author>
<published>2019-02-01T19:29:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=1e47cb7f52541a82148da37eb004a0c68be4b865'/>
<id>urn:sha1:1e47cb7f52541a82148da37eb004a0c68be4b865</id>
<content type='text'>
While we cannot represent the latency-ns option in a filename, it is not
a strong option so not being able to should not stop us from generating
a filename nonetheless.

Signed-off-by: Max Reitz &lt;mreitz@redhat.com&gt;
Reviewed-by: Alberto Garcia &lt;berto@igalia.com&gt;
Message-id: 20190201192935.18394-30-mreitz@redhat.com
Signed-off-by: Max Reitz &lt;mreitz@redhat.com&gt;
</content>
</entry>
<entry>
<title>block: Purify .bdrv_refresh_filename()</title>
<updated>2019-02-25T14:11:27+00:00</updated>
<author>
<name>Max Reitz</name>
</author>
<published>2019-02-01T19:29:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=998b3a1e5a2dd23bf89a853e15fabdaa8d788a72'/>
<id>urn:sha1:998b3a1e5a2dd23bf89a853e15fabdaa8d788a72</id>
<content type='text'>
Currently, BlockDriver.bdrv_refresh_filename() is supposed to both
refresh the filename (BDS.exact_filename) and set BDS.full_open_options.
Now that we have generic code in the central bdrv_refresh_filename() for
creating BDS.full_open_options, we can drop the latter part from all
BlockDriver.bdrv_refresh_filename() implementations.

This also means that we can drop all of the existing default code for
this from the global bdrv_refresh_filename() itself.

Furthermore, we now have to call BlockDriver.bdrv_refresh_filename()
after having set BDS.full_open_options, because the block driver's
implementation should now be allowed to depend on BDS.full_open_options
being set correctly.

Finally, with this patch we can drop the @options parameter from
BlockDriver.bdrv_refresh_filename(); also, add a comment on this
function's purpose in block/block_int.h while touching its interface.

This completely obsoletes blklogwrite's implementation of
.bdrv_refresh_filename().

Signed-off-by: Max Reitz &lt;mreitz@redhat.com&gt;
Message-id: 20190201192935.18394-25-mreitz@redhat.com
Signed-off-by: Max Reitz &lt;mreitz@redhat.com&gt;
</content>
</entry>
<entry>
<title>block: Add strong_runtime_opts to BlockDriver</title>
<updated>2019-02-25T14:11:27+00:00</updated>
<author>
<name>Max Reitz</name>
</author>
<published>2019-02-01T19:29:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=2654267cc163083f4fb9a6d719468d9dd1bea455'/>
<id>urn:sha1:2654267cc163083f4fb9a6d719468d9dd1bea455</id>
<content type='text'>
This new field can be set by block drivers to list the runtime options
they accept that may influence the contents of the respective BDS. As of
a follow-up patch, this list will be used by the common
bdrv_refresh_filename() implementation to decide which options to put
into BDS.full_open_options (and consequently whether a JSON filename has
to be created), thus freeing the drivers of having to implement that
logic themselves.

Additionally, this patch adds the field to all of the block drivers that
need it and sets it accordingly.

Signed-off-by: Max Reitz &lt;mreitz@redhat.com&gt;
Reviewed-by: Alberto Garcia &lt;berto@igalia.com&gt;
Message-id: 20190201192935.18394-22-mreitz@redhat.com
Signed-off-by: Max Reitz &lt;mreitz@redhat.com&gt;
</content>
</entry>
<entry>
<title>block: drop empty .bdrv_close handlers</title>
<updated>2018-08-15T10:50:39+00:00</updated>
<author>
<name>Vladimir Sementsov-Ogievskiy</name>
</author>
<published>2018-08-14T12:43:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=f66b1f0e2795f6ac0646103a2b3e135985f3a80b'/>
<id>urn:sha1:f66b1f0e2795f6ac0646103a2b3e135985f3a80b</id>
<content type='text'>
.bdrv_close handler is optional after previous commit, no needs to keep
empty functions more.

Signed-off-by: Vladimir Sementsov-Ogievskiy &lt;vsementsov@virtuozzo.com&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>null: Switch to byte-based read/write</title>
<updated>2018-05-15T14:11:41+00:00</updated>
<author>
<name>Eric Blake</name>
</author>
<published>2018-04-24T19:25:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=b3241e9274ca1aafb94ad8683305bb383e11c766'/>
<id>urn:sha1:b3241e9274ca1aafb94ad8683305bb383e11c766</id>
<content type='text'>
We are gradually moving away from sector-based interfaces, towards
byte-based.  Make the change for the last few sector-based callbacks
in the null-co and null-aio drivers.

Note that since the null driver does nothing on writes, it trivially
supports the BDRV_REQ_FUA flag (all writes have already landed to
the same bit-bucket without needing an extra flush call).  Also, since
the null driver does just as well with byte-based requests, we can
now avoid cycles wasted on read-modify-write by taking advantage of
the block layer now defaulting the alignment to 1 instead of 512.

Signed-off-by: Eric Blake &lt;eblake@redhat.com&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
</feed>
