[libvirt] [PATCH v3 20/28] conf: Add target type and model for pl011

Pavel Hrdina phrdina at redhat.com
Mon Nov 27 16:05:57 UTC 2017


On Sun, Nov 26, 2017 at 11:25:41PM +0100, Andrea Bolognani wrote:
> We can finally introduce a specific target model for the pl011 device
> used by mach-virt guests, which means isa-serial will no longer show
> up to confuse users.
> 
> We make sure migration works in both directions by interpreting the
> isa-serial target type, or the lack of target type, appropriately
> when parsing the guest XML, and skipping the newly-introduced type
> when formatting if for migration. We also verify that pl011 is not
> used for non-mach-virt guests and add a bunch of test cases.
> 
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=151292
> 
> Signed-off-by: Andrea Bolognani <abologna at redhat.com>
> ---
>  docs/formatdomain.html.in                          |  8 ++--
>  docs/schemas/domaincommon.rng                      |  2 +
>  src/conf/domain_conf.c                             |  3 ++
>  src/conf/domain_conf.h                             |  2 +
>  src/qemu/qemu_command.c                            |  9 ++++-
>  src/qemu/qemu_domain.c                             | 26 +++++++++++++
>  src/qemu/qemu_domain_address.c                     |  1 +
>  .../qemuxml2argv-mach-virt-console-native.args     |  1 +
>  .../qemuxml2argv-mach-virt-console-native.xml      | 17 +++++++++
>  .../qemuxml2argv-mach-virt-console-virtio.args     | 24 ++++++++++++
>  .../qemuxml2argv-mach-virt-console-virtio.xml      | 19 ++++++++++
>  ...muxml2argv-mach-virt-serial+console-native.args |  1 +
>  ...emuxml2argv-mach-virt-serial+console-native.xml | 18 +++++++++
>  .../qemuxml2argv-mach-virt-serial-compat.args      |  1 +
>  .../qemuxml2argv-mach-virt-serial-compat.xml       | 19 ++++++++++
>  ...muxml2argv-mach-virt-serial-invalid-machine.xml | 21 +++++++++++
>  .../qemuxml2argv-mach-virt-serial-native.args      | 23 +++++++++++
>  .../qemuxml2argv-mach-virt-serial-native.xml       | 16 ++++++++
>  .../qemuxml2argv-mach-virt-serial-pci.args         | 26 +++++++++++++
>  .../qemuxml2argv-mach-virt-serial-pci.xml          | 18 +++++++++
>  .../qemuxml2argv-mach-virt-serial-usb.args         | 27 +++++++++++++
>  .../qemuxml2argv-mach-virt-serial-usb.xml          | 21 +++++++++++
>  tests/qemuxml2argvtest.c                           | 27 +++++++++++++
>  .../qemuxml2xmlout-aarch64-virtio-pci-default.xml  |  4 +-
>  .../qemuxml2xmlout-mach-virt-console-native.xml    |  1 +
>  .../qemuxml2xmlout-mach-virt-console-virtio.xml    | 27 +++++++++++++
>  ...uxml2xmlout-mach-virt-serial+console-native.xml |  1 +
>  .../qemuxml2xmlout-mach-virt-serial-compat.xml     | 31 +++++++++++++++
>  .../qemuxml2xmlout-mach-virt-serial-native.xml     |  1 +
>  .../qemuxml2xmlout-mach-virt-serial-pci.xml        | 44 ++++++++++++++++++++++
>  .../qemuxml2xmlout-mach-virt-serial-usb.xml        | 41 ++++++++++++++++++++
>  tests/qemuxml2xmltest.c                            | 26 +++++++++++++
>  32 files changed, 500 insertions(+), 6 deletions(-)
>  create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-native.args
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-native.xml
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-virtio.args
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-virtio.xml
>  create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial+console-native.args
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial+console-native.xml
>  create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-compat.args
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-compat.xml
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-invalid-machine.xml
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-native.args
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-native.xml
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-pci.args
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-pci.xml
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-usb.args
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-usb.xml
>  create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-console-native.xml
>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-console-virtio.xml
>  create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial+console-native.xml
>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-compat.xml
>  create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-native.xml
>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-pci.xml
>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-usb.xml
> 
> diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
> index 222504a06..16bf4fd5e 100644
> --- a/docs/formatdomain.html.in
> +++ b/docs/formatdomain.html.in
> @@ -6548,8 +6548,9 @@ qemu-kvm -net nic,model=? /dev/null
>        <code>usb-serial</code> (usable whenever USB support is available)
>        and <code>pci-serial</code> (usable whenever PCI support is available);
>        <span class="since">since 3.10.0</span>,
> -      <code>spapr-vio-serial</code> (usable with ppc64/pSeries guests)
> -      is available as well.
> +      <code>spapr-vio-serial</code> (usable with ppc64/pSeries guests) and
> +      <code>system-serial</code> (usable with aarch64/virt guests) are
> +      available as well.
>      </p>
>  
>      <p>
> @@ -6561,7 +6562,8 @@ qemu-kvm -net nic,model=? /dev/null
>        target type); <code>pci-serial</code>
>        (usable with the <code>pci-serial</code> target type);
>        <code>spapr-vty</code> (usable with the <code>spapr-vio-serial</code>
> -      target type).
> +      target type); <code>pl011</code> (usable with the
> +      <code>system-serial</code> target type).

In this patch we should document that system-serial type doesn't have
any address therefore no <address/> element.

One thing that I've just realized is that there is no capability check
whether that device exists.  In QEMU it's configurable so there can
be QEMU compiled without this device, however, by default it's enabled.

I would compare it to the isa-serial, in most cases it will be enabled
by default so there is no need to have the capability check but since
you are adding that check, you can add this one as well, or drop the
isa-serial capability check :).

Otherwise this patch looks good so:

Reviewed-by: Pavel Hrdina <phrdina at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20171127/90b3082e/attachment-0001.sig>


More information about the libvir-list mailing list