[PATCH RFC 0/1] an extensible SetUIInfo2 design

Chengyang Zhu posted 1 patch 1 month, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260807084050.526109-1-colazcyg@gmail.com
Maintainers: "Marc-André Lureau" <marcandre.lureau@redhat.com>
ui/dbus-console.c    | 56 ++++++++++++++++++++++++++++++++++++++++++++
ui/dbus-display1.xml | 17 ++++++++++++++
2 files changed, 73 insertions(+)
[PATCH RFC 0/1] an extensible SetUIInfo2 design
Posted by Chengyang Zhu 1 month, 3 weeks ago
Currently, the `SetUIInfo` method cannot set a refresh rate.
Simply adding a refresh_rate argument would break the method signature.

This RFC adds the `SetUIInfo2` method and `QemuUIInfoTypes` property.
  * `SetUIInfo2` takes a dictionary,
    allowing partial updates and adding more keys in the future.
  * `QemuUIInfoTypes` exposes the schema of `SetUIInfo2`'s argument.

This patch is a proof-of-concept and it needs further discussion on:
  * public API design (the name and the signature)
  * partial update behavior (only updating the recognized fields)
  * error handling (ignore the wrong keys or return an error?)

Test results:
  * qemu:qtest-x86_64/dbus-display-test passed
  * qemu:qtest-x86_64/dbus-vmstate-test passed
  * qemu:qtest-x86_64/dbus-vnc-test SKIP
  * manually created a virtual machine
    and successfully set its refresh rate and resolution via `SetUIInfo2`

Chengyang Zhu (1):
  ui/dbus: add extensible SetUIInfo2 method

 ui/dbus-console.c    | 56 ++++++++++++++++++++++++++++++++++++++++++++
 ui/dbus-display1.xml | 17 ++++++++++++++
 2 files changed, 73 insertions(+)

-- 
2.55.0
Re: [PATCH RFC 0/1] an extensible SetUIInfo2 design
Posted by Marc-André Lureau 1 month, 2 weeks ago
Hi Chengyang

On Fri, Aug 7, 2026 at 4:12 PM Chengyang Zhu <colazcyg@gmail.com> wrote:
>
> Currently, the `SetUIInfo` method cannot set a refresh rate.
> Simply adding a refresh_rate argument would break the method signature.
>
> This RFC adds the `SetUIInfo2` method and `QemuUIInfoTypes` property.
>   * `SetUIInfo2` takes a dictionary,
>     allowing partial updates and adding more keys in the future.
>   * `QemuUIInfoTypes` exposes the schema of `SetUIInfo2`'s argument.
>
> This patch is a proof-of-concept and it needs further discussion on:
>   * public API design (the name and the signature)
>   * partial update behavior (only updating the recognized fields)
>   * error handling (ignore the wrong keys or return an error?)
>

It's an interesting design to use an extensible dict for arguments,
but it's not very idiomatic or discoverable by existing tools.

Instead, can we introduce an extra interface org.qemu.Display1.UIInfo
with the properties and an Apply() method that applies the staged
values?

> Test results:
>   * qemu:qtest-x86_64/dbus-display-test passed
>   * qemu:qtest-x86_64/dbus-vmstate-test passed
>   * qemu:qtest-x86_64/dbus-vnc-test SKIP
>   * manually created a virtual machine
>     and successfully set its refresh rate and resolution via `SetUIInfo2`
>
> Chengyang Zhu (1):
>   ui/dbus: add extensible SetUIInfo2 method
>
>  ui/dbus-console.c    | 56 ++++++++++++++++++++++++++++++++++++++++++++
>  ui/dbus-display1.xml | 17 ++++++++++++++
>  2 files changed, 73 insertions(+)
>
> --
> 2.55.0
>
>