[PATCH v3 0/6] qemu: Introduce the ability to disable the built-in PS/2 controller

Kamil Szczęk posted 6 patches 3 months, 1 week ago
NEWS.rst                                      |   6 +
docs/formatdomain.rst                         |   6 +
src/conf/domain_conf.c                        |   6 +-
src/conf/domain_conf.h                        |   1 +
src/conf/domain_validate.c                    |  23 ++
src/conf/schemas/domaincommon.rng             |   5 +
src/qemu/qemu_capabilities.c                  |  35 +++
src/qemu/qemu_capabilities.h                  |   9 +-
src/qemu/qemu_command.c                       |   5 +
src/qemu/qemu_domain.c                        |  29 ++-
src/qemu/qemu_domain.h                        |   1 +
src/qemu/qemu_validate.c                      |  27 +-
.../caps_5.2.0_x86_64.replies                 | 169 ++++++++++--
.../caps_6.0.0_x86_64.replies                 | 189 ++++++++++++--
.../caps_6.1.0_x86_64.replies                 | 203 +++++++++++++--
.../caps_6.2.0_x86_64.replies                 | 212 ++++++++++++++--
.../caps_7.0.0_x86_64.replies                 | 225 ++++++++++++++--
.../caps_7.0.0_x86_64.xml                     |   1 +
.../caps_7.1.0_x86_64.replies                 | 240 ++++++++++++++++--
.../caps_7.1.0_x86_64.xml                     |   1 +
.../caps_7.2.0_x86_64+hvf.replies             | 240 ++++++++++++++++--
.../caps_7.2.0_x86_64+hvf.xml                 |   1 +
.../caps_7.2.0_x86_64.replies                 | 240 ++++++++++++++++--
.../caps_7.2.0_x86_64.xml                     |   1 +
.../caps_8.0.0_x86_64.replies                 | 240 ++++++++++++++++--
.../caps_8.0.0_x86_64.xml                     |   1 +
.../caps_8.1.0_x86_64.replies                 | 236 +++++++++++++++--
.../caps_8.1.0_x86_64.xml                     |   1 +
.../caps_8.2.0_x86_64.replies                 | 236 +++++++++++++++--
.../caps_8.2.0_x86_64.xml                     |   1 +
.../caps_9.0.0_x86_64.replies                 | 240 ++++++++++++++++--
.../caps_9.0.0_x86_64.xml                     |   1 +
.../caps_9.1.0_x86_64.replies                 | 240 ++++++++++++++++--
.../caps_9.1.0_x86_64.xml                     |   1 +
...-off-explicit-ps2-inputs.x86_64-latest.err |   1 +
.../machine-i8042-off-explicit-ps2-inputs.xml |  19 ++
...hine-i8042-off-vmport-on.x86_64-latest.err |   1 +
.../machine-i8042-off-vmport-on.xml           |  18 ++
.../machine-i8042-off.x86_64-6.2.0.err        |   1 +
.../machine-i8042-off.x86_64-latest.args      |  33 +++
.../machine-i8042-off.x86_64-latest.xml       |  32 +++
tests/qemuxmlconfdata/machine-i8042-off.xml   |  17 ++
.../machine-i8042-on.x86_64-6.2.0.err         |   1 +
.../machine-i8042-on.x86_64-latest.args       |  33 +++
.../machine-i8042-on.x86_64-latest.xml        |  34 +++
tests/qemuxmlconfdata/machine-i8042-on.xml    |  17 ++
tests/qemuxmlconftest.c                       |   6 +
47 files changed, 3024 insertions(+), 261 deletions(-)
create mode 100644 tests/qemuxmlconfdata/machine-i8042-off-explicit-ps2-inputs.x86_64-latest.err
create mode 100644 tests/qemuxmlconfdata/machine-i8042-off-explicit-ps2-inputs.xml
create mode 100644 tests/qemuxmlconfdata/machine-i8042-off-vmport-on.x86_64-latest.err
create mode 100644 tests/qemuxmlconfdata/machine-i8042-off-vmport-on.xml
create mode 100644 tests/qemuxmlconfdata/machine-i8042-off.x86_64-6.2.0.err
create mode 100644 tests/qemuxmlconfdata/machine-i8042-off.x86_64-latest.args
create mode 100644 tests/qemuxmlconfdata/machine-i8042-off.x86_64-latest.xml
create mode 100644 tests/qemuxmlconfdata/machine-i8042-off.xml
create mode 100644 tests/qemuxmlconfdata/machine-i8042-on.x86_64-6.2.0.err
create mode 100644 tests/qemuxmlconfdata/machine-i8042-on.x86_64-latest.args
create mode 100644 tests/qemuxmlconfdata/machine-i8042-on.x86_64-latest.xml
create mode 100644 tests/qemuxmlconfdata/machine-i8042-on.xml
[PATCH v3 0/6] qemu: Introduce the ability to disable the built-in PS/2 controller
Posted by Kamil Szczęk 3 months, 1 week ago
A while back QEMU introduced a new machine property for disabling the
i8042 PS/2 controller (commit 4ccd5fe22feb95137d325f422016a6473541fe9f)
which up until then was a built-in device included by all PC machine
type descendants unconditionally. This new option allowed users to
disable emulation of this controller, thus removing the default PS/2
peripherals. The rationale for why somebody might want to disable
PS/2 peripherals is explained in the aforementioned commit. This series
of patches exposes this machine property via the 'ps2' feature, while
also taking care of side-effects, such as inhibiting the implicit
creation of PS/2 inputs in the domain XML.

Changelog:

v2 -> v3:
  - Add missing example usage of the new feature

v1 -> v2:
  - Use abstract 'generic-pc' machine type instead of concrete 'pc' for
    property detection
  - Introduce test cases along with monitor replies and capability
    flags
  - Add NEWS mention of the new feature

Kamil Szczęk (6):
  qemu: Improve PS/2 controller detection
  qemu_capabilities: Introduce QEMU_CAPS_MACHINE_I8042_OPT
  qemucapabilitiesdata: Add data for QEMU_CAPS_MACHINE_I8042_OPT
  qemu: Introduce the 'ps2' feature
  qemuxmlconftest: Add test cases for the new 'ps2' feature
  NEWS: Mention the new 'ps2' feature

 NEWS.rst                                      |   6 +
 docs/formatdomain.rst                         |   6 +
 src/conf/domain_conf.c                        |   6 +-
 src/conf/domain_conf.h                        |   1 +
 src/conf/domain_validate.c                    |  23 ++
 src/conf/schemas/domaincommon.rng             |   5 +
 src/qemu/qemu_capabilities.c                  |  35 +++
 src/qemu/qemu_capabilities.h                  |   9 +-
 src/qemu/qemu_command.c                       |   5 +
 src/qemu/qemu_domain.c                        |  29 ++-
 src/qemu/qemu_domain.h                        |   1 +
 src/qemu/qemu_validate.c                      |  27 +-
 .../caps_5.2.0_x86_64.replies                 | 169 ++++++++++--
 .../caps_6.0.0_x86_64.replies                 | 189 ++++++++++++--
 .../caps_6.1.0_x86_64.replies                 | 203 +++++++++++++--
 .../caps_6.2.0_x86_64.replies                 | 212 ++++++++++++++--
 .../caps_7.0.0_x86_64.replies                 | 225 ++++++++++++++--
 .../caps_7.0.0_x86_64.xml                     |   1 +
 .../caps_7.1.0_x86_64.replies                 | 240 ++++++++++++++++--
 .../caps_7.1.0_x86_64.xml                     |   1 +
 .../caps_7.2.0_x86_64+hvf.replies             | 240 ++++++++++++++++--
 .../caps_7.2.0_x86_64+hvf.xml                 |   1 +
 .../caps_7.2.0_x86_64.replies                 | 240 ++++++++++++++++--
 .../caps_7.2.0_x86_64.xml                     |   1 +
 .../caps_8.0.0_x86_64.replies                 | 240 ++++++++++++++++--
 .../caps_8.0.0_x86_64.xml                     |   1 +
 .../caps_8.1.0_x86_64.replies                 | 236 +++++++++++++++--
 .../caps_8.1.0_x86_64.xml                     |   1 +
 .../caps_8.2.0_x86_64.replies                 | 236 +++++++++++++++--
 .../caps_8.2.0_x86_64.xml                     |   1 +
 .../caps_9.0.0_x86_64.replies                 | 240 ++++++++++++++++--
 .../caps_9.0.0_x86_64.xml                     |   1 +
 .../caps_9.1.0_x86_64.replies                 | 240 ++++++++++++++++--
 .../caps_9.1.0_x86_64.xml                     |   1 +
 ...-off-explicit-ps2-inputs.x86_64-latest.err |   1 +
 .../machine-i8042-off-explicit-ps2-inputs.xml |  19 ++
 ...hine-i8042-off-vmport-on.x86_64-latest.err |   1 +
 .../machine-i8042-off-vmport-on.xml           |  18 ++
 .../machine-i8042-off.x86_64-6.2.0.err        |   1 +
 .../machine-i8042-off.x86_64-latest.args      |  33 +++
 .../machine-i8042-off.x86_64-latest.xml       |  32 +++
 tests/qemuxmlconfdata/machine-i8042-off.xml   |  17 ++
 .../machine-i8042-on.x86_64-6.2.0.err         |   1 +
 .../machine-i8042-on.x86_64-latest.args       |  33 +++
 .../machine-i8042-on.x86_64-latest.xml        |  34 +++
 tests/qemuxmlconfdata/machine-i8042-on.xml    |  17 ++
 tests/qemuxmlconftest.c                       |   6 +
 47 files changed, 3024 insertions(+), 261 deletions(-)
 create mode 100644 tests/qemuxmlconfdata/machine-i8042-off-explicit-ps2-inputs.x86_64-latest.err
 create mode 100644 tests/qemuxmlconfdata/machine-i8042-off-explicit-ps2-inputs.xml
 create mode 100644 tests/qemuxmlconfdata/machine-i8042-off-vmport-on.x86_64-latest.err
 create mode 100644 tests/qemuxmlconfdata/machine-i8042-off-vmport-on.xml
 create mode 100644 tests/qemuxmlconfdata/machine-i8042-off.x86_64-6.2.0.err
 create mode 100644 tests/qemuxmlconfdata/machine-i8042-off.x86_64-latest.args
 create mode 100644 tests/qemuxmlconfdata/machine-i8042-off.x86_64-latest.xml
 create mode 100644 tests/qemuxmlconfdata/machine-i8042-off.xml
 create mode 100644 tests/qemuxmlconfdata/machine-i8042-on.x86_64-6.2.0.err
 create mode 100644 tests/qemuxmlconfdata/machine-i8042-on.x86_64-latest.args
 create mode 100644 tests/qemuxmlconfdata/machine-i8042-on.x86_64-latest.xml
 create mode 100644 tests/qemuxmlconfdata/machine-i8042-on.xml

-- 
2.45.0
Re: [PATCH v3 0/6] qemu: Introduce the ability to disable the built-in PS/2 controller
Posted by Michal Prívozník 3 months, 1 week ago
On 8/19/24 03:16, Kamil Szczęk wrote:
> A while back QEMU introduced a new machine property for disabling the
> i8042 PS/2 controller (commit 4ccd5fe22feb95137d325f422016a6473541fe9f)
> which up until then was a built-in device included by all PC machine
> type descendants unconditionally. This new option allowed users to
> disable emulation of this controller, thus removing the default PS/2
> peripherals. The rationale for why somebody might want to disable
> PS/2 peripherals is explained in the aforementioned commit. This series
> of patches exposes this machine property via the 'ps2' feature, while
> also taking care of side-effects, such as inhibiting the implicit
> creation of PS/2 inputs in the domain XML.
> 
> Changelog:
> 
> v2 -> v3:
>   - Add missing example usage of the new feature
> 
> v1 -> v2:
>   - Use abstract 'generic-pc' machine type instead of concrete 'pc' for
>     property detection
>   - Introduce test cases along with monitor replies and capability
>     flags
>   - Add NEWS mention of the new feature
> 
> Kamil Szczęk (6):
>   qemu: Improve PS/2 controller detection
>   qemu_capabilities: Introduce QEMU_CAPS_MACHINE_I8042_OPT
>   qemucapabilitiesdata: Add data for QEMU_CAPS_MACHINE_I8042_OPT
>   qemu: Introduce the 'ps2' feature
>   qemuxmlconftest: Add test cases for the new 'ps2' feature
>   NEWS: Mention the new 'ps2' feature
> 
>  NEWS.rst                                      |   6 +
>  docs/formatdomain.rst                         |   6 +
>  src/conf/domain_conf.c                        |   6 +-
>  src/conf/domain_conf.h                        |   1 +
>  src/conf/domain_validate.c                    |  23 ++
>  src/conf/schemas/domaincommon.rng             |   5 +
>  src/qemu/qemu_capabilities.c                  |  35 +++
>  src/qemu/qemu_capabilities.h                  |   9 +-
>  src/qemu/qemu_command.c                       |   5 +
>  src/qemu/qemu_domain.c                        |  29 ++-
>  src/qemu/qemu_domain.h                        |   1 +
>  src/qemu/qemu_validate.c                      |  27 +-
>  .../caps_5.2.0_x86_64.replies                 | 169 ++++++++++--
>  .../caps_6.0.0_x86_64.replies                 | 189 ++++++++++++--
>  .../caps_6.1.0_x86_64.replies                 | 203 +++++++++++++--
>  .../caps_6.2.0_x86_64.replies                 | 212 ++++++++++++++--
>  .../caps_7.0.0_x86_64.replies                 | 225 ++++++++++++++--
>  .../caps_7.0.0_x86_64.xml                     |   1 +
>  .../caps_7.1.0_x86_64.replies                 | 240 ++++++++++++++++--
>  .../caps_7.1.0_x86_64.xml                     |   1 +
>  .../caps_7.2.0_x86_64+hvf.replies             | 240 ++++++++++++++++--
>  .../caps_7.2.0_x86_64+hvf.xml                 |   1 +
>  .../caps_7.2.0_x86_64.replies                 | 240 ++++++++++++++++--
>  .../caps_7.2.0_x86_64.xml                     |   1 +
>  .../caps_8.0.0_x86_64.replies                 | 240 ++++++++++++++++--
>  .../caps_8.0.0_x86_64.xml                     |   1 +
>  .../caps_8.1.0_x86_64.replies                 | 236 +++++++++++++++--
>  .../caps_8.1.0_x86_64.xml                     |   1 +
>  .../caps_8.2.0_x86_64.replies                 | 236 +++++++++++++++--
>  .../caps_8.2.0_x86_64.xml                     |   1 +
>  .../caps_9.0.0_x86_64.replies                 | 240 ++++++++++++++++--
>  .../caps_9.0.0_x86_64.xml                     |   1 +
>  .../caps_9.1.0_x86_64.replies                 | 240 ++++++++++++++++--
>  .../caps_9.1.0_x86_64.xml                     |   1 +
>  ...-off-explicit-ps2-inputs.x86_64-latest.err |   1 +
>  .../machine-i8042-off-explicit-ps2-inputs.xml |  19 ++
>  ...hine-i8042-off-vmport-on.x86_64-latest.err |   1 +
>  .../machine-i8042-off-vmport-on.xml           |  18 ++
>  .../machine-i8042-off.x86_64-6.2.0.err        |   1 +
>  .../machine-i8042-off.x86_64-latest.args      |  33 +++
>  .../machine-i8042-off.x86_64-latest.xml       |  32 +++
>  tests/qemuxmlconfdata/machine-i8042-off.xml   |  17 ++
>  .../machine-i8042-on.x86_64-6.2.0.err         |   1 +
>  .../machine-i8042-on.x86_64-latest.args       |  33 +++
>  .../machine-i8042-on.x86_64-latest.xml        |  34 +++
>  tests/qemuxmlconfdata/machine-i8042-on.xml    |  17 ++
>  tests/qemuxmlconftest.c                       |   6 +
>  47 files changed, 3024 insertions(+), 261 deletions(-)
>  create mode 100644 tests/qemuxmlconfdata/machine-i8042-off-explicit-ps2-inputs.x86_64-latest.err
>  create mode 100644 tests/qemuxmlconfdata/machine-i8042-off-explicit-ps2-inputs.xml
>  create mode 100644 tests/qemuxmlconfdata/machine-i8042-off-vmport-on.x86_64-latest.err
>  create mode 100644 tests/qemuxmlconfdata/machine-i8042-off-vmport-on.xml
>  create mode 100644 tests/qemuxmlconfdata/machine-i8042-off.x86_64-6.2.0.err
>  create mode 100644 tests/qemuxmlconfdata/machine-i8042-off.x86_64-latest.args
>  create mode 100644 tests/qemuxmlconfdata/machine-i8042-off.x86_64-latest.xml
>  create mode 100644 tests/qemuxmlconfdata/machine-i8042-off.xml
>  create mode 100644 tests/qemuxmlconfdata/machine-i8042-on.x86_64-6.2.0.err
>  create mode 100644 tests/qemuxmlconfdata/machine-i8042-on.x86_64-latest.args
>  create mode 100644 tests/qemuxmlconfdata/machine-i8042-on.x86_64-latest.xml
>  create mode 100644 tests/qemuxmlconfdata/machine-i8042-on.xml
> 

We require that we're able to compile and tests pass after each commit
(it's easier when we need to bisect something in the future). Therefore,
I'm squashing 3/6 into 2/6.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

and merged. Congratulations in your first libvirt contribution!

Michal
Re: [PATCH v3 0/6] qemu: Introduce the ability to disable the built-in PS/2 controller
Posted by Kamil Szczęk 3 months, 1 week ago
On Wednesday, August 21st, 2024 at 17:15, Michal Prívozník <mprivozn@redhat.com> wrote:

> We require that we're able to compile and tests pass after each commit
> (it's easier when we need to bisect something in the future). Therefore,
> I'm squashing 3/6 into 2/6.

Makes sense, will keep that in mind.

> and merged. Congratulations in your first libvirt contribution!

Awesome, thanks. Looking forward to contributing further!
Re: [PATCH v3 0/6] qemu: Introduce the ability to disable the built-in PS/2 controller
Posted by Andrea Bolognani 3 months ago
On Wed, Aug 21, 2024 at 03:36:03PM GMT, Kamil Szczęk wrote:
> On Wednesday, August 21st, 2024 at 17:15, Michal Prívozník <mprivozn@redhat.com> wrote:
>
> > We require that we're able to compile and tests pass after each commit
> > (it's easier when we need to bisect something in the future). Therefore,
> > I'm squashing 3/6 into 2/6.
>
> Makes sense, will keep that in mind.
>
> > and merged. Congratulations in your first libvirt contribution!
>
> Awesome, thanks. Looking forward to contributing further!

I think the availability of this new feature should be advertised in
the domain capabilities XML.

That way, management applications such as virt-manager will be able
to detect its presence and decide to ditch PS/2 completely for
headless VMs, where it's not necessary to have any input devices.

For VMs with graphics, they could add a USB keyboard to go along with
the USB tablet that is already added, instead of the current combo of
PS/2 keyboard and mouse *plus* USB tablet, for a slightly cleaner
overall configuration matching that of other architectures that are
not beholden to the same legacy as x86.

-- 
Andrea Bolognani / Red Hat / Virtualization
Re: [PATCH v3 0/6] qemu: Introduce the ability to disable the built-in PS/2 controller
Posted by Andrea Bolognani 3 months ago
On Tue, Aug 27, 2024 at 05:14:21AM GMT, Andrea Bolognani wrote:
> On Wed, Aug 21, 2024 at 03:36:03PM GMT, Kamil Szczęk wrote:
> > On Wednesday, August 21st, 2024 at 17:15, Michal Prívozník <mprivozn@redhat.com> wrote:
> > > We require that we're able to compile and tests pass after each commit
> > > (it's easier when we need to bisect something in the future). Therefore,
> > > I'm squashing 3/6 into 2/6.
> >
> > Makes sense, will keep that in mind.
> >
> > > and merged. Congratulations in your first libvirt contribution!
> >
> > Awesome, thanks. Looking forward to contributing further!
>
> I think the availability of this new feature should be advertised in
> the domain capabilities XML.
>
> That way, management applications such as virt-manager will be able
> to detect its presence and decide to ditch PS/2 completely for
> headless VMs, where it's not necessary to have any input devices.
>
> For VMs with graphics, they could add a USB keyboard to go along with
> the USB tablet that is already added, instead of the current combo of
> PS/2 keyboard and mouse *plus* USB tablet, for a slightly cleaner
> overall configuration matching that of other architectures that are
> not beholden to the same legacy as x86.

Patches here:

  https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/MY7APHGASWQ2SNGK2T3DFRKYWEYXBKTS/

Ignore the fact that hyperkitty-- is currently completely broken and
only shows the cover letter :(

-- 
Andrea Bolognani / Red Hat / Virtualization