On Wed, Nov 15, 2017 at 12:50:10PM +0100, Andrea Bolognani wrote:
We can finally introduce a specific target type for the spapr-vty
device used by pSeries 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 spapr-vty is
not used for non-pSeries guests and add a bunch of test cases.
This commit is best viewed with 'git diff -w'.
It would be probably good idea to split it into two patches, one
that changes all the if-else conditions to switch and second where
the actual new code is introduced.
Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=1511421
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
docs/formatdomain.html.in | 11 +-
docs/schemas/domaincommon.rng | 1 +
src/conf/domain_conf.c | 5 +-
src/conf/domain_conf.h | 1 +
src/qemu/qemu_command.c | 115 +++++++++++----------
src/qemu/qemu_domain.c | 38 ++++++-
src/qemu/qemu_domain_address.c | 1 +
.../qemuxml2argv-pseries-basic.args | 2 +-
.../qemuxml2argv-pseries-console-native.args | 1 +
.../qemuxml2argv-pseries-console-native.xml | 17 +++
...gs => qemuxml2argv-pseries-console-virtio.args} | 10 +-
.../qemuxml2argv-pseries-console-virtio.xml | 19 ++++
.../qemuxml2argv-pseries-cpu-compat-power9.args | 2 +-
.../qemuxml2argv-pseries-cpu-compat.args | 2 +-
.../qemuxml2argv-pseries-cpu-exact.args | 2 +-
.../qemuxml2argv-pseries-cpu-le.args | 2 +-
.../qemuxml2argv-pseries-panic-missing.args | 2 +-
.../qemuxml2argv-pseries-panic-no-address.args | 2 +-
...qemuxml2argv-pseries-serial+console-native.args | 1 +
.../qemuxml2argv-pseries-serial+console-native.xml | 18 ++++
.../qemuxml2argv-pseries-serial-compat.args | 1 +
.../qemuxml2argv-pseries-serial-compat.xml | 19 ++++
...qemuxml2argv-pseries-serial-invalid-machine.xml | 19 ++++
...rgs => qemuxml2argv-pseries-serial-native.args} | 7 +-
.../qemuxml2argv-pseries-serial-native.xml | 16 +++
.../qemuxml2argv-pseries-usb-default.args | 2 +-
.../qemuxml2argv-pseries-usb-kbd.args | 2 +-
.../qemuxml2argv-pseries-usb-multi.args | 2 +-
.../qemuxml2argv-pseries-vio-user-assigned.args | 4 +-
.../qemuxml2argvdata/qemuxml2argv-pseries-vio.args | 4 +-
tests/qemuxml2argvtest.c | 16 +++
.../qemuxml2xmlout-panic-pseries.xml | 2 +-
.../qemuxml2xmlout-pseries-console-native.xml | 1 +
...l => qemuxml2xmlout-pseries-console-virtio.xml} | 16 ++-
.../qemuxml2xmlout-pseries-cpu-compat-power9.xml | 2 +-
.../qemuxml2xmlout-pseries-cpu-compat.xml | 2 +-
.../qemuxml2xmlout-pseries-cpu-exact.xml | 2 +-
.../qemuxml2xmlout-pseries-panic-missing.xml | 2 +-
.../qemuxml2xmlout-pseries-panic-no-address.xml | 2 +-
...emuxml2xmlout-pseries-serial+console-native.xml | 1 +
.../qemuxml2xmlout-pseries-serial-compat.xml | 1 +
...ml => qemuxml2xmlout-pseries-serial-native.xml} | 8 +-
tests/qemuxml2xmltest.c | 15 +++
43 files changed, 288 insertions(+), 110 deletions(-)
create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-pseries-console-native.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-console-native.xml
copy tests/qemuxml2argvdata/{qemuxml2argv-pseries-basic.args =>
qemuxml2argv-pseries-console-virtio.args} (59%)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-console-virtio.xml
create mode 120000
tests/qemuxml2argvdata/qemuxml2argv-pseries-serial+console-native.args
create mode 100644
tests/qemuxml2argvdata/qemuxml2argv-pseries-serial+console-native.xml
create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-compat.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-compat.xml
create mode 100644
tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-invalid-machine.xml
copy tests/qemuxml2argvdata/{qemuxml2argv-pseries-basic.args =>
qemuxml2argv-pseries-serial-native.args} (70%)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-native.xml
create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-console-native.xml
copy tests/qemuxml2xmloutdata/{qemuxml2xmlout-panic-pseries.xml =>
qemuxml2xmlout-pseries-console-virtio.xml} (74%)
create mode 120000
tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial+console-native.xml
create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-compat.xml
copy tests/qemuxml2xmloutdata/{qemuxml2xmlout-panic-pseries.xml =>
qemuxml2xmlout-pseries-serial-native.xml} (81%)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 8dbea6af7..7ff097d65 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -6526,10 +6526,13 @@ qemu-kvm -net nic,model=? /dev/null
specifies the port number. Ports are numbered starting from 0. There are
usually 0, 1 or 2 serial ports. There is also an optional
<code>type</code> attribute <span class="since">since
1.0.2</span>
- which has three choices for its value, one is
<code>isa-serial</code>,
- then <code>usb-serial</code> and last one is
<code>pci-serial</code>.
- If <code>type</code> is missing, <code>isa-serial</code>
will be used by
- default. For <code>usb-serial</code> an optional sub-element
+ which can be used to pick between <code>isa-serial</code>,
+ <code>usb-serial</code>, <code>pci-serial</code> and,
+ <span class="since">since 3.10.0</span>,
<code>spapr-vty</code>.
+ Some values are not compatible with all architecture and machine types;
+ if the value is missing altogether, libvirt will try to pick an
+ appropriate default.
+ For <code>usb-serial</code> an optional sub-element
<code><address/></code> with
<code>type='usb'</code> can tie the
device to a particular controller, <a
href="#elementsAddress">documented above</a>.
Similarly, <code>pci-serial</code> can be used to attach the device
to
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 82fdfd5f7..8f6d035de 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -3585,6 +3585,7 @@
<value>isa-serial</value>
<value>usb-serial</value>
<value>pci-serial</value>
+ <value>spapr-vty</value>
This name doesn't feel right. Previous names are based on the BUS that
the serial device is connected with "-serial" appended to the BUS name.
Since sPAPR is specification that defines a set of para-virtualized
devices, there is no actual BUS, but I think that in this case we can
consider spapr as a BUS name and use "spapr-serial". It would be better
than just copying the device name from QEMU.
Pavel