[PATCH 00/24] chardev handling cleanups (chardev refactors part 2)

Peter Krempa posted 24 patches 2 years, 4 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1639052639.git.pkrempa@redhat.com
src/libvirt_private.syms                      |    1 +
src/qemu/qemu_block.c                         |    1 -
src/qemu/qemu_block.h                         |    1 -
src/qemu/qemu_command.c                       | 1095 +++++++----------
src/qemu/qemu_command.h                       |    2 -
src/qemu/qemu_domain.c                        |  258 +++-
src/qemu/qemu_domain.h                        |   38 +-
src/qemu/qemu_driver.c                        |    8 +
src/qemu/qemu_hotplug.c                       |    3 -
src/qemu/qemu_process.c                       |  264 +++-
.../aarch64-tpm.aarch64-latest.args           |    2 +-
.../console-compat-auto.x86_64-latest.args    |   39 +
.../console-compat-chardev.x86_64-latest.args |   39 +
.../console-compat.x86_64-latest.args         |   38 +
.../name-escape.x86_64-latest.args            |   51 +
...arallel-parport-chardev.x86_64-latest.args |   39 +
.../parallel-tcp-chardev.x86_64-latest.args   |   39 +
.../pci-serial-dev-chardev.x86_64-latest.args |   39 +
.../ppc64-tpmproxy-with-tpm.ppc64-latest.args |    2 +-
...rial-dev-chardev-iobase.x86_64-latest.args |   39 +
.../serial-dev-chardev.x86_64-latest.args     |   39 +
.../serial-file-chardev.x86_64-latest.args    |   40 +
.../serial-file-log.x86_64-latest.args        |   40 +
.../serial-many-chardev.x86_64-latest.args    |   42 +
.../serial-pty-chardev.x86_64-latest.args     |   39 +
...erial-spiceport-nospice.x86_64-latest.args |   37 +
.../serial-spiceport.x86_64-latest.args       |   41 +
.../serial-tcp-chardev.x86_64-latest.args     |   39 +
...rial-tcp-telnet-chardev.x86_64-latest.args |   39 +
...p-tlsx509-chardev-notls.x86_64-latest.args |   41 +
...-tlsx509-chardev-verify.x86_64-latest.args |   42 +
...ial-tcp-tlsx509-chardev.x86_64-latest.args |   42 +
...-tlsx509-secret-chardev.x86_64-latest.args |   43 +
.../serial-udp-chardev.x86_64-latest.args     |   41 +
...rial-unix-missing-source.x86_64-latest.err |    1 +
.../serial-vc-chardev.x86_64-latest.args      |   39 +
.../tpm-emulator-spapr.ppc64-latest.args      |    2 +-
.../tpm-emulator-tpm2-enc.x86_64-latest.args  |    2 +-
...pm-emulator-tpm2-pstate.x86_64-latest.args |    2 +-
.../tpm-emulator-tpm2.x86_64-latest.args      |    2 +-
.../tpm-emulator.x86_64-latest.args           |    2 +-
...host-user-gpu-secondary.x86_64-latest.args |    2 +-
...irtio-options-video-ats.x86_64-latest.args |    2 +-
...tio-options-video-iommu.x86_64-latest.args |    2 +-
...io-options-video-packed.x86_64-latest.args |    2 +-
tests/qemuxml2argvtest.c                      |  114 ++
46 files changed, 1959 insertions(+), 776 deletions(-)
create mode 100644 tests/qemuxml2argvdata/console-compat-auto.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/console-compat-chardev.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/console-compat.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/name-escape.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/parallel-parport-chardev.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/parallel-tcp-chardev.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/pci-serial-dev-chardev.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/serial-file-chardev.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/serial-file-log.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/serial-many-chardev.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/serial-pty-chardev.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/serial-spiceport-nospice.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/serial-spiceport.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/serial-tcp-chardev.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/serial-tcp-telnet-chardev.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/serial-udp-chardev.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/serial-unix-missing-source.x86_64-latest.err
create mode 100644 tests/qemuxml2argvdata/serial-vc-chardev.x86_64-latest.args
[PATCH 00/24] chardev handling cleanups (chardev refactors part 2)
Posted by Peter Krempa 2 years, 4 months ago
In this part I'm cleaning up the command line generators and unifying
them. Until now there were multiple custom -chardev generators in places
where it was simpler to use it than the common code. This series fixes
the common code to have sane API and refactors virtiofs, vhost-user-blk
vhost-user-gpu and TPM code to use it.

After this series we are left with 3 distinct generators for chardev
properties:

    - commandline
    - commandline for capabilties probing
    - QMP

After the refactors here we can finally also add DO_TEST_CAPS_LATEST
of chardev tests without actually touching the host as part of the
testsuite which was impossible before.

In further parts the generators will be put into one place and prepared
for upcoming qemu refactors.

Peter Krempa (24):
  virDomainDeviceInfoIterateFlags: Export the symbol
  qemu: domain: Introduce helpers for initializing chardev backend of
    devices
  qemu: Move creation and opening of chardev backend FDs to host prepare
    step
  qemu: command: Remove unused QEMU_BUILD_CHARDEV_FILE_LOGD and
    QEMU_BUILD_CHARDEV_UNIX_FD_PASS
  qemu: command: remove the unused 'chardevStdioLogd' argument/variable
  qemu: domain: Refactor chardev definition preparing
  qemu: Store chardev 'wait' flag in chardev source private data
  qemuBuildChrChardevStr: Remove 'cdevflags' argument
  qemuBuildChrChardevStr: Remove unused arguments and clean up callers
  qemuxml2argvtest: Add DO_TEST_CAPS_LATEST versions for all character
    device tests
  qemuxml2argvtest: Add _LATEST version for 'name-escape' case
  qemuBuildConsoleCommandLine: Remove identical code
  qemuBuildChrChardevStr: Directly generate command line
  qemuBuildChardevCommand: Move earlier
  qemuBuildChardevCommand: Don't prefix alias
  qemuBuildChardevCommand: Split creation of the command and setup of
    other objects
  qemu: Store TLS config options for chardevs in
    qemuDomainChrSourcePrivate
  qemuBuildChardevCommand: Remove unused 'cfg' parameter
  qemu: Implement chardev source setup for disk
  qemu: Use qemuBuildChrChardevCommand for vhost-user disk backend
  qemu: Use qemuBuildChrChardevCommand for virtiofs backend chardev
  qemu: Use qemuBuildChrChardevCommand for vhost-user-gpu backend
    chardev
  qemu: Implement chardev source setup for tpm
  qemu: command: Use 'qemuBuildChrChardevCommand' to build TPM backend

 src/libvirt_private.syms                      |    1 +
 src/qemu/qemu_block.c                         |    1 -
 src/qemu/qemu_block.h                         |    1 -
 src/qemu/qemu_command.c                       | 1095 +++++++----------
 src/qemu/qemu_command.h                       |    2 -
 src/qemu/qemu_domain.c                        |  258 +++-
 src/qemu/qemu_domain.h                        |   38 +-
 src/qemu/qemu_driver.c                        |    8 +
 src/qemu/qemu_hotplug.c                       |    3 -
 src/qemu/qemu_process.c                       |  264 +++-
 .../aarch64-tpm.aarch64-latest.args           |    2 +-
 .../console-compat-auto.x86_64-latest.args    |   39 +
 .../console-compat-chardev.x86_64-latest.args |   39 +
 .../console-compat.x86_64-latest.args         |   38 +
 .../name-escape.x86_64-latest.args            |   51 +
 ...arallel-parport-chardev.x86_64-latest.args |   39 +
 .../parallel-tcp-chardev.x86_64-latest.args   |   39 +
 .../pci-serial-dev-chardev.x86_64-latest.args |   39 +
 .../ppc64-tpmproxy-with-tpm.ppc64-latest.args |    2 +-
 ...rial-dev-chardev-iobase.x86_64-latest.args |   39 +
 .../serial-dev-chardev.x86_64-latest.args     |   39 +
 .../serial-file-chardev.x86_64-latest.args    |   40 +
 .../serial-file-log.x86_64-latest.args        |   40 +
 .../serial-many-chardev.x86_64-latest.args    |   42 +
 .../serial-pty-chardev.x86_64-latest.args     |   39 +
 ...erial-spiceport-nospice.x86_64-latest.args |   37 +
 .../serial-spiceport.x86_64-latest.args       |   41 +
 .../serial-tcp-chardev.x86_64-latest.args     |   39 +
 ...rial-tcp-telnet-chardev.x86_64-latest.args |   39 +
 ...p-tlsx509-chardev-notls.x86_64-latest.args |   41 +
 ...-tlsx509-chardev-verify.x86_64-latest.args |   42 +
 ...ial-tcp-tlsx509-chardev.x86_64-latest.args |   42 +
 ...-tlsx509-secret-chardev.x86_64-latest.args |   43 +
 .../serial-udp-chardev.x86_64-latest.args     |   41 +
 ...rial-unix-missing-source.x86_64-latest.err |    1 +
 .../serial-vc-chardev.x86_64-latest.args      |   39 +
 .../tpm-emulator-spapr.ppc64-latest.args      |    2 +-
 .../tpm-emulator-tpm2-enc.x86_64-latest.args  |    2 +-
 ...pm-emulator-tpm2-pstate.x86_64-latest.args |    2 +-
 .../tpm-emulator-tpm2.x86_64-latest.args      |    2 +-
 .../tpm-emulator.x86_64-latest.args           |    2 +-
 ...host-user-gpu-secondary.x86_64-latest.args |    2 +-
 ...irtio-options-video-ats.x86_64-latest.args |    2 +-
 ...tio-options-video-iommu.x86_64-latest.args |    2 +-
 ...io-options-video-packed.x86_64-latest.args |    2 +-
 tests/qemuxml2argvtest.c                      |  114 ++
 46 files changed, 1959 insertions(+), 776 deletions(-)
 create mode 100644 tests/qemuxml2argvdata/console-compat-auto.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/console-compat-chardev.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/console-compat.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/name-escape.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/parallel-parport-chardev.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/parallel-tcp-chardev.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/pci-serial-dev-chardev.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/serial-file-chardev.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/serial-file-log.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/serial-many-chardev.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/serial-pty-chardev.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/serial-spiceport-nospice.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/serial-spiceport.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/serial-tcp-chardev.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/serial-tcp-telnet-chardev.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/serial-udp-chardev.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/serial-unix-missing-source.x86_64-latest.err
 create mode 100644 tests/qemuxml2argvdata/serial-vc-chardev.x86_64-latest.args

-- 
2.31.1

Re: [PATCH 00/24] chardev handling cleanups (chardev refactors part 2)
Posted by Ján Tomko 2 years, 4 months ago
On a Thursday in 2021, Peter Krempa wrote:
>In this part I'm cleaning up the command line generators and unifying
>them. Until now there were multiple custom -chardev generators in places
>where it was simpler to use it than the common code. This series fixes
>the common code to have sane API and refactors virtiofs, vhost-user-blk
>vhost-user-gpu and TPM code to use it.
>
>After this series we are left with 3 distinct generators for chardev
>properties:
>
>    - commandline
>    - commandline for capabilties probing
>    - QMP
>
>After the refactors here we can finally also add DO_TEST_CAPS_LATEST
>of chardev tests without actually touching the host as part of the
>testsuite which was impossible before.
>
>In further parts the generators will be put into one place and prepared
>for upcoming qemu refactors.
>
>Peter Krempa (24):
>  virDomainDeviceInfoIterateFlags: Export the symbol
>  qemu: domain: Introduce helpers for initializing chardev backend of
>    devices
>  qemu: Move creation and opening of chardev backend FDs to host prepare
>    step
>  qemu: command: Remove unused QEMU_BUILD_CHARDEV_FILE_LOGD and
>    QEMU_BUILD_CHARDEV_UNIX_FD_PASS
>  qemu: command: remove the unused 'chardevStdioLogd' argument/variable
>  qemu: domain: Refactor chardev definition preparing
>  qemu: Store chardev 'wait' flag in chardev source private data
>  qemuBuildChrChardevStr: Remove 'cdevflags' argument
>  qemuBuildChrChardevStr: Remove unused arguments and clean up callers
>  qemuxml2argvtest: Add DO_TEST_CAPS_LATEST versions for all character
>    device tests
>  qemuxml2argvtest: Add _LATEST version for 'name-escape' case
>  qemuBuildConsoleCommandLine: Remove identical code
>  qemuBuildChrChardevStr: Directly generate command line
>  qemuBuildChardevCommand: Move earlier
>  qemuBuildChardevCommand: Don't prefix alias
>  qemuBuildChardevCommand: Split creation of the command and setup of
>    other objects
>  qemu: Store TLS config options for chardevs in
>    qemuDomainChrSourcePrivate
>  qemuBuildChardevCommand: Remove unused 'cfg' parameter
>  qemu: Implement chardev source setup for disk
>  qemu: Use qemuBuildChrChardevCommand for vhost-user disk backend
>  qemu: Use qemuBuildChrChardevCommand for virtiofs backend chardev
>  qemu: Use qemuBuildChrChardevCommand for vhost-user-gpu backend
>    chardev
>  qemu: Implement chardev source setup for tpm
>  qemu: command: Use 'qemuBuildChrChardevCommand' to build TPM backend
>
> 46 files changed, 1959 insertions(+), 776 deletions(-)

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano