<feed xmlns='http://www.w3.org/2005/Atom'>
<title>qemu/monitor, branch master</title>
<subtitle>QEMU development tree</subtitle>
<id>https://git.zx2c4.com/qemu/atom/monitor?h=master</id>
<link rel='self' href='https://git.zx2c4.com/qemu/atom/monitor?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/'/>
<updated>2024-06-24T09:14:17Z</updated>
<entry>
<title>gdbstub: move enums into separate header</title>
<updated>2024-06-24T09:14:17Z</updated>
<author>
<name>Alex Bennée</name>
<email>alex.bennee@linaro.org</email>
</author>
<published>2024-06-20T15:22:10Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=5b7d54d4ed7857b8b27fb040c6027ba59e003889'/>
<id>urn:sha1:5b7d54d4ed7857b8b27fb040c6027ba59e003889</id>
<content type='text'>
This is an experiment to further reduce the amount we throw into the
exec headers. It might not be as useful as I initially thought because
just under half of the users also need gdbserver_start().

Reviewed-by: Pierrick Bouvier &lt;pierrick.bouvier@linaro.org&gt;
Signed-off-by: Alex Bennée &lt;alex.bennee@linaro.org&gt;
Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Message-Id: &lt;20240620152220.2192768-3-alex.bennee@linaro.org&gt;
</content>
</entry>
<entry>
<title>monitor: fdset: Match against O_DIRECT</title>
<updated>2024-06-21T12:47:22Z</updated>
<author>
<name>Fabiano Rosas</name>
<email>farosas@suse.de</email>
</author>
<published>2024-06-17T18:57:29Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=99c147e2f53726290bbdde795b6efbb4d9138657'/>
<id>urn:sha1:99c147e2f53726290bbdde795b6efbb4d9138657</id>
<content type='text'>
We're about to enable the use of O_DIRECT in the migration code and
due to the alignment restrictions imposed by filesystems we need to
make sure the flag is only used when doing aligned IO.

The migration will do parallel IO to different regions of a file, so
we need to use more than one file descriptor. Those cannot be obtained
by duplicating (dup()) since duplicated file descriptors share the
file status flags, including O_DIRECT. If one migration channel does
unaligned IO while another sets O_DIRECT to do aligned IO, the
filesystem would fail the unaligned operation.

The add-fd QMP command along with the fdset code are specifically
designed to allow the user to pass a set of file descriptors with
different access flags into QEMU to be later fetched by code that
needs to alternate between those flags when doing IO.

Extend the fdset matching to behave the same with the O_DIRECT flag.

Reviewed-by: Peter Xu &lt;peterx@redhat.com&gt;
Signed-off-by: Fabiano Rosas &lt;farosas@suse.de&gt;
</content>
</entry>
<entry>
<title>monitor: Report errors from monitor_fdset_dup_fd_add</title>
<updated>2024-06-21T12:47:21Z</updated>
<author>
<name>Fabiano Rosas</name>
<email>farosas@suse.de</email>
</author>
<published>2024-06-17T18:57:24Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=960f29b347ad34a53580fa822083d51ba7851b7b'/>
<id>urn:sha1:960f29b347ad34a53580fa822083d51ba7851b7b</id>
<content type='text'>
I'm keeping the EACCES because callers expect to be able to look at
errno.

Reviewed-by: Peter Xu &lt;peterx@redhat.com&gt;
Signed-off-by: Fabiano Rosas &lt;farosas@suse.de&gt;
</content>
</entry>
<entry>
<title>monitor: Simplify fdset and fd removal</title>
<updated>2024-06-21T12:47:21Z</updated>
<author>
<name>Fabiano Rosas</name>
<email>farosas@suse.de</email>
</author>
<published>2024-06-17T18:57:23Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=881172f3f9dfe5764e7cb8983e5a660b93224d0c'/>
<id>urn:sha1:881172f3f9dfe5764e7cb8983e5a660b93224d0c</id>
<content type='text'>
Remove fds right away instead of setting the -&gt;removed flag. We don't
need the extra complexity of having a cleanup function reap the
removed entries at a later time.

Reviewed-by: Peter Xu &lt;peterx@redhat.com&gt;
Signed-off-by: Fabiano Rosas &lt;farosas@suse.de&gt;
</content>
</entry>
<entry>
<title>monitor: Stop removing non-duplicated fds</title>
<updated>2024-06-21T12:44:53Z</updated>
<author>
<name>Fabiano Rosas</name>
<email>farosas@suse.de</email>
</author>
<published>2024-06-17T18:57:22Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=87d67fadb9db5e87072c244df794c0755150fd2a'/>
<id>urn:sha1:87d67fadb9db5e87072c244df794c0755150fd2a</id>
<content type='text'>
monitor_fdsets_cleanup() currently has three responsibilities:

1- Remove the fds that have been marked for removal(-&gt;removed=true) by
   qmp_remove_fd(). This is overly complicated, but ok.

2- Remove any file descriptors that have been passed into QEMU and
   never duplicated[1,2]. A file descriptor without duplicates
   indicates that no part of QEMU has made use of it. This is
   problematic because the current implementation does it only if the
   guest is not running and the monitor is closed.

3- Remove/free fdsets that have become empty due to the above
   removals. This is ok.

The scenario described in (2) is starting to show some cracks now that
we're trying to consume fds from the migration code:

- Doing cleanup every time the last monitor connection closes works to
  reap unused fds, but also has the side effect of forcing the
  management layer to pass the file descriptors again in case of a
  disconnect/re-connect, if that happened to be the only monitor
  connection.

  Another side effect is that removing an fd with qmp_remove_fd() is
  effectively delayed until the last monitor connection closes.

  The usage of mon_refcount is also problematic because it's racy.

- Checking runstate_is_running() skips the cleanup unless the VM is
  running and avoids premature cleanup of the fds, but also has the
  side effect of blocking the legitimate removal of an fd via
  qmp_remove_fd() if the VM happens to be in another state.

  This affects qmp_remove_fd() and qmp_query_fdsets() in particular
  because requesting a removal at a bad time (guest stopped) might
  cause an fd to never be removed, or to be removed at a much later
  point in time, causing the query command to continue showing the
  supposedly removed fd/fdset.

Note that file descriptors that *have* been duplicated are owned by
the code that uses them and will be removed after qemu_close() is
called. Therefore we've decided that the best course of action to
avoid the undesired side-effects is to stop managing non-duplicated
file descriptors.

1- efb87c1697 ("monitor: Clean up fd sets on monitor disconnect")
2- ebe52b592d ("monitor: Prevent removing fd from set during init")

Reviewed-by: Peter Xu &lt;peterx@redhat.com&gt;
[fix logic mistake: s/fdset_free/fdset_free_if_empty]
Signed-off-by: Fabiano Rosas &lt;farosas@suse.de&gt;
</content>
</entry>
<entry>
<title>monitor: Introduce monitor_fdset_*free</title>
<updated>2024-06-20T13:42:24Z</updated>
<author>
<name>Fabiano Rosas</name>
<email>farosas@suse.de</email>
</author>
<published>2024-06-17T18:57:21Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=a93ad56053e54a94875faabb042d7c60fdd2fe20'/>
<id>urn:sha1:a93ad56053e54a94875faabb042d7c60fdd2fe20</id>
<content type='text'>
Introduce new functions to remove and free no longer used fds and
fdsets.

We need those to decouple the remove/free routines from
monitor_fdset_cleanup() which will go away in the next patches.

The new functions:

- monitor_fdset_free/_if_empty() will be used when a monitor
  connection closes and when an fd is removed to cleanup any fdset
  that is now empty.

- monitor_fdset_fd_free() will be used to remove one or more fds that
  have been explicitly targeted by qmp_remove_fd().

Reviewed-by: Peter Xu &lt;peterx@redhat.com&gt;
Signed-off-by: Fabiano Rosas &lt;farosas@suse.de&gt;
</content>
</entry>
<entry>
<title>monitor: Drop monitor_fdset_dup_fd_find/_remove()</title>
<updated>2024-06-20T13:42:24Z</updated>
<author>
<name>Peter Xu</name>
<email>peterx@redhat.com</email>
</author>
<published>2024-06-17T18:57:20Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=1cd93fb0bf8b1fddab4c38e17145cc8776eadaa0'/>
<id>urn:sha1:1cd93fb0bf8b1fddab4c38e17145cc8776eadaa0</id>
<content type='text'>
Those functions are not needed, one remove function should already
work.  Clean it up.

Here the code doesn't really care about whether we need to keep that dupfd
around if close() failed: when that happens something got very wrong,
keeping the dup_fd around the fdsets may not help that situation so far.

Cc: Dr. David Alan Gilbert &lt;dave@treblig.org&gt;
Cc: Markus Armbruster &lt;armbru@redhat.com&gt;
Cc: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Cc: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Cc: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
Signed-off-by: Peter Xu &lt;peterx@redhat.com&gt;
Reviewed-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
[add missing return statement, removal during traversal is not safe]
Signed-off-by: Fabiano Rosas &lt;farosas@suse.de&gt;
</content>
</entry>
<entry>
<title>hw/intc: Introduce x-query-interrupt-controllers QMP command</title>
<updated>2024-06-19T10:40:49Z</updated>
<author>
<name>Philippe Mathieu-Daudé</name>
<email>philmd@linaro.org</email>
</author>
<published>2024-06-07T14:37:24Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=795eaa62fa68c452b926fbfc4ccdcb4cd1552531'/>
<id>urn:sha1:795eaa62fa68c452b926fbfc4ccdcb4cd1552531</id>
<content type='text'>
This is a counterpart to the HMP "info pic" command. It is being
added with an "x-" prefix because this QMP command is intended as an
adhoc debugging tool and will thus not be modelled in QAPI as fully
structured data, nor will it have long term guaranteed stability.
The existing HMP command is rewritten to call the QMP command.

Signed-off-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Reviewed-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
Message-Id: &lt;20240610063518.50680-3-philmd@linaro.org&gt;
</content>
</entry>
<entry>
<title>hw/intc: Avoid using Monitor in INTERRUPT_STATS_PROVIDER::print_info()</title>
<updated>2024-06-19T10:40:49Z</updated>
<author>
<name>Philippe Mathieu-Daudé</name>
<email>philmd@linaro.org</email>
</author>
<published>2024-06-07T10:47:04Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=b2580720d026fa1591218468891a47f42be6a335'/>
<id>urn:sha1:b2580720d026fa1591218468891a47f42be6a335</id>
<content type='text'>
Replace Monitor API by HumanReadableText one (see commit f2de406f29
"docs/devel: document expectations for QAPI data modelling for QMP"
for rationale).

Signed-off-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Reviewed-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
Message-Id: &lt;20240610063518.50680-2-philmd@linaro.org&gt;
</content>
</entry>
<entry>
<title>kconfig: allow compiling out QEMU device tree code per target</title>
<updated>2024-05-10T13:45:15Z</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2024-05-07T12:13:46Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=1935b7ead18dbcbf459dbe7a8fd4253fbe1ed4d0'/>
<id>urn:sha1:1935b7ead18dbcbf459dbe7a8fd4253fbe1ed4d0</id>
<content type='text'>
Introduce a new Kconfig symbol, CONFIG_DEVICE_TREE, that specifies whether
to include the common device tree code in system/device_tree.c and to
link to libfdt.  For now, include it unconditionally if libfdt is
available.

Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
</feed>
