<feed xmlns='http://www.w3.org/2005/Atom'>
<title>bwlp/qemu.git/include/block/blockjob.h, branch spice_video_codecs</title>
<subtitle>Experimental fork of QEMU with video encoding patches</subtitle>
<id>https://git.openslx.org/bwlp/qemu.git/atom/include/block/blockjob.h?h=spice_video_codecs</id>
<link rel='self' href='https://git.openslx.org/bwlp/qemu.git/atom/include/block/blockjob.h?h=spice_video_codecs'/>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/'/>
<updated>2022-10-07T10:11:41+00:00</updated>
<entry>
<title>blockjob: remove unused functions</title>
<updated>2022-10-07T10:11:41+00:00</updated>
<author>
<name>Emanuele Giuseppe Esposito</name>
</author>
<published>2022-09-26T09:32:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=ba6a91005270c8e199d739c2e2afb49372ba0f7f'/>
<id>urn:sha1:ba6a91005270c8e199d739c2e2afb49372ba0f7f</id>
<content type='text'>
These public functions are not used anywhere, thus can be dropped.

Signed-off-by: Emanuele Giuseppe Esposito &lt;eesposit@redhat.com&gt;
Reviewed-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
Reviewed-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Reviewed-by: Vladimir Sementsov-Ogievskiy &lt;vsementsov@yandex-team.ru&gt;
Message-Id: &lt;20220926093214.506243-21-eesposit@redhat.com&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>blockjob.h: categorize fields in struct BlockJob</title>
<updated>2022-10-07T10:11:41+00:00</updated>
<author>
<name>Emanuele Giuseppe Esposito</name>
</author>
<published>2022-09-26T09:32:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=3937e12cf8887660d86034c7d54c4f2236f0cb0e'/>
<id>urn:sha1:3937e12cf8887660d86034c7d54c4f2236f0cb0e</id>
<content type='text'>
The same job lock is being used also to protect some of blockjob fields.
Categorize them just as done in job.h.

Reviewed-by: Vladimir Sementsov-Ogievskiy &lt;vsementsov@yandex-team.ru&gt;
Signed-off-by: Emanuele Giuseppe Esposito &lt;eesposit@redhat.com&gt;
Message-Id: &lt;20220926093214.506243-15-eesposit@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>blockjob: introduce block_job _locked() APIs</title>
<updated>2022-10-07T10:11:41+00:00</updated>
<author>
<name>Emanuele Giuseppe Esposito</name>
</author>
<published>2022-09-26T09:32:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=f41ab73fa283f4f4d79102d1c8e8bad456218751'/>
<id>urn:sha1:f41ab73fa283f4f4d79102d1c8e8bad456218751</id>
<content type='text'>
Just as done with job.h, create _locked() functions in blockjob.h

These functions will be later useful when caller has already taken
the lock. All blockjob _locked functions call job _locked functions.

Note: at this stage, job_{lock/unlock} and job lock guard macros
are *nop*.

Signed-off-by: Emanuele Giuseppe Esposito &lt;eesposit@redhat.com&gt;
Reviewed-by: Vladimir Sementsov-Ogievskiy &lt;vsementsov@yandex-team.ru&gt;
Reviewed-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Reviewed-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
Message-Id: &lt;20220926093214.506243-8-eesposit@redhat.com&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>include/block/blockjob.h: global state API</title>
<updated>2022-03-04T17:18:25+00:00</updated>
<author>
<name>Emanuele Giuseppe Esposito</name>
</author>
<published>2022-03-03T15:16:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=4ad3387637141c5ee6c0e06ab2660cf59d83dae9'/>
<id>urn:sha1:4ad3387637141c5ee6c0e06ab2660cf59d83dae9</id>
<content type='text'>
blockjob functions run always under the BQL lock.

Signed-off-by: Emanuele Giuseppe Esposito &lt;eesposit@redhat.com&gt;
Message-Id: &lt;20220303151616.325444-19-eesposit@redhat.com&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>blockjob: drop BlockJob.blk field</title>
<updated>2021-12-28T14:18:59+00:00</updated>
<author>
<name>Vladimir Sementsov-Ogievskiy</name>
</author>
<published>2021-05-06T14:13:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=985cac8f200443ad952becc03b07c51ff4f80983'/>
<id>urn:sha1:985cac8f200443ad952becc03b07c51ff4f80983</id>
<content type='text'>
It's unused now (except for permission handling)[*]. The only reasonable
user of it was block-stream job, recently updated to use own blk. And
other block jobs prefer to use own source node related objects.

So, the arguments of dropping the field are:

 - block jobs prefer not to use it
 - block jobs usually has more then one node to operate on, and better
   to operate symmetrically (for example has both source and target
   blk's in specific block-job state structure)

*: BlockJob.blk is used to keep some permissions. We simply move
permissions to block-job child created in block_job_create() together
with blk.

In mirror, we just should not care anymore about restoring state of
blk. Most probably this code could be dropped long ago, after dropping
bs-&gt;job pointer. Now it finally goes away together with BlockJob.blk
itself.

iotest 141 output is updated, as "bdrv_has_blk(bs)" check in
qmp_blockdev_del() doesn't fail (we don't have blk now). Still, new
error message looks even better.

In iotest 283 we need to add a job id, otherwise "Invalid job ID"
happens now earlier than permission check (as permissions moved from
blk to block-job node).

Signed-off-by: Vladimir Sementsov-Ogievskiy &lt;vsementsov@virtuozzo.com&gt;
Reviewed-by: Nikita Lapshin &lt;nikita.lapshin@virtuozzo.com&gt;
</content>
</entry>
<entry>
<title>blockjob: implement and use block_job_get_aio_context</title>
<updated>2021-12-28T14:18:23+00:00</updated>
<author>
<name>Vladimir Sementsov-Ogievskiy</name>
</author>
<published>2021-05-06T14:13:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=df9a31650505278e72c6b453f1679f66eac6e633'/>
<id>urn:sha1:df9a31650505278e72c6b453f1679f66eac6e633</id>
<content type='text'>
We are going to drop BlockJob.blk. So let's retrieve block job context
from underlying job instead of main node.

Signed-off-by: Vladimir Sementsov-Ogievskiy &lt;vsementsov@virtuozzo.com&gt;
Reviewed-by: Nikita Lapshin &lt;nikita.lapshin@virtuozzo.com&gt;
</content>
</entry>
<entry>
<title>blockjob: return status from block_job_set_speed()</title>
<updated>2021-03-08T21:14:15+00:00</updated>
<author>
<name>Vladimir Sementsov-Ogievskiy</name>
</author>
<published>2021-02-02T12:49:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=775d0c050866c3571b8599291b3ff65fdbd63ed8'/>
<id>urn:sha1:775d0c050866c3571b8599291b3ff65fdbd63ed8</id>
<content type='text'>
Better to return status together with setting errp. It allows to avoid
error propagation in the caller.

Signed-off-by: Vladimir Sementsov-Ogievskiy &lt;vsementsov@virtuozzo.com&gt;
Reviewed-by: Greg Kurz &lt;groug@kaod.org&gt;
Reviewed-by: Alberto Garcia &lt;berto@igalia.com&gt;
Message-Id: &lt;20210202124956.63146-8-vsementsov@virtuozzo.com&gt;
Signed-off-by: Eric Blake &lt;eblake@redhat.com&gt;
</content>
</entry>
<entry>
<title>blockdev: blockdev_mark_auto_del: drop usage of bs-&gt;job</title>
<updated>2019-06-18T14:41:10+00:00</updated>
<author>
<name>Vladimir Sementsov-Ogievskiy</name>
</author>
<published>2019-06-06T15:41:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=8164102ffe02dfc6478c0b3f8ffce29705a9a53b'/>
<id>urn:sha1:8164102ffe02dfc6478c0b3f8ffce29705a9a53b</id>
<content type='text'>
We are going to remove bs-&gt;job pointer. Drop it's usage in
blockdev_mark_auto_del: instead of looking at bs-&gt;job let's check all
jobs for references to bs.

Suggested-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
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>block: Use a single global AioWait</title>
<updated>2018-09-25T13:50:15+00:00</updated>
<author>
<name>Kevin Wolf</name>
</author>
<published>2018-09-18T15:09:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=cfe29d8294e06420e15d4938421ae006c8ac49e7'/>
<id>urn:sha1:cfe29d8294e06420e15d4938421ae006c8ac49e7</id>
<content type='text'>
When draining a block node, we recurse to its parent and for subtree
drains also to its children. A single AIO_WAIT_WHILE() is then used to
wait for bdrv_drain_poll() to become true, which depends on all of the
nodes we recursed to. However, if the respective child or parent becomes
quiescent and calls bdrv_wakeup(), only the AioWait of the child/parent
is checked, while AIO_WAIT_WHILE() depends on the AioWait of the
original node.

Fix this by using a single AioWait for all callers of AIO_WAIT_WHILE().

This may mean that the draining thread gets a few more unnecessary
wakeups because an unrelated operation got completed, but we already
wake it up when something _could_ have changed rather than only if it
has certainly changed.

Apart from that, drain is a slow path anyway. In theory it would be
possible to use wakeups more selectively and still correctly, but the
gains are likely not worth the additional complexity. In fact, this
patch is a nice simplification for some places in the code.

Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Reviewed-by: Eric Blake &lt;eblake@redhat.com&gt;
Reviewed-by: Max Reitz &lt;mreitz@redhat.com&gt;
</content>
</entry>
<entry>
<title>blockjob: Wake up BDS when job becomes idle</title>
<updated>2018-09-25T13:50:15+00:00</updated>
<author>
<name>Kevin Wolf</name>
</author>
<published>2018-08-17T12:53:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=34dc97b9a0e592bc466bdb0bbfe45d77304a72b6'/>
<id>urn:sha1:34dc97b9a0e592bc466bdb0bbfe45d77304a72b6</id>
<content type='text'>
In the context of draining a BDS, the .drained_poll callback of block
jobs is called. If this returns true (i.e. there is still some activity
pending), the drain operation may call aio_poll() with blocking=true to
wait for completion.

As soon as the pending activity is completed and the job finally arrives
in a quiescent state (i.e. its coroutine either yields with busy=false
or terminates), the block job must notify the aio_poll() loop to wake
up, otherwise we get a deadlock if both are running in different
threads.

Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Reviewed-by: Fam Zheng &lt;famz@redhat.com&gt;
Reviewed-by: Max Reitz &lt;mreitz@redhat.com&gt;
</content>
</entry>
</feed>
