<feed xmlns='http://www.w3.org/2005/Atom'>
<title>bwlp/qemu.git/block/monitor, branch master</title>
<subtitle>Experimental fork of QEMU with video encoding patches</subtitle>
<id>https://git.openslx.org/bwlp/qemu.git/atom/block/monitor?h=master</id>
<link rel='self' href='https://git.openslx.org/bwlp/qemu.git/atom/block/monitor?h=master'/>
<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>monitor: add missing coroutine_fn annotation</title>
<updated>2022-10-27T18:14:11+00:00</updated>
<author>
<name>Alberto Faria</name>
</author>
<published>2022-10-13T12:36:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=6894ee2bee20fd22055f8a7337ef465efab0c823'/>
<id>urn:sha1:6894ee2bee20fd22055f8a7337ef465efab0c823</id>
<content type='text'>
hmp_block_resize and hmp_screendump are defined as a ".coroutine = true" command,
so they must be coroutine_fn.

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-4-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>monitor: expose monitor_puts to rest of code</title>
<updated>2022-10-06T10:53:40+00:00</updated>
<author>
<name>Alex Bennée</name>
</author>
<published>2022-09-29T11:42:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=bf0c50d4aa851e78c91096f510303831a2aadaeb'/>
<id>urn:sha1:bf0c50d4aa851e78c91096f510303831a2aadaeb</id>
<content type='text'>
This helps us construct strings elsewhere before echoing to the
monitor. It avoids having to jump through hoops like:

  monitor_printf(mon, "%s", s-&gt;str);

It will be useful in following patches but for now convert all
existing plain "%s" printfs to use the _puts api.

Signed-off-by: Alex Bennée &lt;alex.bennee@linaro.org&gt;
Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Reviewed-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Reviewed-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Reviewed-by: Philippe Mathieu-Daudé &lt;f4bug@amsat.org&gt;
Message-Id: &lt;20220929114231.583801-33-alex.bennee@linaro.org&gt;
</content>
</entry>
<entry>
<title>block: improve block_dirty_bitmap_merge(): don't allocate extra bitmap</title>
<updated>2022-06-24T15:07:06+00:00</updated>
<author>
<name>Vladimir Sementsov-Ogievskiy</name>
</author>
<published>2022-05-17T11:12:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=58cbfbdf73d1d20ba9506b1260a4cb321adad47d'/>
<id>urn:sha1:58cbfbdf73d1d20ba9506b1260a4cb321adad47d</id>
<content type='text'>
We don't need extra bitmap. All we need is to backup the original
bitmap when we do first merge. So, drop extra temporary bitmap and work
directly with target and backup.

Still to keep old semantics, that on failure target is unchanged and
user don't need to restore, we need a local_backup variable and do
restore ourselves on failure path.

Signed-off-by: Vladimir Sementsov-Ogievskiy &lt;v.sementsov-og@mail.ru&gt;
Message-Id: &lt;20220517111206.23585-3-v.sementsov-og@mail.ru&gt;
Reviewed-by: Eric Blake &lt;eblake@redhat.com&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>block: block_dirty_bitmap_merge(): fix error path</title>
<updated>2022-06-24T15:07:06+00:00</updated>
<author>
<name>Vladimir Sementsov-Ogievskiy</name>
</author>
<published>2022-05-17T11:12:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=775b30b3050a8718130701008a4afcca57e774c4'/>
<id>urn:sha1:775b30b3050a8718130701008a4afcca57e774c4</id>
<content type='text'>
At the end we ignore failure of bdrv_merge_dirty_bitmap() and report
success. And still set errp. That's wrong.

Signed-off-by: Vladimir Sementsov-Ogievskiy &lt;v.sementsov-og@mail.ru&gt;
Reviewed-by: Nikita Lapshin &lt;nikita.lapshin@virtuozzo.com&gt;
Reviewed-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Message-Id: &lt;20220517111206.23585-2-v.sementsov-og@mail.ru&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>qapi: rename BlockDirtyBitmapMergeSource to BlockDirtyBitmapOrStr</title>
<updated>2022-04-26T18:13:50+00:00</updated>
<author>
<name>Vladimir Sementsov-Ogievskiy</name>
</author>
<published>2022-03-14T21:32:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=1466ef6cbe26a55e9bd5d4c3d9f58c793e1eb2c4'/>
<id>urn:sha1:1466ef6cbe26a55e9bd5d4c3d9f58c793e1eb2c4</id>
<content type='text'>
Rename the type to be reused. Old name is "what is it for". To be
natively reused for other needs, let's name it exactly "what is it".

Signed-off-by: Vladimir Sementsov-Ogievskiy &lt;vsementsov@openvz.org&gt;
Message-Id: &lt;20220314213226.362217-2-v.sementsov-og@mail.ru&gt;
[eblake: Adjust S-o-b to Vladimir's new email, with permission]
Reviewed-by: Eric Blake &lt;eblake@redhat.com&gt;
Acked-by: John Snow &lt;jsnow@redhat.com&gt;
Signed-off-by: Eric Blake &lt;eblake@redhat.com&gt;
</content>
</entry>
<entry>
<title>block/dirty-bitmap: bdrv_merge_dirty_bitmap(): add return value</title>
<updated>2022-03-07T08:33:30+00:00</updated>
<author>
<name>Vladimir Sementsov-Ogievskiy</name>
</author>
<published>2022-03-03T19:43:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=34ffacb7f4e781873ffdee54c7bb800fa1853a92'/>
<id>urn:sha1:34ffacb7f4e781873ffdee54c7bb800fa1853a92</id>
<content type='text'>
That simplifies handling failure in existing code and in further new
usage of bdrv_merge_dirty_bitmap().

Signed-off-by: Vladimir Sementsov-Ogievskiy &lt;vsementsov@virtuozzo.com&gt;
Reviewed-by: Hanna Reitz &lt;hreitz@redhat.com&gt;
Message-Id: &lt;20220303194349.2304213-3-vsementsov@virtuozzo.com&gt;
Signed-off-by: Hanna Reitz &lt;hreitz@redhat.com&gt;
</content>
</entry>
<entry>
<title>assertions for block_int global state API</title>
<updated>2022-03-04T17:18:25+00:00</updated>
<author>
<name>Emanuele Giuseppe Esposito</name>
</author>
<published>2022-03-03T15:15:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=b4ad82aab10ea0cfe981e94414751e26a510c280'/>
<id>urn:sha1:b4ad82aab10ea0cfe981e94414751e26a510c280</id>
<content type='text'>
Signed-off-by: Emanuele Giuseppe Esposito &lt;eesposit@redhat.com&gt;
Message-Id: &lt;20220303151616.325444-13-eesposit@redhat.com&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>include/sysemu/blockdev.h: remove drive_mark_claimed_by_board and inline drive_def</title>
<updated>2022-01-14T11:03:16+00:00</updated>
<author>
<name>Emanuele Giuseppe Esposito</name>
</author>
<published>2021-12-15T12:11:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=cc67f28ea2760505a4cc6efdc36cbb9b8421f928'/>
<id>urn:sha1:cc67f28ea2760505a4cc6efdc36cbb9b8421f928</id>
<content type='text'>
drive_def is only a particular use case of
qemu_opts_parse_noisily, so it can be inlined.

Also remove drive_mark_claimed_by_board, as it is only defined
but not implemented (nor used) anywhere.

Signed-off-by: Emanuele Giuseppe Esposito &lt;eesposit@redhat.com&gt;
Message-Id: &lt;20211215121140.456939-3-eesposit@redhat.com&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>block/monitor: Consolidate hmp_handle_error calls to reduce redundant code</title>
<updated>2021-09-01T10:57:31+00:00</updated>
<author>
<name>Mao Zhongyi</name>
</author>
<published>2021-08-02T06:25:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=8cca0bd289ed8aa1f4f26539bd9450fa04e16fc0'/>
<id>urn:sha1:8cca0bd289ed8aa1f4f26539bd9450fa04e16fc0</id>
<content type='text'>
Signed-off-by: Mao Zhongyi &lt;maozhongyi@cmss.chinamobile.com&gt;
Message-Id: &lt;20210802062507.347555-1-maozhongyi@cmss.chinamobile.com&gt;
Signed-off-by: Hanna Reitz &lt;hreitz@redhat.com&gt;
</content>
</entry>
<entry>
<title>monitor: hmp_qemu_io: acquire aio contex, fix crash</title>
<updated>2021-05-14T14:14:10+00:00</updated>
<author>
<name>Vladimir Sementsov-Ogievskiy</name>
</author>
<published>2021-04-23T13:42:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=78632a3d1685454fec83f83586c675e7f2a1a84a'/>
<id>urn:sha1:78632a3d1685454fec83f83586c675e7f2a1a84a</id>
<content type='text'>
Max reported the following bug:

$ ./qemu-img create -f raw src.img 1G
$ ./qemu-img create -f raw dst.img 1G

$ (echo '
   {"execute":"qmp_capabilities"}
   {"execute":"blockdev-mirror",
    "arguments":{"job-id":"mirror",
                 "device":"source",
                 "target":"target",
                 "sync":"full",
                 "filter-node-name":"mirror-top"}}
'; sleep 3; echo '
   {"execute":"human-monitor-command",
    "arguments":{"command-line":
                 "qemu-io mirror-top \"write 0 1G\""}}') \
| x86_64-softmmu/qemu-system-x86_64 \
   -qmp stdio \
   -blockdev file,node-name=source,filename=src.img \
   -blockdev file,node-name=target,filename=dst.img \
   -object iothread,id=iothr0 \
   -device virtio-blk,drive=source,iothread=iothr0

crashes:

0  raise () at /usr/lib/libc.so.6
1  abort () at /usr/lib/libc.so.6
2  error_exit
   (err=&lt;optimized out&gt;,
   msg=msg@entry=0x55fbb1634790 &lt;__func__.27&gt; "qemu_mutex_unlock_impl")
   at ../util/qemu-thread-posix.c:37
3  qemu_mutex_unlock_impl
   (mutex=mutex@entry=0x55fbb25ab6e0,
   file=file@entry=0x55fbb1636957 "../util/async.c",
   line=line@entry=650)
   at ../util/qemu-thread-posix.c:109
4  aio_context_release (ctx=ctx@entry=0x55fbb25ab680) at ../util/async.c:650
5  bdrv_do_drained_begin
   (bs=bs@entry=0x55fbb3a87000, recursive=recursive@entry=false,
   parent=parent@entry=0x0,
   ignore_bds_parents=ignore_bds_parents@entry=false,
   poll=poll@entry=true) at ../block/io.c:441
6  bdrv_do_drained_begin
   (poll=true, ignore_bds_parents=false, parent=0x0, recursive=false,
   bs=0x55fbb3a87000) at ../block/io.c:448
7  blk_drain (blk=0x55fbb26c5a00) at ../block/block-backend.c:1718
8  blk_unref (blk=0x55fbb26c5a00) at ../block/block-backend.c:498
9  blk_unref (blk=0x55fbb26c5a00) at ../block/block-backend.c:491
10 hmp_qemu_io (mon=0x7fffaf3fc7d0, qdict=&lt;optimized out&gt;)
   at ../block/monitor/block-hmp-cmds.c:628

man pthread_mutex_unlock
...
    EPERM  The  mutex type is PTHREAD_MUTEX_ERRORCHECK or
    PTHREAD_MUTEX_RECURSIVE, or the mutex is a robust mutex, and the
    current thread does not own the mutex.

So, thread doesn't own the mutex. And we have iothread here.

Next, note that AIO_WAIT_WHILE() documents that ctx must be acquired
exactly once by caller. But where is it acquired in the call stack?
Seems nowhere.

qemuio_command do acquire aio context.. But we need context acquired
around blk_unref() as well and actually around blk_insert_bs() too.

Let's refactor qemuio_command so that it doesn't acquire aio context
but callers do that instead. This way we can cleanly acquire aio
context in hmp_qemu_io() around all three calls.

Reported-by: Max Reitz &lt;mreitz@redhat.com&gt;
Signed-off-by: Vladimir Sementsov-Ogievskiy &lt;vsementsov@virtuozzo.com&gt;
Message-Id: &lt;20210423134233.51495-1-vsementsov@virtuozzo.com&gt;
[mreitz: Fixed comment]
Signed-off-by: Max Reitz &lt;mreitz@redhat.com&gt;
</content>
</entry>
</feed>
