From nobody Mon Apr 29 07:03:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511735247920329.89817368510273; Sun, 26 Nov 2017 14:27:27 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E398B5D68C; Sun, 26 Nov 2017 22:27:26 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BEAEA5D979; Sun, 26 Nov 2017 22:27:26 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 883263D381; Sun, 26 Nov 2017 22:27:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMPxbm027928 for ; Sun, 26 Nov 2017 17:25:59 -0500 Received: by smtp.corp.redhat.com (Postfix) id 75BD818EDA; Sun, 26 Nov 2017 22:25:59 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3B7CE648C1 for ; Sun, 26 Nov 2017 22:25:57 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:22 +0100 Message-Id: <20171126222549.13681-2-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 01/28] docs: Improve documentation for serial consoles X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Sun, 26 Nov 2017 22:27:27 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Our current documentation is missing some information and doesn't do a great job at explaining how the and elements are connected. Let's try to fix that. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- docs/formatdomain.html.in | 210 +++++++++++++++++++++++++++++++++---------= ---- 1 file changed, 154 insertions(+), 56 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 505676354..12d7fb407 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -6518,77 +6518,62 @@ qemu-kvm -net nic,model=3D? /dev/null
 ...
 <devices>
+  <!-- Serial port -->
   <serial type=3D'pty'>
     <source path=3D'/dev/pts/3'/>
     <target port=3D'0'/>
   </serial>
 </devices>
+...
+ +
+...
+<devices>
+  <!-- USB serial port -->
+  <serial type=3D'pty'>
+    <target type=3D'usb-serial' port=3D'0'/>
+    <address type=3D'usb' bus=3D'0' port=3D'1'/>
+  </serial>
+</devices>
 ...
=20

- target can have a port attribute, which - specifies the port number. Ports are numbered starting from 0. There= are - usually 0, 1 or 2 serial ports. There is also an optional - type attribute since 1.0.2 - which has three choices for its value, one is isa-serial, - then usb-serial and last one is pci-serial. - If type is missing, isa-serial will be use= d by - default. For usb-serial an optional sub-element - <address/> with type=3D'usb' can tie= the - device to a particular controller, docu= mented above. - Similarly, pci-serial can be used to attach the device = to - the pci bus (since 1.2.16). Again, it h= as - optional sub-element <address/> with - type=3D'pci' to select desired location on the PCI bus. + The target element can have an optional port + attribute, which specifies the port number (starting from 0), and an + optional type attribute: valid values are, + since 1.0.2, isa-serial (u= sable + on x86 machine types), + usb-serial (usable whenever USB support is available) + and pci-serial (usable whenever PCI support is availabl= e).

=20 -
Console
-

- The console element is used to represent interactive consoles. Depen= ding - on the type of guest in use, the consoles might be paravirtualized d= evices, - or they might be a clone of a serial device, according to the follow= ing - rules: + If any of the attributes is not specified by the user, libvirt will + choose a value suitable for most users.

=20 -
    -
  • If no targetType attribute is set, then the default - device type is according to the hypervisor's rules. The default - type will be added when re-querying the XML fed into libvirt. - For fully virtualized guests, the default device type will usually - be a serial port.
  • -
  • If the targetType attribute is serial, - then if no <serial> element exists, the console - element will be copied to the serial element. If a <seria= l> - element does already exist, the console element will be ignored. -
  • If the targetType attribute is not serial, - it will be treated normally.
  • -
  • Only the first console element may use a targ= etType - of serial. Secondary consoles must all be paravirtual= ized. -
  • -
  • On S390, the console element may use a - targetType of sclp or sclplm - (line mode). SCLP is the native console type for S390. There's no - controller associated to SCLP consoles. - Since 1.0.2 -
  • -
-

- A virtio console device is exposed in the - guest as /dev/hvc[0-7] (for more information, see - http= ://fedoraproject.org/wiki/Features/VirtioSerial) - Since 0.8.3 + Some of the types support configuring the guest-visible device + address as documented above. + For the relationship between serial ports and consoles, + see below.

=20 +
Console
+
 ...
 <devices>
+  <!-- Serial console -->
   <console type=3D'pty'>
-    <source path=3D'/dev/pts/4'/>
-    <target port=3D'0'/>
+    <source path=3D'/dev/pts/2'/>
+    <target type=3D'serial' port=3D'0'/>
   </console>
+</devices>
+...
=20 +
+...
   <!-- KVM virtio console -->
   <console type=3D'pty'>
     <source path=3D'/dev/pts/5'/>
@@ -6597,21 +6582,134 @@ qemu-kvm -net nic,model=3D? /dev/null
 </devices>
 ...
=20 +

+ The console element is used to represent interactive + serial consoles. Depending on the type of guest in use and the speci= fics + of the configuration, the console element might represe= nt + the same device as an existing serial element or a sepa= rate + device. +

+ +

+ A target subelement is supported and works the same + way as with the serial element + (see above for details). + Valid values for the type attribute are: + serial (described below); + virtio (usable whenever VirtIO support is available); + xen, lxc, uml and + openvz (available when the corresponding hypervisor is = in + use); sclp and sclplm (usable for s390 and + s390x QEMU guests). +

+ +

+ Of the target types listed above, serial is special in + that it doesn't represents a separate device, but rather the same + device as the first serial element. Due to this, there = can + only be a single console element with target type + serial per guest. +

+ +

+ Virtio consoles are usually accessible as /dev/hvc[0-7] + from inside the guest; for more information, see + http= ://fedoraproject.org/wiki/Features/VirtioSerial. + Since 0.8.3 +

+ +

+ For the relationship between serial ports and consoles, + see below. +

+ +
Relationship between serial = ports and consoles
+ +

+ Due to hystorical reasons, the serial and + console elements have partially overlapping scopes. +

+ +

+ In general, both elements are used to configure one or more serial + consoles to be used for interacting with the guest. The main differe= nce + between the two is that serial is used for emulated, + usually native, serial consoles, whereas console is used + for paravirtualized ones. +

+ +

+ Both emulated and paravirtualized serial consoles have advantages and + disadvantages: +

+ +
    +
  • + emulated serial consoles are usually initialized much earlier than + paravirtualized ones, so they can be used to control the bootloader + and display both firmware and early boot messages; +
  • +
  • + on several platforms, there can only be a single emulated serial + console per guest but paravirtualized consoles don't suffer from t= he + same limitation. +
  • +
+ +

+ A configuration such as: +

+
 ...
-<devices>
-  <!-- KVM S390 sclp console -->
+</devices>
+  <console type=3D'pty'>
+    <target type=3D'serial'/>
+  </console>
   <console type=3D'pty'>
-    <source path=3D'/dev/pts/1'/>
-    <target type=3D'sclp' port=3D'0'/>
+    <target type=3D'virtio'/>
   </console>
 </devices>
 ...
=20

- If the console is presented as a serial port, the target - element has the same attributes as for a serial port. There is usual= ly - only 1 console. + will work on any platform and will result in one emulated serial con= sole + for early boot logging / interactive / recovery use, and one + paravirtualized serial console to be used eg. as a side channel. Most + people will be fine with having just the first console + element in their configuration. +

+ +

+ Note that, due to the compatibility concerns mentioned earlier, all = the + following configurations: +

+ +
+...
+</devices>
+  <serial type=3D'pty'/>
+</devices>
+...
+ +
+...
+</devices>
+  <console type=3D'pty'/>
+</devices>
+...
+ +
+...
+</devices>
+  <serial type=3D'pty'/>
+  <console type=3D'pty'/>
+</devices>
+...
+ +

+ will be treated the same and will result in a single emulated serial + console being available to the guest.

=20
Channel
--=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511735250787817.0189251127921; Sun, 26 Nov 2017 14:27:30 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BAEEB15565; Sun, 26 Nov 2017 22:27:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 91AF36198C; Sun, 26 Nov 2017 22:27:29 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 56C6F3D389; Sun, 26 Nov 2017 22:27:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQ1XF027933 for ; Sun, 26 Nov 2017 17:26:01 -0500 Received: by smtp.corp.redhat.com (Postfix) id 04A9E18EDA; Sun, 26 Nov 2017 22:26:01 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 141FB614F3 for ; Sun, 26 Nov 2017 22:25:59 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:23 +0100 Message-Id: <20171126222549.13681-3-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 02/28] qemu: Introduce qemuDomainChrDefPostParse() X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sun, 26 Nov 2017 22:27:30 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Having a separate function for char device handling is better than adding even more code to qemuDomainDeviceDefPostParse(). Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina Reviewed-by: Marc Hartmayer --- src/qemu/qemu_domain.c | 57 ++++++++++++++++++++++++++++++----------------= ---- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 9dab6b24b..e59aedcfd 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4086,6 +4086,35 @@ qemuDomainControllerDefPostParse(virDomainController= DefPtr cont, return 0; } =20 +static int +qemuDomainChrDefPostParse(virDomainChrDefPtr chr, + const virDomainDef *def, + virQEMUDriverPtr driver, + unsigned int parseFlags) +{ + /* set the default console type for S390 arches */ + if (chr->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE && + chr->targetType =3D=3D VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_NONE && + ARCH_IS_S390(def->os.arch)) { + chr->targetType =3D VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO; + } + + /* clear auto generated unix socket path for inactive definitions */ + if (parseFlags & VIR_DOMAIN_DEF_PARSE_INACTIVE) { + if (qemuDomainChrDefDropDefaultPath(chr, driver) < 0) + return -1; + + /* For UNIX chardev if no path is provided we generate one. + * This also implies that the mode is 'bind'. */ + if (chr->source && + chr->source->type =3D=3D VIR_DOMAIN_CHR_TYPE_UNIX && + !chr->source->data.nix.path) { + chr->source->data.nix.listen =3D true; + } + } + + return 0; +} =20 static int qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, @@ -4146,29 +4175,6 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr d= ev, } } =20 - /* set the default console type for S390 arches */ - if (dev->type =3D=3D VIR_DOMAIN_DEVICE_CHR && - dev->data.chr->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOL= E && - dev->data.chr->targetType =3D=3D VIR_DOMAIN_CHR_CONSOLE_TARGET_TYP= E_NONE && - ARCH_IS_S390(def->os.arch)) - dev->data.chr->targetType =3D VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_V= IRTIO; - - /* clear auto generated unix socket path for inactive definitions */ - if ((parseFlags & VIR_DOMAIN_DEF_PARSE_INACTIVE) && - dev->type =3D=3D VIR_DOMAIN_DEVICE_CHR) { - virDomainChrDefPtr chr =3D dev->data.chr; - if (qemuDomainChrDefDropDefaultPath(chr, driver) < 0) - goto cleanup; - - /* For UNIX chardev if no path is provided we generate one. - * This also implies that the mode is 'bind'. */ - if (chr->source && - chr->source->type =3D=3D VIR_DOMAIN_CHR_TYPE_UNIX && - !chr->source->data.nix.path) { - chr->source->data.nix.listen =3D true; - } - } - if (dev->type =3D=3D VIR_DOMAIN_DEVICE_VIDEO) { if (dev->data.video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_DEFAULT) { if ARCH_IS_PPC64(def->os.arch) @@ -4204,6 +4210,11 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr d= ev, qemuDomainShmemDefPostParse(dev->data.shmem) < 0) goto cleanup; =20 + if (dev->type =3D=3D VIR_DOMAIN_DEVICE_CHR && + qemuDomainChrDefPostParse(dev->data.chr, def, driver, parseFlags) = < 0) { + goto cleanup; + } + ret =3D 0; =20 cleanup: --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511735189899376.46074891031026; Sun, 26 Nov 2017 14:26:29 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E1859C0587F9; Sun, 26 Nov 2017 22:26:28 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 963695D9C6; Sun, 26 Nov 2017 22:26:28 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3F1A34A468; Sun, 26 Nov 2017 22:26:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQ2K5027943 for ; Sun, 26 Nov 2017 17:26:02 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8649F18ED1; Sun, 26 Nov 2017 22:26:02 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 97F386F960 for ; Sun, 26 Nov 2017 22:26:01 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:24 +0100 Message-Id: <20171126222549.13681-4-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 03/28] conf: Run devicePostParse() again for the first serial device X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sun, 26 Nov 2017 22:26:29 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The devicePostParse() callback is invoked for all devices so that drivers have a chance to set their own specific values; however, virDomainDefAddImplicitDevices() runs *after* the devicePostParse() callbacks have been invoked and can add new devices, in which case the driver wouldn't have a chance to customize them. Work around the issue by invoking the devicePostParse() callback after virDomainDefAddImplicitDevices(), only for the first serial devices, which might have been added by it. The same was already happening for the first video device for the very same reason. This will become important later on, when we will change virDomainDefAddConsoleCompat() not to set a targetType for automatically added serial devices. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- src/conf/domain_conf.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 66536653b..83c121b02 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4946,6 +4946,18 @@ virDomainDefPostParseCommon(virDomainDefPtr def, return -1; } =20 + if (def->nserials !=3D 0) { + virDomainDeviceDef device =3D { + .type =3D VIR_DOMAIN_DEVICE_CHR, + .data.chr =3D def->serials[0], + }; + + /* serials[0] might have been added in AddImplicitDevices, after w= e've + * done the per-device post-parse */ + if (virDomainDefPostParseDeviceIterator(def, &device, NULL, data) = < 0) + return -1; + } + /* clean up possibly duplicated metadata entries */ virXMLNodeSanitizeNamespaces(def->metadata); =20 --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511735196833978.5093242770995; Sun, 26 Nov 2017 14:26:36 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 997C7BDC1; Sun, 26 Nov 2017 22:26:35 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 75407413B; Sun, 26 Nov 2017 22:26:35 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3E40B4A46A; Sun, 26 Nov 2017 22:26:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQ4r7027954 for ; Sun, 26 Nov 2017 17:26:04 -0500 Received: by smtp.corp.redhat.com (Postfix) id 14A9D60BE9; Sun, 26 Nov 2017 22:26:04 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3A6B0648AC for ; Sun, 26 Nov 2017 22:26:02 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:25 +0100 Message-Id: <20171126222549.13681-5-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 04/28] conf: Introduce VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sun, 26 Nov 2017 22:26:36 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This is the first step in getting rid of the assumption that isa-serial is the default target type for serial devices. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- src/conf/domain_conf.c | 8 +++++--- src/conf/domain_conf.h | 3 ++- src/qemu/qemu_command.c | 13 +++++++++++++ src/qemu/qemu_domain.c | 21 +++++++++++++++++++++ src/qemu/qemu_domain_address.c | 1 + 5 files changed, 42 insertions(+), 4 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 83c121b02..1b11d39b5 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -448,6 +448,7 @@ VIR_ENUM_IMPL(virDomainChrDeviceState, VIR_DOMAIN_CHR_D= EVICE_STATE_LAST, =20 VIR_ENUM_IMPL(virDomainChrSerialTarget, VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST, + "none", "isa-serial", "usb-serial", "pci-serial") @@ -4023,7 +4024,7 @@ virDomainDefAddConsoleCompat(virDomainDefPtr def) =20 /* modify it to be a serial port */ def->serials[0]->deviceType =3D VIR_DOMAIN_CHR_DEVICE_TYPE_SER= IAL; - def->serials[0]->targetType =3D VIR_DOMAIN_CHR_SERIAL_TARGET_T= YPE_ISA; + def->serials[0]->targetType =3D VIR_DOMAIN_CHR_SERIAL_TARGET_T= YPE_NONE; def->serials[0]->target.port =3D 0; } else { /* if the console source doesn't match */ @@ -4047,7 +4048,8 @@ virDomainDefAddConsoleCompat(virDomainDefPtr def) def->serials[0]->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TY= PE_SERIAL) { =20 switch ((virDomainChrSerialTargetType) def->serials[0]->targetType= ) { - case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: { + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: { =20 /* Create a stub console to match the serial port. * console[0] either does not exist @@ -11493,7 +11495,7 @@ virDomainChrDefaultTargetType(int devtype) return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_NONE; =20 case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL: - return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA; + return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE; =20 case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL: case VIR_DOMAIN_CHR_DEVICE_TYPE_LAST: diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index dabbff1c2..83b6e9ee5 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1077,7 +1077,8 @@ typedef enum { } virDomainChrDeviceType; =20 typedef enum { - VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA =3D 0, + VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE =3D 0, + VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA, VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB, VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI, =20 diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 0eb591253..81c652cc3 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -9259,6 +9259,14 @@ qemuChrIsPlatformDevice(const virDomainDef *def, return true; } =20 + /* If we got all the way here and we're still stuck with the default + * target type for a serial device, it means we have no clue what kind= of + * device we're talking about and we must treat it as a platform devic= e. */ + if (chr->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && + chr->targetType =3D=3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE) { + return true; + } + return false; } =20 @@ -10407,7 +10415,12 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, } break; =20 + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: + /* Except from _LAST, which is just a guard value and will nev= er + * be used, all of the above are platform devices, which means + * qemuBuildSerialCommandLine() will have taken the appropriate + * branch and we will not have ended up here. */ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid target type for serial device")); goto error; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index e59aedcfd..20e862a7b 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4099,6 +4099,27 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr, chr->targetType =3D VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO; } =20 + /* Historically, isa-serial and the default matched, so in order to + * maintain backwards compatibility we map them here. The actual defau= lt + * will be picked below based on the architecture and machine type. */ + if (chr->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && + chr->targetType =3D=3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA) { + chr->targetType =3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE; + } + + /* Set the default serial type */ + if (chr->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && + chr->targetType =3D=3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE) { + if (ARCH_IS_X86(def->os.arch)) { + chr->targetType =3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA; + } else if (qemuDomainIsPSeries(def)) { + /* Setting TYPE_ISA here is just a temporary hack to reduce te= st + * suite churn. Later on we will have a proper serial type for + * pSeries and this line will be updated accordingly. */ + chr->targetType =3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA; + } + } + /* clear auto generated unix socket path for inactive definitions */ if (parseFlags & VIR_DOMAIN_DEF_PARSE_INACTIVE) { if (qemuDomainChrDefDropDefaultPath(chr, driver) < 0) diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 7f4ac0f45..989c0e6c9 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -782,6 +782,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDevic= eDefPtr dev, =20 case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: return 0; } --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511735253752245.96723183800486; Sun, 26 Nov 2017 14:27:33 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CBFDBC058EC8; Sun, 26 Nov 2017 22:27:32 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A82BD5E1C2; Sun, 26 Nov 2017 22:27:32 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6796A180474D; Sun, 26 Nov 2017 22:27:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQ57n027967 for ; Sun, 26 Nov 2017 17:26:05 -0500 Received: by smtp.corp.redhat.com (Postfix) id E40E718ED1; Sun, 26 Nov 2017 22:26:05 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A891160BE9 for ; Sun, 26 Nov 2017 22:26:04 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:26 +0100 Message-Id: <20171126222549.13681-6-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 05/28] conf: Drop virDomainChrDeviceType.targetTypeAttr X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sun, 26 Nov 2017 22:27:33 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This attribute was used to decide whether to format the type attribute of the element, but the logic didn't take into account all possible cases and as such could lead to unexpected results. Moreover, it's one more thing to keep track of, and can easily fall out of sync with other attributes. Now that we have VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE, we can use that value to signal that no specific target type has been configured for the serial device and as such the attribute should not be formatted at all. All other values are now formatted. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- src/conf/domain_conf.c | 11 ++++---= ---- src/conf/domain_conf.h | 1 - src/vz/vz_sdk.c | 3 +-- tests/qemuargv2xmldata/qemuargv2xml-console-compat.xml | 2 +- tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml | 2 +- tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml | 2 +- tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml | 4 ++-- tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml | 2 +- tests/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml | 2 +- tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml | 2 +- tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml | 4 ++-- tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml | 2 +- tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml | 2 +- .../qemuhotplug-console-compat-2-live+console-virtio.xml | 4 ++-- .../qemuhotplug-console-compat-2-live.xml | 4 ++-- .../qemuxml2argv-serial-tcp-tlsx509-chardev-notls.xml | 4 ++-- tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml | 4 ++-- .../qemuxml2xmlout-bios-nvram-os-interleave.xml | 2 +- tests/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml | 4 ++-- .../qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml | 2 +- tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat.xml | 2 +- tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml | 2 +- .../qemuxml2xmloutdata/qemuxml2xmlout-console-virtio-many.xml | 2 +- tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-driver.xml | 2 +- tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml | 4 ++-- tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml | 2 +- tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml | 2 +- tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml | 2 +- tests/qemuxml2xmloutdata/qemuxml2xmlout-net-mtu.xml | 2 +- tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml | 2 +- .../qemuxml2xmlout-pseries-cpu-compat-power9.xml | 2 +- .../qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml | 2 +- tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml | 2 +- .../qemuxml2xmlout-pseries-panic-missing.xml | 2 +- .../qemuxml2xmlout-pseries-panic-no-address.xml | 2 +- .../qemuxml2xmlout-q35-virt-manager-basic.xml | 2 +- .../qemuxml2xmlout-serial-spiceport-nospice.xml | 2 +- tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport.xml | 2 +- .../qemuxml2xmlout-serial-target-port-auto.xml | 6 +++--- .../qemuxml2xmlout-serial-tcp-tlsx509-chardev.xml | 4 ++-- .../qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xml | 2 +- tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost.xml | 2 +- tests/qemuxml2xmloutdata/qemuxml2xmlout-vhost_queues.xml | 2 +- 43 files changed, 56 insertions(+), 61 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 1b11d39b5..6ba6f923c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -11507,8 +11507,7 @@ virDomainChrDefaultTargetType(int devtype) } =20 static int -virDomainChrTargetTypeFromString(virDomainChrDefPtr def, - int devtype, +virDomainChrTargetTypeFromString(int devtype, const char *targetType) { int ret =3D -1; @@ -11536,8 +11535,6 @@ virDomainChrTargetTypeFromString(virDomainChrDefPtr= def, break; } =20 - def->targetTypeAttr =3D true; - return ret; } =20 @@ -11554,7 +11551,7 @@ virDomainChrDefParseTargetXML(virDomainChrDefPtr de= f, char *stateStr =3D NULL; =20 if ((def->targetType =3D - virDomainChrTargetTypeFromString(def, def->deviceType, + virDomainChrTargetTypeFromString(def->deviceType, targetType)) < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("unknown target type '%s' specified for character= device"), @@ -16474,7 +16471,7 @@ virDomainChrEquals(virDomainChrDefPtr src, break; =20 case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL: - if (src->targetTypeAttr !=3D tgt->targetTypeAttr) + if (src->targetType !=3D tgt->targetType) return false; =20 ATTRIBUTE_FALLTHROUGH; @@ -24035,7 +24032,7 @@ virDomainChrDefFormat(virBufferPtr buf, break; =20 case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL: - if (def->targetTypeAttr) { + if (def->targetType !=3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE) { virBufferAsprintf(buf, "\n", virDomainChrTargetTypeToString(def->deviceTy= pe, diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 83b6e9ee5..ac6c4a0ed 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1203,7 +1203,6 @@ struct _virDomainChrSourceDef { struct _virDomainChrDef { int deviceType; /* enum virDomainChrDeviceType */ =20 - bool targetTypeAttr; int targetType; /* enum virDomainChrConsoleTargetType || enum virDomainChrChannelTargetType || enum virDomainChrSerialTargetType according to devi= ceType */ diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c index 819b02b1e..eea5f6fc6 100644 --- a/src/vz/vz_sdk.c +++ b/src/vz/vz_sdk.c @@ -1191,7 +1191,6 @@ prlsdkGetSerialInfo(PRL_HANDLE serialPort, virDomainC= hrDefPtr chr) int ret =3D -1; =20 chr->deviceType =3D VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL; - chr->targetTypeAttr =3D false; pret =3D PrlVmDev_GetIndex(serialPort, &serialPortIndex); prlsdkCheckRetGoto(pret, cleanup); chr->target.port =3D serialPortIndex; @@ -2864,7 +2863,7 @@ static int prlsdkCheckSerialUnsupportedParams(virDoma= inChrDefPtr chr) return -1; } =20 - if (chr->targetTypeAttr) { + if (chr->targetType !=3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Specified character device target type is not " "supported by vz driver.")); diff --git a/tests/qemuargv2xmldata/qemuargv2xml-console-compat.xml b/tests= /qemuargv2xmldata/qemuargv2xml-console-compat.xml index f51284442..7c106f145 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-console-compat.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-console-compat.xml @@ -28,7 +28,7 @@
- + diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml b/tests/qem= uargv2xmldata/qemuargv2xml-serial-dev.xml index aac814d59..e76d0211d 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml @@ -29,7 +29,7 @@ - + diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml b/tests/qe= muargv2xmldata/qemuargv2xml-serial-file.xml index 64819a48a..ed67ada0d 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml @@ -29,7 +29,7 @@ - + diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml b/tests/qe= muargv2xmldata/qemuargv2xml-serial-many.xml index e00afe317..420771dc9 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml @@ -28,11 +28,11 @@
- + - + diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml b/tests/qem= uargv2xmldata/qemuargv2xml-serial-pty.xml index f51284442..7c106f145 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml @@ -28,7 +28,7 @@
- + diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml b/te= sts/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml index c35a4ca73..3fe61ffa0 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml @@ -30,7 +30,7 @@ - + diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml b/tests/qem= uargv2xmldata/qemuargv2xml-serial-tcp.xml index 0d218f548..3fc9fd39b 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml @@ -30,7 +30,7 @@ - + diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml b/tests/qem= uargv2xmldata/qemuargv2xml-serial-udp.xml index f7069d541..5b4af3fe9 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml @@ -30,11 +30,11 @@ - + - + diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml b/tests/qe= muargv2xmldata/qemuargv2xml-serial-unix.xml index 14fc8fc7c..6bb291ff7 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml @@ -29,7 +29,7 @@ - + diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml b/tests/qemu= argv2xmldata/qemuargv2xml-serial-vc.xml index 95aa1c7b9..41954fc85 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml @@ -28,7 +28,7 @@
- + diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live= +console-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-comp= at-2-live+console-virtio.xml index 4e1dd49c2..427f431cc 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+consol= e-virtio.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+consol= e-virtio.xml @@ -72,13 +72,13 @@ - + - + diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live= .xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml index c56d13ef4..144f6eff7 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml @@ -72,13 +72,13 @@ - + - + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-chardev= -notls.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-chardev= -notls.xml index a95e29ad8..e6c4adb6f 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-chardev-notls.= xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-chardev-notls.= xml @@ -29,12 +29,12 @@ - + - + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml b/tests/q= emuxml2argvdata/qemuxml2argv-user-aliases.xml index c760098fe..f9724d320 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml @@ -110,10 +110,10 @@
- + - + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-bios-nvram-os-interlea= ve.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-bios-nvram-os-interleave.x= ml index 033e86d3a..5ee73b527 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-bios-nvram-os-interleave.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-bios-nvram-os-interleave.xml @@ -33,7 +33,7 @@ - + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml b/te= sts/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml index 840bf69f6..ad77f62d9 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml @@ -25,13 +25,13 @@ - + - + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xm= l b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml index e76f857ae..cd9d75c4b 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml @@ -27,7 +27,7 @@ - + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat.xml b/t= ests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat.xml index 8dc361dfc..0c0bd7b34 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat.xml @@ -28,7 +28,7 @@ - + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml b/= tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml index 858b2c675..305c53eab 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml @@ -31,7 +31,7 @@
- + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio-many.xm= l b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio-many.xml index f9f9abd2d..b38b3ce98 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio-many.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio-many.xml @@ -30,7 +30,7 @@ - + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-driver.xml b= /tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-driver.xml index 1c5501767..06192fbb4 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-driver.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-driver.xml @@ -47,7 +47,7 @@
- + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml b= /tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml index 95b6e2df1..a6eaa3807 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml @@ -104,10 +104,10 @@
- + - + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml b/te= sts/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml index 7fe69bd6c..e6ad23424 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml @@ -55,7 +55,7 @@
- + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml b/t= ests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml index b631e5b51..66448ec3d 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml @@ -44,7 +44,7 @@
- + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml b/tes= ts/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml index fd5fdbece..b1240b8ed 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml @@ -57,7 +57,7 @@
- + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-mtu.xml b/tests/qe= muxml2xmloutdata/qemuxml2xmlout-net-mtu.xml index 4571b6a82..4f7ad323e 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-mtu.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-mtu.xml @@ -54,7 +54,7 @@
- + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml b/te= sts/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml index 7fb49feb0..a563b6ddd 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml @@ -22,7 +22,7 @@ - +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-pow= er9.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9= .xml index f02005621..59587b3c3 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9.xml @@ -25,7 +25,7 @@ - +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml= b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml index 3cbce9fe6..a39e1fd01 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml @@ -25,7 +25,7 @@ - +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml = b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml index d69b38768..666eede1a 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml @@ -26,7 +26,7 @@ - +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.= xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml index 7fb49feb0..a563b6ddd 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml @@ -22,7 +22,7 @@ - +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-addre= ss.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.x= ml index 7fb49feb0..a563b6ddd 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml @@ -22,7 +22,7 @@ - +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virt-manager-basic= .xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virt-manager-basic.xml index c4ccd98aa..27baaa3f1 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virt-manager-basic.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virt-manager-basic.xml @@ -79,7 +79,7 @@
- + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport-nospi= ce.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport-nospice.x= ml index 79c4ebc73..63462e6f9 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport-nospice.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport-nospice.xml @@ -28,7 +28,7 @@ - + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport.xml b= /tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport.xml index 9527b2d15..c90bbeb7d 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport.xml @@ -28,7 +28,7 @@ - + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-target-port-aut= o.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-target-port-auto.xml index 71516a31a..a8790b509 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-target-port-auto.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-target-port-auto.xml @@ -27,13 +27,13 @@ - + - + - + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-tcp-tlsx509-cha= rdev.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-tcp-tlsx509-chard= ev.xml index 18f51e538..a8af87b53 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-tcp-tlsx509-chardev.xml @@ -29,12 +29,12 @@ - + - + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xm= l b/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xml index a6be7542c..f439f57ea 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xml @@ -42,7 +42,7 @@
- + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost.xml b/tests/= qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost.xml index 7787befb8..a2a6e5b3c 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost.xml @@ -48,7 +48,7 @@
- + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-vhost_queues.xml b/tes= ts/qemuxml2xmloutdata/qemuxml2xmlout-vhost_queues.xml index 8c27470dd..72cbcc4cb 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-vhost_queues.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-vhost_queues.xml @@ -46,7 +46,7 @@
- + --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511735248747730.2659564124596; Sun, 26 Nov 2017 14:27:28 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D16B86014F; Sun, 26 Nov 2017 22:27:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AA7F760F91; Sun, 26 Nov 2017 22:27:27 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 71A6B1800C87; Sun, 26 Nov 2017 22:27:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQ71b027976 for ; Sun, 26 Nov 2017 17:26:07 -0500 Received: by smtp.corp.redhat.com (Postfix) id 738C960BE9; Sun, 26 Nov 2017 22:26:07 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 83627648AC for ; Sun, 26 Nov 2017 22:26:06 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:27 +0100 Message-Id: <20171126222549.13681-7-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 06/28] conf: Introduce virDomainChrTargetDefFormat() X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Sun, 26 Nov 2017 22:27:28 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Move formatting of the element for char devices out of virDomainChrDefFormat() and into its own function. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- src/conf/domain_conf.c | 67 ++++++++++++++++++++++++++++++----------------= ---- 1 file changed, 40 insertions(+), 27 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 6ba6f923c..c0e239def 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -23945,38 +23945,15 @@ virDomainChrSourceDefFormat(virBufferPtr buf, return -1; } =20 + static int -virDomainChrDefFormat(virBufferPtr buf, - virDomainChrDefPtr def, - unsigned int flags) +virDomainChrTargetDefFormat(virBufferPtr buf, + const virDomainChrDef *def, + unsigned int flags) { - const char *elementName =3D virDomainChrDeviceTypeToString(def->device= Type); const char *targetType =3D virDomainChrTargetTypeToString(def->deviceT= ype, def->targetTyp= e); - bool tty_compat; - - int ret =3D 0; - - if (!elementName) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected char device type %d"), - def->deviceType); - return -1; - } =20 - virBufferAsprintf(buf, "<%s", elementName); - virBufferAdjustIndent(buf, 2); - tty_compat =3D (def->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_CONS= OLE && - def->target.port =3D=3D 0 && - def->source->type =3D=3D VIR_DOMAIN_CHR_TYPE_PTY && - !(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE) && - def->source->data.file.path); - if (virDomainChrAttrsDefFormat(buf, def->source, tty_compat) < 0) - return -1; - virBufferAddLit(buf, ">\n"); - virDomainChrSourceDefFormat(buf, def->source, flags); - - /* Format block */ switch (def->deviceType) { case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL: { if (!targetType) { @@ -24048,6 +24025,42 @@ virDomainChrDefFormat(virBufferPtr buf, break; } =20 + return 0; +} + + +static int +virDomainChrDefFormat(virBufferPtr buf, + virDomainChrDefPtr def, + unsigned int flags) +{ + const char *elementName =3D virDomainChrDeviceTypeToString(def->device= Type); + bool tty_compat; + + int ret =3D 0; + + if (!elementName) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unexpected char device type %d"), + def->deviceType); + return -1; + } + + virBufferAsprintf(buf, "<%s", elementName); + virBufferAdjustIndent(buf, 2); + tty_compat =3D (def->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_CONS= OLE && + def->target.port =3D=3D 0 && + def->source->type =3D=3D VIR_DOMAIN_CHR_TYPE_PTY && + !(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE) && + def->source->data.file.path); + if (virDomainChrAttrsDefFormat(buf, def->source, tty_compat) < 0) + return -1; + virBufferAddLit(buf, ">\n"); + virDomainChrSourceDefFormat(buf, def->source, flags); + + if (virDomainChrTargetDefFormat(buf, def, flags) < 0) + return -1; + virDomainDeviceInfoFormat(buf, &def->info, flags); =20 virBufferAdjustIndent(buf, -2); --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511735200974394.9594967195043; Sun, 26 Nov 2017 14:26:40 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 119C85F7B8; Sun, 26 Nov 2017 22:26:40 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D9767648AC; Sun, 26 Nov 2017 22:26:39 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A58D13894; Sun, 26 Nov 2017 22:26:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQ9rc027984 for ; Sun, 26 Nov 2017 17:26:09 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0026518ED1; Sun, 26 Nov 2017 22:26:09 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1EF0E60BE9 for ; Sun, 26 Nov 2017 22:26:07 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:28 +0100 Message-Id: <20171126222549.13681-8-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 07/28] conf: Improve error handling in virDomainChrDefFormat() X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Sun, 26 Nov 2017 22:26:40 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We don't need to store the return value since we never modify it. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- src/conf/domain_conf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index c0e239def..cb98631fb 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -24037,8 +24037,6 @@ virDomainChrDefFormat(virBufferPtr buf, const char *elementName =3D virDomainChrDeviceTypeToString(def->device= Type); bool tty_compat; =20 - int ret =3D 0; - if (!elementName) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unexpected char device type %d"), @@ -24059,14 +24057,14 @@ virDomainChrDefFormat(virBufferPtr buf, virDomainChrSourceDefFormat(buf, def->source, flags); =20 if (virDomainChrTargetDefFormat(buf, def, flags) < 0) - return -1; + return -1; =20 virDomainDeviceInfoFormat(buf, &def->info, flags); =20 virBufferAdjustIndent(buf, -2); virBufferAsprintf(buf, "\n", elementName); =20 - return ret; + return 0; } =20 static int --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511735251704898.5038048278727; Sun, 26 Nov 2017 14:27:31 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D893CC0587C7; Sun, 26 Nov 2017 22:27:30 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B539B17545; Sun, 26 Nov 2017 22:27:30 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 80F123D38A; Sun, 26 Nov 2017 22:27:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQAZO027996 for ; Sun, 26 Nov 2017 17:26:10 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8489C60BE9; Sun, 26 Nov 2017 22:26:10 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 99D7D18EDD for ; Sun, 26 Nov 2017 22:26:09 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:29 +0100 Message-Id: <20171126222549.13681-9-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 08/28] conf: Check virDomainChrSourceDefFormat() return value X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sun, 26 Nov 2017 22:27:31 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The function can fail, but none of the caller were accounting for that. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- src/conf/domain_conf.c | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index cb98631fb..4bae0cc94 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -24054,7 +24054,9 @@ virDomainChrDefFormat(virBufferPtr buf, if (virDomainChrAttrsDefFormat(buf, def->source, tty_compat) < 0) return -1; virBufferAddLit(buf, ">\n"); - virDomainChrSourceDefFormat(buf, def->source, flags); + + if (virDomainChrSourceDefFormat(buf, def->source, flags) < 0) + return -1; =20 if (virDomainChrTargetDefFormat(buf, def, flags) < 0) return -1; @@ -24075,13 +24077,14 @@ virDomainSmartcardDefFormat(virBufferPtr buf, const char *mode =3D virDomainSmartcardTypeToString(def->type); virBuffer childBuf =3D VIR_BUFFER_INITIALIZER; size_t i; + int ret =3D -1; =20 virBufferSetChildIndent(&childBuf, buf); =20 if (!mode) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unexpected smartcard type %d"), def->type); - return -1; + goto cleanup; } =20 switch (def->type) { @@ -24098,23 +24101,25 @@ virDomainSmartcardDefFormat(virBufferPtr buf, break; =20 case VIR_DOMAIN_SMARTCARD_TYPE_PASSTHROUGH: - virDomainChrSourceDefFormat(&childBuf, def->data.passthru, flags); + if (virDomainChrSourceDefFormat(&childBuf, def->data.passthru, fla= gs) < 0) + goto cleanup; break; =20 default: virReportError(VIR_ERR_INTERNAL_ERROR, _("unexpected smartcard type %d"), def->type); - return -1; + goto cleanup; } virDomainDeviceInfoFormat(&childBuf, &def->info, flags); =20 if (virBufferCheckError(&childBuf) < 0) - return -1; + goto cleanup; =20 virBufferAsprintf(buf, "type =3D=3D VIR_DOMAIN_SMARTCARD_TYPE_PASSTHROUGH && - virDomainChrAttrsDefFormat(buf, def->data.passthru, false) < 0) - return -1; + virDomainChrAttrsDefFormat(buf, def->data.passthru, false) < 0) { + goto cleanup; + } =20 if (virBufferUse(&childBuf)) { virBufferAddLit(buf, ">\n"); @@ -24123,7 +24128,12 @@ virDomainSmartcardDefFormat(virBufferPtr buf, } else { virBufferAddLit(buf, "/>\n"); } - return 0; + + ret =3D 0; + + cleanup: + virBufferFreeAndReset(&childBuf); + return ret; } =20 static int @@ -24425,7 +24435,8 @@ virDomainRNGDefFormat(virBufferPtr buf, return -1; virBufferAddLit(buf, ">\n"); virBufferAdjustIndent(buf, 2); - virDomainChrSourceDefFormat(buf, def->source.chardev, flags); + if (virDomainChrSourceDefFormat(buf, def->source.chardev, flags) <= 0) + return -1; virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "\n"); =20 @@ -25270,7 +25281,10 @@ virDomainRedirdevDefFormat(virBufferPtr buf, return -1; virBufferAddLit(buf, ">\n"); virBufferAdjustIndent(buf, 2); - virDomainChrSourceDefFormat(buf, def->source, flags); + + if (virDomainChrSourceDefFormat(buf, def->source, flags) < 0) + return -1; + virDomainDeviceInfoFormat(buf, &def->info, flags | VIR_DOMAIN_DEF_FORMAT_ALLOW_BOOT); virBufferAdjustIndent(buf, -2); --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511735204683726.3900112485119; Sun, 26 Nov 2017 14:26:44 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9343481DE4; Sun, 26 Nov 2017 22:26:43 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 701B960F91; Sun, 26 Nov 2017 22:26:43 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3D84D3FCFD; Sun, 26 Nov 2017 22:26:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQBPQ028006 for ; Sun, 26 Nov 2017 17:26:11 -0500 Received: by smtp.corp.redhat.com (Postfix) id D444360BE9; Sun, 26 Nov 2017 22:26:11 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ED4C3648AC for ; Sun, 26 Nov 2017 22:26:10 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:30 +0100 Message-Id: <20171126222549.13681-10-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 09/28] conf: Improve virDomainChrTargetDefFormat() X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Sun, 26 Nov 2017 22:26:44 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Make the switch statement type-aware, avoid calling virDomainChrTargetTypeToString() more than once and check its return value before using it. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- src/conf/domain_conf.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 4bae0cc94..72d5f289c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -23954,7 +23954,7 @@ virDomainChrTargetDefFormat(virBufferPtr buf, const char *targetType =3D virDomainChrTargetTypeToString(def->deviceT= ype, def->targetTyp= e); =20 - switch (def->deviceType) { + switch ((virDomainChrDeviceType) def->deviceType) { case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL: { if (!targetType) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -24001,28 +24001,43 @@ virDomainChrTargetDefFormat(virBufferPtr buf, } =20 case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE: + if (!targetType) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Could not format console target type")); + return -1; + } + virBufferAsprintf(buf, "\n", - virDomainChrTargetTypeToString(def->deviceType, - def->targetType), - def->target.port); + targetType, def->target.port); break; =20 case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL: + if (!targetType) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Could not format serial target type")); + return -1; + } + if (def->targetType !=3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE) { virBufferAsprintf(buf, "\n", - virDomainChrTargetTypeToString(def->deviceTy= pe, - def->targetTy= pe), + targetType, def->target.port); break; } ATTRIBUTE_FALLTHROUGH; =20 - default: + case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL: virBufferAsprintf(buf, "\n", def->target.port); break; + + case VIR_DOMAIN_CHR_DEVICE_TYPE_LAST: + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unexpected char device type %d"), + def->deviceType); + return -1; } =20 return 0; --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511735257072699.8797291694752; Sun, 26 Nov 2017 14:27:37 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0CA03C0587CE; Sun, 26 Nov 2017 22:27:36 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C502060561; Sun, 26 Nov 2017 22:27:35 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8BF3E3D386; Sun, 26 Nov 2017 22:27:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQFIr028302 for ; Sun, 26 Nov 2017 17:26:15 -0500 Received: by smtp.corp.redhat.com (Postfix) id 244F018EDD; Sun, 26 Nov 2017 22:26:15 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2F7B3648C1 for ; Sun, 26 Nov 2017 22:26:12 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:31 +0100 Message-Id: <20171126222549.13681-11-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 10/28] conf: Remove ATTRIBUTE_FALLTHROUGH from virDomainChrTargetDefFormat() X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sun, 26 Nov 2017 22:27:36 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Formatting the element for serial devices will become a bit more complicated later on, and leaving the fallthrough behavior there would do nothing but complicate it further. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- src/conf/domain_conf.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 72d5f289c..42e7596ac 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -24019,14 +24019,18 @@ virDomainChrTargetDefFormat(virBufferPtr buf, return -1; } =20 + virBufferAddLit(buf, "targetType !=3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE) { virBufferAsprintf(buf, - "\n", - targetType, - def->target.port); - break; + "type=3D'%s' ", + targetType); } - ATTRIBUTE_FALLTHROUGH; + + virBufferAsprintf(buf, + "port=3D'%d'/>\n", + def->target.port); + break; =20 case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL: virBufferAsprintf(buf, "\n", --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511735259793320.45330851927247; Sun, 26 Nov 2017 14:27:39 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8D3F6356C4; Sun, 26 Nov 2017 22:27:38 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A0165D97A; Sun, 26 Nov 2017 22:27:38 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1C9FF3D392; Sun, 26 Nov 2017 22:27:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQGiv028339 for ; Sun, 26 Nov 2017 17:26:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id A6CE018ED1; Sun, 26 Nov 2017 22:26:16 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B6DF9614F3 for ; Sun, 26 Nov 2017 22:26:15 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:32 +0100 Message-Id: <20171126222549.13681-12-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 11/28] qemu: Introduce qemuDomainChrTargetDefValidate() X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Sun, 26 Nov 2017 22:27:39 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Instead of waiting until we get to command line generation, we can validate the target for a char device much earlier. Move all the checks out of qemuBuildSerialChrDeviceStr() and into the new fuction. This will later allow us to validate the target for platform devices. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- src/qemu/qemu_command.c | 20 ---------------- src/qemu/qemu_domain.c | 62 +++++++++++++++++++++++++++++++++++++++++++++= ++++ 2 files changed, 62 insertions(+), 20 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 81c652cc3..0a4684231 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10382,22 +10382,9 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, _("usb-serial is not supported in this QEMU= binary")); goto error; } - - if (serial->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE= && - serial->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB)= { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("usb-serial requires address of usb type"= )); - goto error; - } break; =20 case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: - if (serial->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE= && - serial->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_ISA)= { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("isa-serial requires address of isa type"= )); - goto error; - } break; =20 case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: @@ -10406,13 +10393,6 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, _("pci-serial is not supported with this QE= MU binary")); goto error; } - - if (serial->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE= && - serial->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)= { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("pci-serial requires address of pci type"= )); - goto error; - } break; =20 case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 20e862a7b..0a04d9a24 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3460,6 +3460,65 @@ qemuDomainChrSourceDefValidate(const virDomainChrSou= rceDef *def) } =20 =20 +static int +qemuDomainChrTargetDefValidate(const virDomainDef *def, + const virDomainChrDef *chr) +{ + switch ((virDomainChrDeviceType) chr->deviceType) { + case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL: + + /* Validate target type */ + switch ((virDomainChrSerialTargetType) chr->targetType) { + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: + /* Hack required until we have a proper type for pSeries + * serial consoles */ + if (qemuDomainIsPSeries(def)) + return 0; + + if (chr->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && + chr->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_ISA) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("isa-serial requires address of isa type"= )); + return -1; + } + break; + + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: + if (chr->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && + chr->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("usb-serial requires address of usb type"= )); + return -1; + } + break; + + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: + if (chr->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && + chr->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("pci-serial requires address of pci type"= )); + return -1; + } + break; + + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: + break; + } + break; + + case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE: + case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL: + case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL: + case VIR_DOMAIN_CHR_DEVICE_TYPE_LAST: + /* Nothing to do */ + break; + } + + return 0; +} + + static int qemuDomainChrDefValidate(const virDomainChrDef *dev, const virDomainDef *def) @@ -3467,6 +3526,9 @@ qemuDomainChrDefValidate(const virDomainChrDef *dev, if (qemuDomainChrSourceDefValidate(dev->source) < 0) return -1; =20 + if (qemuDomainChrTargetDefValidate(def, dev) < 0) + return -1; + if (dev->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL && (ARCH_IS_S390(def->os.arch) || qemuDomainIsPSeries(def))) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511735254459620.0774539641964; Sun, 26 Nov 2017 14:27:34 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 714A4C058EC4; Sun, 26 Nov 2017 22:27:33 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 494BF17551; Sun, 26 Nov 2017 22:27:33 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 0DB39180474F; Sun, 26 Nov 2017 22:27:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQIJa028350 for ; Sun, 26 Nov 2017 17:26:18 -0500 Received: by smtp.corp.redhat.com (Postfix) id 34F1018ED5; Sun, 26 Nov 2017 22:26:18 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4600218ED1 for ; Sun, 26 Nov 2017 22:26:16 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:33 +0100 Message-Id: <20171126222549.13681-13-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 12/28] qemu: Improve qemuDomainChrTargetDefValidate() X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sun, 26 Nov 2017 22:27:33 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Instead of validating each target type / address type combination separately, create a small helper to perform the matching and collapse all existing checks into a single one. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- src/qemu/qemu_domain.c | 50 ++++++++++++++++++++++++++++++----------------= ---- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 0a04d9a24..a719d14fe 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3460,43 +3460,53 @@ qemuDomainChrSourceDefValidate(const virDomainChrSo= urceDef *def) } =20 =20 +static int +qemuDomainChrSerialTargetTypeToAddressType(int targetType) +{ + switch ((virDomainChrSerialTargetType) targetType) { + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: + return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_ISA; + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: + return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB; + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: + return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI; + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: + break; + } + + return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE; +} + + static int qemuDomainChrTargetDefValidate(const virDomainDef *def, const virDomainChrDef *chr) { + int expected; + switch ((virDomainChrDeviceType) chr->deviceType) { case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL: =20 /* Validate target type */ switch ((virDomainChrSerialTargetType) chr->targetType) { case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: + /* Hack required until we have a proper type for pSeries * serial consoles */ if (qemuDomainIsPSeries(def)) return 0; =20 - if (chr->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && - chr->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_ISA) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("isa-serial requires address of isa type"= )); - return -1; - } - break; - - case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: - if (chr->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && - chr->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("usb-serial requires address of usb type"= )); - return -1; - } - break; + expected =3D qemuDomainChrSerialTargetTypeToAddressType(chr->t= argetType); =20 - case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: if (chr->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && - chr->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("pci-serial requires address of pci type"= )); + chr->info.type !=3D expected) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target type '%s' requires address type '= %s'"), + virDomainChrSerialTargetTypeToString(chr->t= argetType), + virDomainDeviceAddressTypeToString(expected= )); return -1; } break; --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511735257355725.3842208475596; Sun, 26 Nov 2017 14:27:37 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 38DFC7CBB3; Sun, 26 Nov 2017 22:27:36 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 14D2361992; Sun, 26 Nov 2017 22:27:36 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D518E3D38C; Sun, 26 Nov 2017 22:27:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQJHB028360 for ; Sun, 26 Nov 2017 17:26:19 -0500 Received: by smtp.corp.redhat.com (Postfix) id B81CD60BE9; Sun, 26 Nov 2017 22:26:19 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CA4D6614F3 for ; Sun, 26 Nov 2017 22:26:18 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:34 +0100 Message-Id: <20171126222549.13681-14-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 13/28] conf: Parse and format virDomainChrSerialTargetModel X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Sun, 26 Nov 2017 22:27:36 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This information will be used to select, and store in the guest configuration in order to guarantee ABI stability, the concrete (hypervisor-specific) model for serial devices. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- docs/formatdomain.html.in | 16 ++++++++-- docs/schemas/domaincommon.rng | 15 +++++++++ src/conf/domain_conf.c | 72 +++++++++++++++++++++++++++++++++++++++= +++- src/conf/domain_conf.h | 12 ++++++++ 4 files changed, 112 insertions(+), 3 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 12d7fb407..3126d6ed1 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -6531,7 +6531,9 @@ qemu-kvm -net nic,model=3D? /dev/null <devices> <!-- USB serial port --> <serial type=3D'pty'> - <target type=3D'usb-serial' port=3D'0'/> + <target type=3D'usb-serial' port=3D'0'> + <model name=3D'usb-serial'/> + </target> <address type=3D'usb' bus=3D'0' port=3D'1'/> </serial> </devices> @@ -6547,6 +6549,16 @@ qemu-kvm -net nic,model=3D? /dev/null and pci-serial (usable whenever PCI support is availabl= e).

=20 +

+ Since 3.10.0, the target + element can have an optional model subelement; + valid values for its name attribute are: + isa-serial (usable with the isa-serial tar= get + type); usb-serial (usable with the usb-serial + target type); pci-serial + (usable with the pci-serial target type). +

+

If any of the attributes is not specified by the user, libvirt will choose a value suitable for most users. @@ -6567,7 +6579,7 @@ qemu-kvm -net nic,model=3D? /dev/null <!-- Serial console --> <console type=3D'pty'> <source path=3D'/dev/pts/2'/> - <target type=3D'serial' port=3D'0'/> + <target type=3D'serial' port=3D'0'/> </console> </devices> ... diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index f1808065b..fbba092d1 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -3589,6 +3589,18 @@ =20 + + + + + isa-serial + usb-serial + pci-serial + + + + + @@ -3603,6 +3615,9 @@ + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 42e7596ac..5df5f3aae 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -472,6 +472,14 @@ VIR_ENUM_IMPL(virDomainChrConsoleTarget, "sclp", "sclplm") =20 +VIR_ENUM_IMPL(virDomainChrSerialTargetModel, + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST, + "none", + "isa-serial", + "usb-serial", + "pci-serial", +); + VIR_ENUM_IMPL(virDomainChrDevice, VIR_DOMAIN_CHR_DEVICE_TYPE_LAST, "parallel", "serial", @@ -11538,14 +11546,42 @@ virDomainChrTargetTypeFromString(int devtype, return ret; } =20 +static int +virDomainChrTargetModelFromString(int devtype, + const char *targetModel) +{ + int ret =3D -1; + + if (!targetModel) + return 0; + + switch ((virDomainChrDeviceType) devtype) { + case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL: + ret =3D virDomainChrSerialTargetModelTypeFromString(targetModel); + break; + + case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL: + case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE: + case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL: + case VIR_DOMAIN_CHR_DEVICE_TYPE_LAST: + /* Target model not supported yet */ + ret =3D 0; + break; + } + + return ret; +} + static int virDomainChrDefParseTargetXML(virDomainChrDefPtr def, xmlNodePtr cur, unsigned int flags) { int ret =3D -1; + xmlNodePtr child; unsigned int port; char *targetType =3D virXMLPropString(cur, "type"); + char *targetModel =3D NULL; char *addrStr =3D NULL; char *portStr =3D NULL; char *stateStr =3D NULL; @@ -11559,6 +11595,24 @@ virDomainChrDefParseTargetXML(virDomainChrDefPtr d= ef, goto error; } =20 + child =3D cur->children; + while (child !=3D NULL) { + if (child->type =3D=3D XML_ELEMENT_NODE && + virXMLNodeNameEqual(child, "model")) { + targetModel =3D virXMLPropString(child, "name"); + } + child =3D child->next; + } + + if ((def->targetModel =3D + virDomainChrTargetModelFromString(def->deviceType, + targetModel)) < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unknown target model '%s' specified for characte= r device"), + targetModel); + goto error; + } + switch (def->deviceType) { case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL: switch (def->targetType) { @@ -11647,6 +11701,7 @@ virDomainChrDefParseTargetXML(virDomainChrDefPtr de= f, ret =3D 0; error: VIR_FREE(targetType); + VIR_FREE(targetModel); VIR_FREE(addrStr); VIR_FREE(portStr); VIR_FREE(stateStr); @@ -24028,8 +24083,23 @@ virDomainChrTargetDefFormat(virBufferPtr buf, } =20 virBufferAsprintf(buf, - "port=3D'%d'/>\n", + "port=3D'%d'", def->target.port); + + if (def->targetModel !=3D VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE)= { + virBufferAddLit(buf, ">\n"); + + virBufferAdjustIndent(buf, 2); + virBufferAsprintf(buf, + "\n", + virDomainChrSerialTargetModelTypeToString(de= f->targetModel)); + virBufferAdjustIndent(buf, -2); + + virBufferAddLit(buf, "\n"); + } else { + virBufferAddLit(buf, "/>\n"); + } + break; =20 case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL: diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index ac6c4a0ed..7895dea55 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1108,6 +1108,17 @@ typedef enum { VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST } virDomainChrConsoleTargetType; =20 +typedef enum { + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE =3D 0, + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL, + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL, + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL, + + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST +} virDomainChrSerialTargetModel; + +VIR_ENUM_DECL(virDomainChrSerialTargetModel); + typedef enum { VIR_DOMAIN_CHR_TYPE_NULL, VIR_DOMAIN_CHR_TYPE_VC, @@ -1206,6 +1217,7 @@ struct _virDomainChrDef { int targetType; /* enum virDomainChrConsoleTargetType || enum virDomainChrChannelTargetType || enum virDomainChrSerialTargetType according to devi= ceType */ + int targetModel; /* enum virDomainChrSerialTargetModel */ =20 union { int port; /* parallel, serial, console */ --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511735206973304.7171149442065; Sun, 26 Nov 2017 14:26:46 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1F25B4A702; Sun, 26 Nov 2017 22:26:46 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EC17417BB8; Sun, 26 Nov 2017 22:26:45 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B62AD1800BDC; Sun, 26 Nov 2017 22:26:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQMgq028375 for ; Sun, 26 Nov 2017 17:26:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id 51A7860BE9; Sun, 26 Nov 2017 22:26:22 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 57E41614F3 for ; Sun, 26 Nov 2017 22:26:20 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:35 +0100 Message-Id: <20171126222549.13681-15-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 14/28] qemu: Set targetModel based on targetType for serial devices X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Sun, 26 Nov 2017 22:26:46 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- src/qemu/qemu_domain.c | 20 ++++++++++++++++= ++++ .../qemuargv2xmldata/qemuargv2xml-console-compat.xml | 4 +++- tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml | 4 +++- tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml | 4 +++- tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml | 8 ++++++-- tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml | 4 +++- .../qemuargv2xml-serial-tcp-telnet.xml | 4 +++- tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml | 4 +++- tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml | 8 ++++++-- tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml | 4 +++- tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml | 4 +++- ...uhotplug-console-compat-2-live+console-virtio.xml | 12 +++++++++--- .../qemuhotplug-console-compat-2-live.xml | 12 +++++++++--- ...qemuxml2argv-serial-tcp-tlsx509-chardev-notls.xml | 8 ++++++-- tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml | 8 ++++++-- .../qemuxml2xmlout-aarch64-pci-serial.xml | 4 +++- .../qemuxml2xmlout-bios-nvram-os-interleave.xml | 4 +++- .../qemuxml2xmlout-chardev-label.xml | 8 ++++++-- .../qemuxml2xmlout-console-compat-auto.xml | 4 +++- .../qemuxml2xmlout-console-compat.xml | 4 +++- .../qemuxml2xmlout-console-compat2.xml | 4 +++- .../qemuxml2xmlout-console-virtio-many.xml | 4 +++- .../qemuxml2xmlout-interface-driver.xml | 4 +++- .../qemuxml2xmlout-interface-server.xml | 8 ++++++-- .../qemuxml2xmlout-net-bandwidth.xml | 4 +++- .../qemuxml2xmlout-net-bandwidth2.xml | 4 +++- .../qemuxml2xmlout-net-coalesce.xml | 4 +++- tests/qemuxml2xmloutdata/qemuxml2xmlout-net-mtu.xml | 4 +++- .../qemuxml2xmlout-panic-pseries.xml | 4 +++- .../qemuxml2xmlout-pci-serial-dev-chardev.xml | 4 +++- .../qemuxml2xmlout-pseries-cpu-compat-power9.xml | 4 +++- .../qemuxml2xmlout-pseries-cpu-compat.xml | 4 +++- .../qemuxml2xmlout-pseries-cpu-exact.xml | 4 +++- .../qemuxml2xmlout-pseries-panic-missing.xml | 4 +++- .../qemuxml2xmlout-pseries-panic-no-address.xml | 4 +++- .../qemuxml2xmlout-q35-virt-manager-basic.xml | 4 +++- .../qemuxml2xmlout-serial-spiceport-nospice.xml | 4 +++- .../qemuxml2xmlout-serial-spiceport.xml | 4 +++- .../qemuxml2xmlout-serial-target-port-auto.xml | 12 +++++++++--- .../qemuxml2xmlout-serial-tcp-tlsx509-chardev.xml | 8 ++++++-- .../qemuxml2xmlout-tap-vhost-incorrect.xml | 4 +++- .../qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost.xml | 4 +++- .../qemuxml2xmlout-vhost_queues.xml | 4 +++- 43 files changed, 185 insertions(+), 55 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index a719d14fe..e141e1132 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4192,6 +4192,26 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr, } } =20 + /* Set the default target model */ + if (chr->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && + chr->targetModel =3D=3D VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE) { + switch ((virDomainChrSerialTargetType) chr->targetType) { + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: + chr->targetModel =3D VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SE= RIAL; + break; + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: + chr->targetModel =3D VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SE= RIAL; + break; + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: + chr->targetModel =3D VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SE= RIAL; + break; + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: + /* Nothing to do */ + break; + } + } + /* clear auto generated unix socket path for inactive definitions */ if (parseFlags & VIR_DOMAIN_DEF_PARSE_INACTIVE) { if (qemuDomainChrDefDropDefaultPath(chr, driver) < 0) diff --git a/tests/qemuargv2xmldata/qemuargv2xml-console-compat.xml b/tests= /qemuargv2xmldata/qemuargv2xml-console-compat.xml index 7c106f145..cba43ca45 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-console-compat.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-console-compat.xml @@ -28,7 +28,9 @@

- + + + diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml b/tests/qem= uargv2xmldata/qemuargv2xml-serial-dev.xml index e76d0211d..e9998d554 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml @@ -29,7 +29,9 @@ - + + + diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml b/tests/qe= muargv2xmldata/qemuargv2xml-serial-file.xml index ed67ada0d..0e9dfe578 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml @@ -29,7 +29,9 @@ - + + + diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml b/tests/qe= muargv2xmldata/qemuargv2xml-serial-many.xml index 420771dc9..05374b38d 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml @@ -28,11 +28,15 @@
- + + + - + + + diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml b/tests/qem= uargv2xmldata/qemuargv2xml-serial-pty.xml index 7c106f145..cba43ca45 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml @@ -28,7 +28,9 @@
- + + + diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml b/te= sts/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml index 3fe61ffa0..1ac12440e 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml @@ -30,7 +30,9 @@ - + + + diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml b/tests/qem= uargv2xmldata/qemuargv2xml-serial-tcp.xml index 3fc9fd39b..c10cee903 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml @@ -30,7 +30,9 @@ - + + + diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml b/tests/qem= uargv2xmldata/qemuargv2xml-serial-udp.xml index 5b4af3fe9..fd56dda84 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml @@ -30,11 +30,15 @@ - + + + - + + + diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml b/tests/qe= muargv2xmldata/qemuargv2xml-serial-unix.xml index 6bb291ff7..70b192f67 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml @@ -29,7 +29,9 @@ - + + + diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml b/tests/qemu= argv2xmldata/qemuargv2xml-serial-vc.xml index 41954fc85..630844ea0 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml @@ -28,7 +28,9 @@
- + + + diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live= +console-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-comp= at-2-live+console-virtio.xml index 427f431cc..abe68a0a0 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+consol= e-virtio.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+consol= e-virtio.xml @@ -68,17 +68,23 @@
- + + + - + + + - + + + diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live= .xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml index 144f6eff7..45161e1e2 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml @@ -68,17 +68,23 @@
- + + + - + + + - + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-chardev= -notls.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-chardev= -notls.xml index e6c4adb6f..89dc9e6e1 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-chardev-notls.= xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-chardev-notls.= xml @@ -29,12 +29,16 @@ - + + + - + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml b/tests/q= emuxml2argvdata/qemuxml2argv-user-aliases.xml index f9724d320..52132a82d 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml @@ -110,10 +110,14 @@
- + + + - + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-pci-serial.xml= b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-pci-serial.xml index fddab31f0..b02a5a7db 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-pci-serial.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-pci-serial.xml @@ -34,7 +34,9 @@ - + + +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-bios-nvram-os-interlea= ve.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-bios-nvram-os-interleave.x= ml index 5ee73b527..b6d7a6636 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-bios-nvram-os-interleave.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-bios-nvram-os-interleave.xml @@ -33,7 +33,9 @@ - + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml b/te= sts/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml index ad77f62d9..7d5bbdd0a 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml @@ -25,13 +25,17 @@ - + + + - + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xm= l b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml index cd9d75c4b..267b253b1 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml @@ -27,7 +27,9 @@ - + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat.xml b/t= ests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat.xml index 0c0bd7b34..6a52800a3 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat.xml @@ -28,7 +28,9 @@ - + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml b/= tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml index 305c53eab..8c7bbb768 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml @@ -31,7 +31,9 @@
- + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio-many.xm= l b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio-many.xml index b38b3ce98..1a22b78b8 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio-many.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio-many.xml @@ -30,7 +30,9 @@ - + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-driver.xml b= /tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-driver.xml index 06192fbb4..5be590e75 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-driver.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-driver.xml @@ -47,7 +47,9 @@
- + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml b= /tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml index a6eaa3807..049b1472a 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml @@ -104,10 +104,14 @@
- + + + - + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml b/te= sts/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml index e6ad23424..4ec77d154 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml @@ -55,7 +55,9 @@
- + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml b/t= ests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml index 66448ec3d..ee65c3a5b 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml @@ -44,7 +44,9 @@
- + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml b/tes= ts/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml index b1240b8ed..56792b999 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml @@ -57,7 +57,9 @@
- + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-mtu.xml b/tests/qe= muxml2xmloutdata/qemuxml2xmlout-net-mtu.xml index 4f7ad323e..fc7b2e39a 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-mtu.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-mtu.xml @@ -54,7 +54,9 @@
- + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml b/te= sts/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml index a563b6ddd..496df0696 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml @@ -22,7 +22,9 @@ - + + +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-serial-dev-chardev= .xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-serial-dev-chardev.xml index 2f704cc0a..8f77ef043 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-serial-dev-chardev.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-serial-dev-chardev.xml @@ -28,7 +28,9 @@ - + + +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-pow= er9.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9= .xml index 59587b3c3..9d4c5efe6 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9.xml @@ -25,7 +25,9 @@ - + + +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml= b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml index a39e1fd01..6059859ab 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml @@ -25,7 +25,9 @@ - + + +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml = b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml index 666eede1a..f3216523e 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml @@ -26,7 +26,9 @@ - + + +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.= xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml index a563b6ddd..496df0696 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml @@ -22,7 +22,9 @@ - + + +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-addre= ss.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.x= ml index a563b6ddd..496df0696 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml @@ -22,7 +22,9 @@ - + + +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virt-manager-basic= .xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virt-manager-basic.xml index 27baaa3f1..2437fdec4 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virt-manager-basic.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virt-manager-basic.xml @@ -79,7 +79,9 @@
- + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport-nospi= ce.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport-nospice.x= ml index 63462e6f9..e1d5cb9d7 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport-nospice.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport-nospice.xml @@ -28,7 +28,9 @@ - + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport.xml b= /tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport.xml index c90bbeb7d..ff92435af 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport.xml @@ -28,7 +28,9 @@ - + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-target-port-aut= o.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-target-port-auto.xml index a8790b509..fded758ea 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-target-port-auto.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-target-port-auto.xml @@ -27,13 +27,19 @@ - + + + - + + + - + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-tcp-tlsx509-cha= rdev.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-tcp-tlsx509-chard= ev.xml index a8af87b53..76d894820 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-tcp-tlsx509-chardev.xml @@ -29,12 +29,16 @@ - + + + - + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xm= l b/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xml index f439f57ea..c4334f6ca 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xml @@ -42,7 +42,9 @@
- + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost.xml b/tests/= qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost.xml index a2a6e5b3c..8e761762f 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost.xml @@ -48,7 +48,9 @@
- + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-vhost_queues.xml b/tes= ts/qemuxml2xmloutdata/qemuxml2xmlout-vhost_queues.xml index 72cbcc4cb..49a7b550b 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-vhost_queues.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-vhost_queues.xml @@ -46,7 +46,9 @@
- + + + --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511735260210108.02961792212216; Sun, 26 Nov 2017 14:27:40 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3AFE381DFB; Sun, 26 Nov 2017 22:27:39 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 129AE5D97B; Sun, 26 Nov 2017 22:27:39 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id CCAC5180474F; Sun, 26 Nov 2017 22:27:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQOTv028386 for ; Sun, 26 Nov 2017 17:26:24 -0500 Received: by smtp.corp.redhat.com (Postfix) id BC1BE18ED1; Sun, 26 Nov 2017 22:26:24 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8506D60BE9 for ; Sun, 26 Nov 2017 22:26:22 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:36 +0100 Message-Id: <20171126222549.13681-16-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 15/28] qemu: Validate target model for serial devices X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Sun, 26 Nov 2017 22:27:39 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Target model and target type must agree for the configuration to make sense, so check that's actually the case and error out otherwise. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- src/libvirt_private.syms | 2 ++ src/qemu/qemu_domain.c | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 875e474b6..290198ddd 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -209,6 +209,8 @@ virDomainChrGetDomainPtrs; virDomainChrInsertPreAlloced; virDomainChrPreAlloc; virDomainChrRemove; +virDomainChrSerialTargetModelTypeFromString; +virDomainChrSerialTargetModelTypeToString; virDomainChrSerialTargetTypeFromString; virDomainChrSerialTargetTypeToString; virDomainChrSourceDefClear; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index e141e1132..0b033f496 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3479,6 +3479,25 @@ qemuDomainChrSerialTargetTypeToAddressType(int targe= tType) } =20 =20 +static int +qemuDomainChrSerialTargetModelToTargetType(int targetModel) +{ + switch ((virDomainChrSerialTargetModel) targetModel) { + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: + return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA; + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL: + return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB; + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: + return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI; + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: + break; + } + + return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE; +} + + static int qemuDomainChrTargetDefValidate(const virDomainDef *def, const virDomainChrDef *chr) @@ -3515,6 +3534,28 @@ qemuDomainChrTargetDefValidate(const virDomainDef *d= ef, case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: break; } + + /* Validate target model */ + switch ((virDomainChrSerialTargetModel) chr->targetModel) { + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: + + expected =3D qemuDomainChrSerialTargetModelToTargetType(chr->t= argetModel); + + if (chr->targetType !=3D expected) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target model '%s' requires target type '= %s'"), + virDomainChrSerialTargetModelTypeToString(c= hr->targetModel), + virDomainChrSerialTargetTypeToString(expect= ed)); + return -1; + } + break; + + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: + break; + } break; =20 case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE: --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 151173526254835.514622740211166; Sun, 26 Nov 2017 14:27:42 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7F0EC7EABB; Sun, 26 Nov 2017 22:27:41 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5759262678; Sun, 26 Nov 2017 22:27:41 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 226263D393; Sun, 26 Nov 2017 22:27:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQQrF028396 for ; Sun, 26 Nov 2017 17:26:26 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4ACBD18EDA; Sun, 26 Nov 2017 22:26:26 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5C5CD60BE9 for ; Sun, 26 Nov 2017 22:26:25 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:37 +0100 Message-Id: <20171126222549.13681-17-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 16/28] qemu: Format targetModel for serial devices X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Sun, 26 Nov 2017 22:27:41 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Now that we've created a distinction between target type and target model, with the latter being the concrete device name, it's time to switch to formatting the model instead of the type. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- src/qemu/qemu_command.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 0a4684231..718dfb15f 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10375,8 +10375,8 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, serial->info.alias); } } else { - switch ((virDomainChrSerialTargetType) serial->targetType) { - case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: + switch ((virDomainChrSerialTargetModel) serial->targetModel) { + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL: if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_USB_SERIAL)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("usb-serial is not supported in this QEMU= binary")); @@ -10384,10 +10384,10 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, } break; =20 - case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: break; =20 - case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_PCI_SERIAL)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("pci-serial is not supported with this QE= MU binary")); @@ -10395,19 +10395,19 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, } break; =20 - case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: - case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: /* Except from _LAST, which is just a guard value and will nev= er * be used, all of the above are platform devices, which means * qemuBuildSerialCommandLine() will have taken the appropriate * branch and we will not have ended up here. */ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Invalid target type for serial device")); + _("Invalid target model for serial device")); goto error; } =20 virBufferAsprintf(&cmd, "%s,chardev=3Dchar%s,id=3D%s", - virDomainChrSerialTargetTypeToString(serial->tar= getType), + virDomainChrSerialTargetModelTypeToString(serial= ->targetModel), serial->info.alias, serial->info.alias); } =20 --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511735266231154.26727599326443; Sun, 26 Nov 2017 14:27:46 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 04798C119CAB; Sun, 26 Nov 2017 22:27:45 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C9F01648C1; Sun, 26 Nov 2017 22:27:44 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 952AC3D399; Sun, 26 Nov 2017 22:27:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQRPM028401 for ; Sun, 26 Nov 2017 17:26:27 -0500 Received: by smtp.corp.redhat.com (Postfix) id CFC4D18EDA; Sun, 26 Nov 2017 22:26:27 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E165760BE9 for ; Sun, 26 Nov 2017 22:26:26 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:38 +0100 Message-Id: <20171126222549.13681-18-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 17/28] qemu: Remove redundancy in qemuBuildSerialChrDeviceStr() X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sun, 26 Nov 2017 22:27:45 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Instead duplicating the capability check for each possible target model, introduce a small helper that matches the target model with the corresponding capability and collapse all existing checks into a single one. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- src/qemu/qemu_command.c | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 718dfb15f..53b0e6841 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10351,6 +10351,25 @@ qemuBuildCommandLine(virQEMUDriverPtr driver, return NULL; } =20 + +static virQEMUCapsFlags +qemuChrSerialTargetModelToCaps(virDomainChrSerialTargetModel targetModel) +{ + switch (targetModel) { + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL: + return QEMU_CAPS_DEVICE_USB_SERIAL; + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: + return QEMU_CAPS_DEVICE_PCI_SERIAL; + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: + break; + } + + return 0; +} + + /* This function generates the correct '-device' string for character * devices of each architecture. */ @@ -10361,6 +10380,7 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, virQEMUCapsPtr qemuCaps) { virBuffer cmd =3D VIR_BUFFER_INITIALIZER; + virQEMUCapsFlags caps; =20 if (qemuDomainIsPSeries(def)) { if (serial->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && @@ -10377,9 +10397,14 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, } else { switch ((virDomainChrSerialTargetModel) serial->targetModel) { case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL: - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_USB_SERIAL)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("usb-serial is not supported in this QEMU= binary")); + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: + + caps =3D qemuChrSerialTargetModelToCaps(serial->targetModel); + + if (!virQEMUCapsGet(qemuCaps, caps)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("'%s' is not supported in this QEMU binar= y"), + virDomainChrSerialTargetModelTypeToString(s= erial->targetModel)); goto error; } break; @@ -10387,14 +10412,6 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: break; =20 - case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_PCI_SERIAL)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("pci-serial is not supported with this QE= MU binary")); - goto error; - } - break; - case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: /* Except from _LAST, which is just a guard value and will nev= er --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15117352684821022.2109552283093; Sun, 26 Nov 2017 14:27:48 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2CB6E6147B; Sun, 26 Nov 2017 22:27:42 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 08C756055F; Sun, 26 Nov 2017 22:27:42 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C8BC73D395; Sun, 26 Nov 2017 22:27:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQToo028411 for ; Sun, 26 Nov 2017 17:26:29 -0500 Received: by smtp.corp.redhat.com (Postfix) id A840418ED1; Sun, 26 Nov 2017 22:26:29 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6E91560BE9 for ; Sun, 26 Nov 2017 22:26:28 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:39 +0100 Message-Id: <20171126222549.13681-19-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 18/28] conf: Add target type and model for spapr-vty X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Sun, 26 Nov 2017 22:27:47 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We can finally introduce a specific target model 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 show -w'. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1511421 Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- docs/formatdomain.html.in | 9 ++- docs/schemas/domaincommon.rng | 2 + src/conf/domain_conf.c | 6 +- src/conf/domain_conf.h | 2 + src/qemu/qemu_command.c | 67 +++++++++---------= --- src/qemu/qemu_domain.c | 69 ++++++++++++++++++= ---- 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 =3D> 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 =3D> 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 | 4 +- .../qemuxml2xmlout-pseries-console-native.xml | 1 + ...l =3D> qemuxml2xmlout-pseries-console-virtio.xml} | 18 ++---- .../qemuxml2xmlout-pseries-cpu-compat-power9.xml | 4 +- .../qemuxml2xmlout-pseries-cpu-compat.xml | 4 +- .../qemuxml2xmlout-pseries-cpu-exact.xml | 4 +- .../qemuxml2xmlout-pseries-panic-missing.xml | 4 +- .../qemuxml2xmlout-pseries-panic-no-address.xml | 4 +- ...emuxml2xmlout-pseries-serial+console-native.xml | 1 + .../qemuxml2xmlout-pseries-serial-compat.xml | 1 + ...ml =3D> qemuxml2xmlout-pseries-serial-native.xml} | 10 ++-- tests/qemuxml2xmltest.c | 15 +++++ 43 files changed, 291 insertions(+), 107 deletions(-) create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-pseries-console-nat= ive.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-console-nat= ive.xml copy tests/qemuxml2argvdata/{qemuxml2argv-pseries-basic.args =3D> qemuxml2= argv-pseries-console-virtio.args} (59%) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-console-vir= tio.xml create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial+cons= ole-native.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial+cons= ole-native.xml create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-comp= at.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-comp= at.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-inva= lid-machine.xml copy tests/qemuxml2argvdata/{qemuxml2argv-pseries-basic.args =3D> qemuxml2= argv-pseries-serial-native.args} (70%) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-nati= ve.xml create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-console= -native.xml copy tests/qemuxml2xmloutdata/{qemuxml2xmlout-panic-pseries.xml =3D> qemux= ml2xmlout-pseries-console-virtio.xml} (71%) 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 =3D> qemux= ml2xmlout-pseries-serial-native.xml} (79%) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 3126d6ed1..222504a06 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -6546,7 +6546,10 @@ qemu-kvm -net nic,model=3D? /dev/null since 1.0.2, isa-serial (u= sable on x86 machine types), usb-serial (usable whenever USB support is available) - and pci-serial (usable whenever PCI support is availabl= e). + and pci-serial (usable whenever PCI support is availabl= e); + since 3.10.0, + spapr-vio-serial (usable with ppc64/pSeries guests) + is available as well.

=20

@@ -6556,7 +6559,9 @@ qemu-kvm -net nic,model=3D? /dev/null isa-serial (usable with the isa-serial tar= get type); usb-serial (usable with the usb-serial target type); pci-serial - (usable with the pci-serial target type). + (usable with the pci-serial target type); + spapr-vty (usable with the spapr-vio-serial + target type).

=20

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index fbba092d1..1f6d25e1b 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -3585,6 +3585,7 @@ isa-serial usb-serial pci-serial + spapr-vio-serial @@ -3596,6 +3597,7 @@ isa-serial usb-serial pci-serial + spapr-vty diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5df5f3aae..62d54560e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -451,7 +451,9 @@ VIR_ENUM_IMPL(virDomainChrSerialTarget, "none", "isa-serial", "usb-serial", - "pci-serial") + "pci-serial", + "spapr-vio-serial", +); =20 VIR_ENUM_IMPL(virDomainChrChannelTarget, VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_LAST, @@ -478,6 +480,7 @@ VIR_ENUM_IMPL(virDomainChrSerialTargetModel, "isa-serial", "usb-serial", "pci-serial", + "spapr-vty", ); =20 VIR_ENUM_IMPL(virDomainChrDevice, VIR_DOMAIN_CHR_DEVICE_TYPE_LAST, @@ -4057,6 +4060,7 @@ virDomainDefAddConsoleCompat(virDomainDefPtr def) =20 switch ((virDomainChrSerialTargetType) def->serials[0]->targetType= ) { case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: { =20 /* Create a stub console to match the serial port. diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 7895dea55..35f5c63c2 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1081,6 +1081,7 @@ typedef enum { VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA, VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB, VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI, + VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO, =20 VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST } virDomainChrSerialTargetType; @@ -1113,6 +1114,7 @@ typedef enum { VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL, VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL, VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL, + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY, =20 VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST } virDomainChrSerialTargetModel; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 53b0e6841..ad182bf15 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10360,6 +10360,8 @@ qemuChrSerialTargetModelToCaps(virDomainChrSerialTa= rgetModel targetModel) return QEMU_CAPS_DEVICE_USB_SERIAL; case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: return QEMU_CAPS_DEVICE_PCI_SERIAL; + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY: + return QEMU_CAPS_DEVICE_SPAPR_VTY; case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: @@ -10382,52 +10384,39 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, virBuffer cmd =3D VIR_BUFFER_INITIALIZER; virQEMUCapsFlags caps; =20 - if (qemuDomainIsPSeries(def)) { - if (serial->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && - serial->info.type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRV= IO) { - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_SPAPR_VTY)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("spapr-vty not supported in this QEMU bin= ary")); - goto error; - } - - virBufferAsprintf(&cmd, "spapr-vty,chardev=3Dchar%s", - serial->info.alias); - } - } else { - switch ((virDomainChrSerialTargetModel) serial->targetModel) { - case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL: - case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: - - caps =3D qemuChrSerialTargetModelToCaps(serial->targetModel); - - if (!virQEMUCapsGet(qemuCaps, caps)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("'%s' is not supported in this QEMU binar= y"), - virDomainChrSerialTargetModelTypeToString(s= erial->targetModel)); - goto error; - } - break; + switch ((virDomainChrSerialTargetModel) serial->targetModel) { + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY: =20 - case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: - break; + caps =3D qemuChrSerialTargetModelToCaps(serial->targetModel); =20 - case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: - case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: - /* Except from _LAST, which is just a guard value and will nev= er - * be used, all of the above are platform devices, which means - * qemuBuildSerialCommandLine() will have taken the appropriate - * branch and we will not have ended up here. */ - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Invalid target model for serial device")); + if (!virQEMUCapsGet(qemuCaps, caps)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("'%s' is not supported in this QEMU binary"), + virDomainChrSerialTargetModelTypeToString(seria= l->targetModel)); goto error; } + break; =20 - virBufferAsprintf(&cmd, "%s,chardev=3Dchar%s,id=3D%s", - virDomainChrSerialTargetModelTypeToString(serial= ->targetModel), - serial->info.alias, serial->info.alias); + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: + break; + + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: + /* Except from _LAST, which is just a guard value and will never + * be used, all of the above are platform devices, which means + * qemuBuildSerialCommandLine() will have taken the appropriate + * branch and we will not have ended up here. */ + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Invalid target model for serial device")); + goto error; } =20 + virBufferAsprintf(&cmd, "%s,chardev=3Dchar%s,id=3D%s", + virDomainChrSerialTargetModelTypeToString(serial->ta= rgetModel), + serial->info.alias, serial->info.alias); + if (qemuBuildDeviceAddressStr(&cmd, def, &serial->info, qemuCaps) < 0) goto error; =20 diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 0b033f496..d8ab6ed52 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3470,6 +3470,8 @@ qemuDomainChrSerialTargetTypeToAddressType(int target= Type) return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB; case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI; + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: + return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO; case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: break; @@ -3489,6 +3491,8 @@ qemuDomainChrSerialTargetModelToTargetType(int target= Model) return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB; case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI; + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY: + return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO; case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: break; @@ -3499,8 +3503,7 @@ qemuDomainChrSerialTargetModelToTargetType(int target= Model) =20 =20 static int -qemuDomainChrTargetDefValidate(const virDomainDef *def, - const virDomainChrDef *chr) +qemuDomainChrTargetDefValidate(const virDomainChrDef *chr) { int expected; =20 @@ -3512,11 +3515,7 @@ qemuDomainChrTargetDefValidate(const virDomainDef *d= ef, case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: - - /* Hack required until we have a proper type for pSeries - * serial consoles */ - if (qemuDomainIsPSeries(def)) - return 0; + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: =20 expected =3D qemuDomainChrSerialTargetTypeToAddressType(chr->t= argetType); =20 @@ -3540,6 +3539,7 @@ qemuDomainChrTargetDefValidate(const virDomainDef *de= f, case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY: =20 expected =3D qemuDomainChrSerialTargetModelToTargetType(chr->t= argetModel); =20 @@ -3577,7 +3577,7 @@ qemuDomainChrDefValidate(const virDomainChrDef *dev, if (qemuDomainChrSourceDefValidate(dev->source) < 0) return -1; =20 - if (qemuDomainChrTargetDefValidate(def, dev) < 0) + if (qemuDomainChrTargetDefValidate(dev) < 0) return -1; =20 if (dev->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL && @@ -3587,6 +3587,26 @@ qemuDomainChrDefValidate(const virDomainChrDef *dev, return -1; } =20 + if (dev->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL) { + bool isCompatible =3D true; + + if (!qemuDomainIsPSeries(def) && + (dev->targetType =3D=3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAP= R_VIO || + dev->targetModel =3D=3D VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SP= APR_VTY)) { + isCompatible =3D false; + } + + if (!isCompatible) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Serial device with target type '%s' and " + "target model '%s' not compatible with guest " + "architecture or machine type"), + virDomainChrSerialTargetTypeToString(dev->targe= tType), + virDomainChrSerialTargetModelTypeToString(dev->= targetModel)); + return -1; + } + } + return 0; } =20 @@ -4226,10 +4246,7 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr, if (ARCH_IS_X86(def->os.arch)) { chr->targetType =3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA; } else if (qemuDomainIsPSeries(def)) { - /* Setting TYPE_ISA here is just a temporary hack to reduce te= st - * suite churn. Later on we will have a proper serial type for - * pSeries and this line will be updated accordingly. */ - chr->targetType =3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA; + chr->targetType =3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VI= O; } } =20 @@ -4246,6 +4263,9 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr, case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: chr->targetModel =3D VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SE= RIAL; break; + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: + chr->targetModel =3D VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_= VTY; + break; case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: /* Nothing to do */ @@ -5151,6 +5171,31 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr driv= er, goto cleanup; } =20 + for (i =3D 0; i < def->nserials; i++) { + virDomainChrDefPtr serial =3D def->serials[i]; + + /* Historically, the native console type for some machine types + * was not set at all, which means it defaulted to ISA even + * though that was not even remotely accurate. To ensure migra= tion + * towards older libvirt versions works for such guests, we sw= itch + * it back to the default here */ + if (flags & VIR_DOMAIN_XML_MIGRATABLE) { + switch ((virDomainChrSerialTargetType) serial->targetType)= { + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: + serial->targetType =3D VIR_DOMAIN_CHR_SERIAL_TARGET_TY= PE_NONE; + serial->targetModel =3D VIR_DOMAIN_CHR_SERIAL_TARGET_M= ODEL_NONE; + break; + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: + /* Nothing to do */ + break; + } + } + } + /* Replace the CPU definition updated according to QEMU with the o= ne * used for starting the domain. The updated def will be sent * separately for backward compatibility. diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 989c0e6c9..2319e503e 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -782,6 +782,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDevic= eDefPtr dev, =20 case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: return 0; diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.args b/tests= /qemuxml2argvdata/qemuxml2argv-pseries-basic.args index 97a7057ba..789d9f679 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.args @@ -20,4 +20,4 @@ server,nowait \ -boot c \ -usb \ -chardev pty,id=3Dcharserial0 \ --device spapr-vty,chardev=3Dcharserial0,reg=3D0x30000000 +-device spapr-vty,chardev=3Dcharserial0,id=3Dserial0,reg=3D0x30000000 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-native.arg= s b/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-native.args new file mode 120000 index 000000000..d6c830ecd --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-native.args @@ -0,0 +1 @@ +qemuxml2argv-pseries-serial-native.args \ No newline at end of file diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-native.xml= b/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-native.xml new file mode 100644 index 000000000..9f37bf0de --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-native.xml @@ -0,0 +1,17 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 1 + + hvm + + + /usr/bin/qemu-system-ppc64 + + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.args b/tests= /qemuxml2argvdata/qemuxml2argv-pseries-console-virtio.args similarity index 59% copy from tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.args copy to tests/qemuxml2argvdata/qemuxml2argv-pseries-console-virtio.args index 97a7057ba..343018fb3 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-virtio.args @@ -5,7 +5,7 @@ USER=3Dtest \ LOGNAME=3Dtest \ QEMU_AUDIO_DRV=3Dnone \ /usr/bin/qemu-system-ppc64 \ --name QEMUGuest1 \ +-name guest \ -S \ -M pseries \ -m 512 \ @@ -14,10 +14,10 @@ QEMU_AUDIO_DRV=3Dnone \ -nographic \ -nodefconfig \ -nodefaults \ --chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-guest/monitor.s= ock,\ server,nowait \ -mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ -boot c \ --usb \ --chardev pty,id=3Dcharserial0 \ --device spapr-vty,chardev=3Dcharserial0,reg=3D0x30000000 +-device virtio-serial-pci,id=3Dvirtio-serial0,bus=3Dpci.0,addr=3D0x1 \ +-chardev pty,id=3Dcharconsole0 \ +-device virtconsole,chardev=3Dcharconsole0,id=3Dconsole0 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-virtio.xml= b/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-virtio.xml new file mode 100644 index 000000000..0190ab63a --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-virtio.xml @@ -0,0 +1,19 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 1 + + hvm + + + /usr/bin/qemu-system-ppc64 + + + + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat-power9.= args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat-power9.args index af93d63dc..9bb375aeb 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat-power9.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat-power9.args @@ -21,4 +21,4 @@ server,nowait \ -boot c \ -usb \ -chardev pty,id=3Dcharserial0 \ --device spapr-vty,chardev=3Dcharserial0,reg=3D0x30000000 +-device spapr-vty,chardev=3Dcharserial0,id=3Dserial0,reg=3D0x30000000 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args b/= tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args index 7740e2f5a..5174aa760 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args @@ -21,4 +21,4 @@ server,nowait \ -boot c \ -usb \ -chardev pty,id=3Dcharserial0 \ --device spapr-vty,chardev=3Dcharserial0,reg=3D0x30000000 +-device spapr-vty,chardev=3Dcharserial0,id=3Dserial0,reg=3D0x30000000 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-exact.args b/t= ests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-exact.args index d2c99a7fa..3790deca8 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-exact.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-exact.args @@ -21,4 +21,4 @@ server,nowait \ -boot c \ -usb \ -chardev pty,id=3Dcharserial0 \ --device spapr-vty,chardev=3Dcharserial0,reg=3D0x30000000 +-device spapr-vty,chardev=3Dcharserial0,id=3Dserial0,reg=3D0x30000000 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args b/test= s/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args index 97a7057ba..789d9f679 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args @@ -20,4 +20,4 @@ server,nowait \ -boot c \ -usb \ -chardev pty,id=3Dcharserial0 \ --device spapr-vty,chardev=3Dcharserial0,reg=3D0x30000000 +-device spapr-vty,chardev=3Dcharserial0,id=3Dserial0,reg=3D0x30000000 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic-missing.args= b/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic-missing.args index 97a7057ba..789d9f679 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic-missing.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic-missing.args @@ -20,4 +20,4 @@ server,nowait \ -boot c \ -usb \ -chardev pty,id=3Dcharserial0 \ --device spapr-vty,chardev=3Dcharserial0,reg=3D0x30000000 +-device spapr-vty,chardev=3Dcharserial0,id=3Dserial0,reg=3D0x30000000 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic-no-address.a= rgs b/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic-no-address.args index 97a7057ba..789d9f679 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic-no-address.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic-no-address.args @@ -20,4 +20,4 @@ server,nowait \ -boot c \ -usb \ -chardev pty,id=3Dcharserial0 \ --device spapr-vty,chardev=3Dcharserial0,reg=3D0x30000000 +-device spapr-vty,chardev=3Dcharserial0,id=3Dserial0,reg=3D0x30000000 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial+console-nat= ive.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial+console-nativ= e.args new file mode 120000 index 000000000..d6c830ecd --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial+console-native.args @@ -0,0 +1 @@ +qemuxml2argv-pseries-serial-native.args \ No newline at end of file diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial+console-nat= ive.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial+console-native= .xml new file mode 100644 index 000000000..2733baa98 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial+console-native.xml @@ -0,0 +1,18 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 1 + + hvm + + + /usr/bin/qemu-system-ppc64 + + + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-compat.args= b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-compat.args new file mode 120000 index 000000000..d6c830ecd --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-compat.args @@ -0,0 +1 @@ +qemuxml2argv-pseries-serial-native.args \ No newline at end of file diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-compat.xml = b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-compat.xml new file mode 100644 index 000000000..2e182edbd --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-compat.xml @@ -0,0 +1,19 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 1 + + hvm + + + /usr/bin/qemu-system-ppc64 + + + + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-invalid-mac= hine.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-invalid-machi= ne.xml new file mode 100644 index 000000000..5482146a5 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-invalid-machine.xml @@ -0,0 +1,19 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 1 + + hvm + + + /usr/bin/qemu-system-x86_64 + + + + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.args b/tests= /qemuxml2argvdata/qemuxml2argv-pseries-serial-native.args similarity index 70% copy from tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.args copy to tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-native.args index 97a7057ba..f72b8b625 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-native.args @@ -5,7 +5,7 @@ USER=3Dtest \ LOGNAME=3Dtest \ QEMU_AUDIO_DRV=3Dnone \ /usr/bin/qemu-system-ppc64 \ --name QEMUGuest1 \ +-name guest \ -S \ -M pseries \ -m 512 \ @@ -14,10 +14,9 @@ QEMU_AUDIO_DRV=3Dnone \ -nographic \ -nodefconfig \ -nodefaults \ --chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-guest/monitor.s= ock,\ server,nowait \ -mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ -boot c \ --usb \ -chardev pty,id=3Dcharserial0 \ --device spapr-vty,chardev=3Dcharserial0,reg=3D0x30000000 +-device spapr-vty,chardev=3Dcharserial0,id=3Dserial0,reg=3D0x30000000 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-native.xml = b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-native.xml new file mode 100644 index 000000000..6cec4bc9d --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-native.xml @@ -0,0 +1,16 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 1 + + hvm + + + /usr/bin/qemu-system-ppc64 + + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args b= /tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args index a92b1e01b..37c059403 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args @@ -20,4 +20,4 @@ server,nowait \ -boot c \ -device pci-ohci,id=3Dusb,bus=3Dpci.0,addr=3D0x1 \ -chardev pty,id=3Dcharserial0 \ --device spapr-vty,chardev=3Dcharserial0,reg=3D0x30000000 +-device spapr-vty,chardev=3Dcharserial0,id=3Dserial0,reg=3D0x30000000 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args b/tes= ts/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args index caaccdbb8..838b80453 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args @@ -20,5 +20,5 @@ server,nowait \ -boot c \ -device pci-ohci,id=3Dusb,bus=3Dpci.0,addr=3D0x1 \ -chardev pty,id=3Dcharserial0 \ --device spapr-vty,chardev=3Dcharserial0,reg=3D0x30000000 \ +-device spapr-vty,chardev=3Dcharserial0,id=3Dserial0,reg=3D0x30000000 \ -device usb-kbd,id=3Dinput0,bus=3Dusb.0,port=3D1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-multi.args b/t= ests/qemuxml2argvdata/qemuxml2argv-pseries-usb-multi.args index b9bd905a5..56bc1d67e 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-multi.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-multi.args @@ -21,4 +21,4 @@ server,nowait \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1 \ -device pci-ohci,id=3Dusb1,bus=3Dpci.0,addr=3D0x2 \ -chardev pty,id=3Dcharserial0 \ --device spapr-vty,chardev=3Dcharserial0,reg=3D0x30000000 +-device spapr-vty,chardev=3Dcharserial0,id=3Dserial0,reg=3D0x30000000 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-user-assigned.= args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-user-assigned.args index 63cf3c183..0fcfbe379 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-user-assigned.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-user-assigned.args @@ -25,6 +25,6 @@ server,nowait \ -device scsi-disk,bus=3Dscsi1.0,channel=3D0,scsi-id=3D0,lun=3D0,\ drive=3Ddrive-scsi1-0-0-0,id=3Dscsi1-0-0-0 \ -chardev pty,id=3Dcharserial0 \ --device spapr-vty,chardev=3Dcharserial0,reg=3D0x20000000 \ +-device spapr-vty,chardev=3Dcharserial0,id=3Dserial0,reg=3D0x20000000 \ -chardev pty,id=3Dcharserial1 \ --device spapr-vty,chardev=3Dcharserial1,reg=3D0x30001000 +-device spapr-vty,chardev=3Dcharserial1,id=3Dserial1,reg=3D0x30001000 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio.args b/tests/q= emuxml2argvdata/qemuxml2argv-pseries-vio.args index 0294067bc..8a9bdcc4c 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio.args @@ -25,6 +25,6 @@ server,nowait \ -device scsi-disk,bus=3Dscsi1.0,channel=3D0,scsi-id=3D0,lun=3D0,\ drive=3Ddrive-scsi1-0-0-0,id=3Dscsi1-0-0-0 \ -chardev pty,id=3Dcharserial0 \ --device spapr-vty,chardev=3Dcharserial0,reg=3D0x30000000 \ +-device spapr-vty,chardev=3Dcharserial0,id=3Dserial0,reg=3D0x30000000 \ -chardev pty,id=3Dcharserial1 \ --device spapr-vty,chardev=3Dcharserial1,reg=3D0x30001000 +-device spapr-vty,chardev=3Dcharserial1,id=3Dserial1,reg=3D0x30001000 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 29df253b8..5827a47e5 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1877,6 +1877,22 @@ mymain(void) QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); =20 + DO_TEST("pseries-serial-native", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_DEVICE_SPAPR_VTY); + DO_TEST("pseries-serial+console-native", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_DEVICE_SPAPR_VTY); + DO_TEST("pseries-serial-compat", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_DEVICE_SPAPR_VTY); + DO_TEST("pseries-console-native", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_DEVICE_SPAPR_VTY); + DO_TEST("pseries-console-virtio", + QEMU_CAPS_NODEFCONFIG); + DO_TEST_PARSE_ERROR("pseries-serial-invalid-machine", NONE); + DO_TEST("disk-ide-drive-split", QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_IDE_CD); diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml b/te= sts/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml index 496df0696..484fe4cfa 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml @@ -22,8 +22,8 @@ - - + +

diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-console-native= .xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-console-native.xml new file mode 120000 index 000000000..b0e645fc0 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-console-native.xml @@ -0,0 +1 @@ +qemuxml2xmlout-pseries-serial-native.xml \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml b/te= sts/qemuxml2xmloutdata/qemuxml2xmlout-pseries-console-virtio.xml similarity index 71% copy from tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml copy to tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-console-virtio.xml index 496df0696..48760f282 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-console-virtio.xml @@ -1,5 +1,5 @@ - QEMUGuest1 + guest 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 524288 524288 @@ -14,22 +14,16 @@ destroy /usr/bin/qemu-system-ppc64 - -
- + - - - - -
- + +
+ - -
+ diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-pow= er9.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9= .xml index 9d4c5efe6..404bb0c76 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9.xml @@ -25,8 +25,8 @@ - - + +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml= b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml index 6059859ab..1891fa5f4 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml @@ -25,8 +25,8 @@ - - + +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml = b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml index f3216523e..f08f3e005 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml @@ -26,8 +26,8 @@ - - + +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.= xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml index 496df0696..484fe4cfa 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml @@ -22,8 +22,8 @@ - - + +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-addre= ss.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.x= ml index 496df0696..484fe4cfa 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml @@ -22,8 +22,8 @@ - - + +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial+console= -native.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial+consol= e-native.xml new file mode 120000 index 000000000..b0e645fc0 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial+console-native= .xml @@ -0,0 +1 @@ +qemuxml2xmlout-pseries-serial-native.xml \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-compat.= xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-compat.xml new file mode 120000 index 000000000..b0e645fc0 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-compat.xml @@ -0,0 +1 @@ +qemuxml2xmlout-pseries-serial-native.xml \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml b/te= sts/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-native.xml similarity index 79% copy from tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml copy to tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-native.xml index 496df0696..fae7c54d5 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-native.xml @@ -1,5 +1,5 @@ - QEMUGuest1 + guest 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 524288 524288 @@ -14,16 +14,14 @@ destroy /usr/bin/qemu-system-ppc64 - -
- + - - + +
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index d66cf155d..4318ae503 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -768,6 +768,21 @@ mymain(void) QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); =20 + DO_TEST("pseries-serial-native", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_DEVICE_SPAPR_VTY); + DO_TEST("pseries-serial+console-native", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_DEVICE_SPAPR_VTY); + DO_TEST("pseries-serial-compat", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_DEVICE_SPAPR_VTY); + DO_TEST("pseries-console-native", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_DEVICE_SPAPR_VTY); + DO_TEST("pseries-console-virtio", + QEMU_CAPS_NODEFCONFIG); + DO_TEST("balloon-device-auto", NONE); DO_TEST("balloon-device-period", NONE); DO_TEST("channel-virtio-auto", NONE); --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511735268430113.49373999572072; Sun, 26 Nov 2017 14:27:48 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8CEBAC04BD33; Sun, 26 Nov 2017 22:27:47 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 680AF60460; Sun, 26 Nov 2017 22:27:47 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 383843D39D; Sun, 26 Nov 2017 22:27:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQXiO028427 for ; Sun, 26 Nov 2017 17:26:33 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8DC5960BE9; Sun, 26 Nov 2017 22:26:33 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A7F83614F3 for ; Sun, 26 Nov 2017 22:26:29 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:40 +0100 Message-Id: <20171126222549.13681-20-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 19/28] qemu: Support usb-serial and pci-serial on pSeries X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sun, 26 Nov 2017 22:27:47 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The existing implementation set the address type for all serial devices to spapr-vio, which made it impossible to use other devices such as usb-serial and pci-serial; moreover, some decisions were made based on the address type rather than the device type. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1512934 Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- src/qemu/qemu_command.c | 9 ------ src/qemu/qemu_domain_address.c | 3 +- .../qemuxml2argv-pseries-serial-pci.args | 22 +++++++++++++++ .../qemuxml2argv-pseries-serial-pci.xml | 18 ++++++++++++ .../qemuxml2argv-pseries-serial-usb.args | 23 ++++++++++++++++ .../qemuxml2argv-pseries-serial-usb.xml | 21 ++++++++++++++ tests/qemuxml2argvtest.c | 7 +++++ .../qemuxml2xmlout-pseries-serial-pci.xml | 31 ++++++++++++++++++= +++ .../qemuxml2xmlout-pseries-serial-usb.xml | 32 ++++++++++++++++++= ++++ tests/qemuxml2xmltest.c | 7 +++++ 10 files changed, 163 insertions(+), 10 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-pci.= args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-pci.= xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-usb.= args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-usb.= xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-= pci.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-= usb.xml diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index ad182bf15..3b8757e10 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -9243,15 +9243,6 @@ static bool qemuChrIsPlatformDevice(const virDomainDef *def, virDomainChrDefPtr chr) { - if ((def->os.arch =3D=3D VIR_ARCH_PPC) || ARCH_IS_PPC64(def->os.arch))= { - if (!qemuDomainIsPSeries(def)) - return true; - /* only pseries need -device spapr-vty with -chardev */ - if (chr->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && - chr->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO) - return true; - } - if (def->os.arch =3D=3D VIR_ARCH_ARMV7L || def->os.arch =3D=3D VIR_ARC= H_AARCH64) { /* TARGET_TYPE_ISA here really means 'the default platform device'= */ if (chr->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 2319e503e..f62bb2f97 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -246,8 +246,9 @@ qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def, =20 for (i =3D 0; i < def->nserials; i++) { if (def->serials[i]->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_= SERIAL && - qemuDomainIsPSeries(def)) + def->serials[i]->targetType =3D=3D VIR_DOMAIN_CHR_SERIAL_TARGE= T_TYPE_SPAPR_VIO) { def->serials[i]->info.type =3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_= SPAPRVIO; + } if (qemuDomainAssignSpaprVIOAddress(def, &def->serials[i]->info, VIO_ADDR_SERIAL) < 0) goto cleanup; diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-pci.args b/= tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-pci.args new file mode 100644 index 000000000..eb2a9bf0e --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-pci.args @@ -0,0 +1,22 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-ppc64 \ +-name guest \ +-S \ +-M pseries \ +-m 512 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-nographic \ +-nodefconfig \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-guest/monitor.s= ock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ +-boot c \ +-chardev pty,id=3Dcharserial0 \ +-device pci-serial,chardev=3Dcharserial0,id=3Dserial0,bus=3Dpci.0,addr=3D0= x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-pci.xml b/t= ests/qemuxml2argvdata/qemuxml2argv-pseries-serial-pci.xml new file mode 100644 index 000000000..2c2534b4c --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-pci.xml @@ -0,0 +1,18 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 1 + + hvm + + + /usr/bin/qemu-system-ppc64 + + + + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-usb.args b/= tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-usb.args new file mode 100644 index 000000000..0403985dc --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-usb.args @@ -0,0 +1,23 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-ppc64 \ +-name guest \ +-S \ +-M pseries \ +-m 512 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-nographic \ +-nodefconfig \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-guest/monitor.s= ock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ +-boot c \ +-device qemu-xhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1 \ +-chardev pty,id=3Dcharserial0 \ +-device usb-serial,chardev=3Dcharserial0,id=3Dserial0,bus=3Dusb.0,port=3D1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-usb.xml b/t= ests/qemuxml2argvdata/qemuxml2argv-pseries-serial-usb.xml new file mode 100644 index 000000000..734c90c66 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-usb.xml @@ -0,0 +1,21 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 1 + + hvm + + + /usr/bin/qemu-system-ppc64 + + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 5827a47e5..0ba23d070 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1886,6 +1886,13 @@ mymain(void) DO_TEST("pseries-serial-compat", QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DEVICE_SPAPR_VTY); + DO_TEST("pseries-serial-pci", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_DEVICE_PCI_SERIAL); + DO_TEST("pseries-serial-usb", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_DEVICE_QEMU_XHCI, + QEMU_CAPS_DEVICE_USB_SERIAL); DO_TEST("pseries-console-native", QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DEVICE_SPAPR_VTY); diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-pci.xml= b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-pci.xml new file mode 100644 index 000000000..cba7ea96b --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-pci.xml @@ -0,0 +1,31 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 524288 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-ppc64 + + + + + + + + + +
+ + + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-usb.xml= b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-usb.xml new file mode 100644 index 000000000..34f651308 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-usb.xml @@ -0,0 +1,32 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 524288 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-ppc64 + +
+ + + + + + + + + + + + + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 4318ae503..45cb739cd 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -777,6 +777,13 @@ mymain(void) DO_TEST("pseries-serial-compat", QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DEVICE_SPAPR_VTY); + DO_TEST("pseries-serial-pci", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_DEVICE_PCI_SERIAL); + DO_TEST("pseries-serial-usb", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_DEVICE_QEMU_XHCI, + QEMU_CAPS_DEVICE_USB_SERIAL); DO_TEST("pseries-console-native", QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DEVICE_SPAPR_VTY); --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511735210002856.2562558838368; Sun, 26 Nov 2017 14:26:50 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 098285A6E; Sun, 26 Nov 2017 22:26:49 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DA04660F91; Sun, 26 Nov 2017 22:26:48 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A6ED13D381; Sun, 26 Nov 2017 22:26:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQZZI028437 for ; Sun, 26 Nov 2017 17:26:35 -0500 Received: by smtp.corp.redhat.com (Postfix) id 68F4160BE9; Sun, 26 Nov 2017 22:26:35 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2FDA118EDA for ; Sun, 26 Nov 2017 22:26:33 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:41 +0100 Message-Id: <20171126222549.13681-21-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 20/28] conf: Add target type and model for pl011 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Sun, 26 Nov 2017 22:26:49 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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=3D151292 Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- 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-n= ative.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-n= ative.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-v= irtio.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-v= irtio.xml create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial+co= nsole-native.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial+co= nsole-native.xml create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-co= mpat.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-co= mpat.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-in= valid-machine.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-na= tive.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-na= tive.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-pc= i.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-pc= i.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-us= b.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-us= b.xml create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-conso= le-native.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-conso= le-virtio.xml create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-seria= l+console-native.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-seria= l-compat.xml create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-seria= l-native.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-seria= l-pci.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-seria= l-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=3D? /dev/null usb-serial (usable whenever USB support is available) and pci-serial (usable whenever PCI support is availabl= e); since 3.10.0, - spapr-vio-serial (usable with ppc64/pSeries guests) - is available as well. + spapr-vio-serial (usable with ppc64/pSeries guests) and + system-serial (usable with aarch64/virt guests) are + available as well.

=20

@@ -6561,7 +6562,8 @@ qemu-kvm -net nic,model=3D? /dev/null target type); pci-serial (usable with the pci-serial target type); spapr-vty (usable with the spapr-vio-serial - target type). + target type); pl011 (usable with the + system-serial target type).

=20

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 1f6d25e1b..5fff3a40f 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -3586,6 +3586,7 @@ usb-serial pci-serial spapr-vio-serial + system-serial @@ -3598,6 +3599,7 @@ usb-serial pci-serial spapr-vty + pl011 diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 62d54560e..820caba0f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -453,6 +453,7 @@ VIR_ENUM_IMPL(virDomainChrSerialTarget, "usb-serial", "pci-serial", "spapr-vio-serial", + "system-serial", ); =20 VIR_ENUM_IMPL(virDomainChrChannelTarget, @@ -481,6 +482,7 @@ VIR_ENUM_IMPL(virDomainChrSerialTargetModel, "usb-serial", "pci-serial", "spapr-vty", + "pl011", ); =20 VIR_ENUM_IMPL(virDomainChrDevice, VIR_DOMAIN_CHR_DEVICE_TYPE_LAST, @@ -4061,6 +4063,7 @@ virDomainDefAddConsoleCompat(virDomainDefPtr def) switch ((virDomainChrSerialTargetType) def->serials[0]->targetType= ) { case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: { =20 /* Create a stub console to match the serial port. diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 35f5c63c2..28d158980 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1082,6 +1082,7 @@ typedef enum { VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB, VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI, VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO, + VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM, =20 VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST } virDomainChrSerialTargetType; @@ -1115,6 +1116,7 @@ typedef enum { VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL, VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL, VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY, + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011, =20 VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST } virDomainChrSerialTargetModel; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 3b8757e10..a8aaa3d8c 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -9244,10 +9244,13 @@ qemuChrIsPlatformDevice(const virDomainDef *def, virDomainChrDefPtr chr) { if (def->os.arch =3D=3D VIR_ARCH_ARMV7L || def->os.arch =3D=3D VIR_ARC= H_AARCH64) { - /* TARGET_TYPE_ISA here really means 'the default platform device'= */ + + /* pl011 (used on mach-virt) is a platform device */ if (chr->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && - chr->targetType =3D=3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA) + chr->targetType =3D=3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTE= M && + chr->targetModel =3D=3D VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL0= 11) { return true; + } } =20 /* If we got all the way here and we're still stuck with the default @@ -10354,6 +10357,7 @@ qemuChrSerialTargetModelToCaps(virDomainChrSerialTa= rgetModel targetModel) case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY: return QEMU_CAPS_DEVICE_SPAPR_VTY; case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: break; @@ -10393,6 +10397,7 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: break; =20 + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: /* Except from _LAST, which is just a guard value and will never diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d8ab6ed52..2cc91b468 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3472,6 +3472,7 @@ qemuDomainChrSerialTargetTypeToAddressType(int target= Type) return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI; case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO; + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: break; @@ -3493,6 +3494,8 @@ qemuDomainChrSerialTargetModelToTargetType(int target= Model) return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI; case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY: return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO; + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011: + return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM; case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: break; @@ -3529,6 +3532,16 @@ qemuDomainChrTargetDefValidate(const virDomainChrDef= *chr) } break; =20 + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM: + if (chr->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target type '%s' cannot have an " + "associated address"), + virDomainChrSerialTargetTypeToString(chr->t= argetType)); + return -1; + } + break; + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: break; @@ -3540,6 +3553,7 @@ qemuDomainChrTargetDefValidate(const virDomainChrDef = *chr) case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011: =20 expected =3D qemuDomainChrSerialTargetModelToTargetType(chr->t= argetModel); =20 @@ -3596,6 +3610,12 @@ qemuDomainChrDefValidate(const virDomainChrDef *dev, isCompatible =3D false; } =20 + if (!qemuDomainIsVirt(def) && + (dev->targetType =3D=3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYST= EM || + dev->targetModel =3D=3D VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL= 011)) { + isCompatible =3D false; + } + if (!isCompatible) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Serial device with target type '%s' and " @@ -4247,6 +4267,8 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr, chr->targetType =3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA; } else if (qemuDomainIsPSeries(def)) { chr->targetType =3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VI= O; + } else if (qemuDomainIsVirt(def)) { + chr->targetType =3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM; } } =20 @@ -4266,6 +4288,9 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr, case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: chr->targetModel =3D VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_= VTY; break; + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM: + chr->targetModel =3D VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011; + break; case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: /* Nothing to do */ @@ -5182,6 +5207,7 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr drive= r, if (flags & VIR_DOMAIN_XML_MIGRATABLE) { switch ((virDomainChrSerialTargetType) serial->targetType)= { case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM: serial->targetType =3D VIR_DOMAIN_CHR_SERIAL_TARGET_TY= PE_NONE; serial->targetModel =3D VIR_DOMAIN_CHR_SERIAL_TARGET_M= ODEL_NONE; break; diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index f62bb2f97..db9656a3a 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -784,6 +784,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDevic= eDefPtr dev, case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: return 0; diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-native.a= rgs b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-native.args new file mode 120000 index 000000000..1a90484d3 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-native.args @@ -0,0 +1 @@ +qemuxml2argv-mach-virt-serial-native.args \ No newline at end of file diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-native.x= ml b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-native.xml new file mode 100644 index 000000000..6aba864d0 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-native.xml @@ -0,0 +1,17 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 1 + + hvm + + + /usr/bin/qemu-system-aarch64 + + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-virtio.a= rgs b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-virtio.args new file mode 100644 index 000000000..2a862bff1 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-virtio.args @@ -0,0 +1,24 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-aarch64 \ +-name guest \ +-S \ +-M virt \ +-m 512 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-nographic \ +-nodefconfig \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-guest/monitor.s= ock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ +-no-acpi \ +-boot c \ +-device virtio-serial,id=3Dvirtio-serial0 \ +-chardev pty,id=3Dcharconsole0 \ +-device virtconsole,chardev=3Dcharconsole0,id=3Dconsole0 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-virtio.x= ml b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-virtio.xml new file mode 100644 index 000000000..92704504c --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-virtio.xml @@ -0,0 +1,19 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 1 + + hvm + + + /usr/bin/qemu-system-aarch64 + + + + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial+console-n= ative.args b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial+console-n= ative.args new file mode 120000 index 000000000..1a90484d3 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial+console-native.a= rgs @@ -0,0 +1 @@ +qemuxml2argv-mach-virt-serial-native.args \ No newline at end of file diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial+console-n= ative.xml b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial+console-na= tive.xml new file mode 100644 index 000000000..549b764e9 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial+console-native.x= ml @@ -0,0 +1,18 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 1 + + hvm + + + /usr/bin/qemu-system-aarch64 + + + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-compat.ar= gs b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-compat.args new file mode 120000 index 000000000..1a90484d3 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-compat.args @@ -0,0 +1 @@ +qemuxml2argv-mach-virt-serial-native.args \ No newline at end of file diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-compat.xm= l b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-compat.xml new file mode 100644 index 000000000..9e6be3ffe --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-compat.xml @@ -0,0 +1,19 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 1 + + hvm + + + /usr/bin/qemu-system-aarch64 + + + + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-invalid-m= achine.xml b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-invalid-m= achine.xml new file mode 100644 index 000000000..a8de76abf --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-invalid-machine.= xml @@ -0,0 +1,21 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 1 + + hvm + + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-native.ar= gs b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-native.args new file mode 100644 index 000000000..f4bfce376 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-native.args @@ -0,0 +1,23 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-aarch64 \ +-name guest \ +-S \ +-M virt \ +-m 512 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-nographic \ +-nodefconfig \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-guest/monitor.s= ock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ +-no-acpi \ +-boot c \ +-chardev pty,id=3Dcharserial0 \ +-serial chardev:charserial0 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-native.xm= l b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-native.xml new file mode 100644 index 000000000..817f606ee --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-native.xml @@ -0,0 +1,16 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 1 + + hvm + + + /usr/bin/qemu-system-aarch64 + + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-pci.args = b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-pci.args new file mode 100644 index 000000000..334194efe --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-pci.args @@ -0,0 +1,26 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-aarch64 \ +-name guest \ +-S \ +-M virt \ +-m 512 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-nographic \ +-nodefconfig \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-guest/monitor.s= ock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ +-no-acpi \ +-boot c \ +-device i82801b11-bridge,id=3Dpci.1,bus=3Dpcie.0,addr=3D0x1 \ +-device pci-bridge,chassis_nr=3D2,id=3Dpci.2,bus=3Dpci.1,addr=3D0x0 \ +-device pcie-root-port,port=3D0x10,chassis=3D3,id=3Dpci.3,bus=3Dpcie.0,add= r=3D0x2 \ +-chardev pty,id=3Dcharserial0 \ +-device pci-serial,chardev=3Dcharserial0,id=3Dserial0,bus=3Dpci.2,addr=3D0= x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-pci.xml b= /tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-pci.xml new file mode 100644 index 000000000..29aa7664b --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-pci.xml @@ -0,0 +1,18 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 1 + + hvm + + + /usr/bin/qemu-system-aarch64 + + + + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-usb.args = b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-usb.args new file mode 100644 index 000000000..44c4027ac --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-usb.args @@ -0,0 +1,27 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-aarch64 \ +-name guest \ +-S \ +-M virt \ +-m 512 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-nographic \ +-nodefconfig \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-guest/monitor.s= ock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ +-no-acpi \ +-boot c \ +-device pcie-root-port,port=3D0x8,chassis=3D1,id=3Dpci.1,bus=3Dpcie.0,mult= ifunction=3Don,\ +addr=3D0x1 \ +-device pcie-root-port,port=3D0x9,chassis=3D2,id=3Dpci.2,bus=3Dpcie.0,addr= =3D0x1.0x1 \ +-device qemu-xhci,id=3Dusb,bus=3Dpci.1,addr=3D0x0 \ +-chardev pty,id=3Dcharserial0 \ +-device usb-serial,chardev=3Dcharserial0,id=3Dserial0,bus=3Dusb.0,port=3D1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-usb.xml b= /tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-usb.xml new file mode 100644 index 000000000..35f192a3e --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-usb.xml @@ -0,0 +1,21 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 1 + + hvm + + + /usr/bin/qemu-system-aarch64 + + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 0ba23d070..593057653 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1900,6 +1900,33 @@ mymain(void) QEMU_CAPS_NODEFCONFIG); DO_TEST_PARSE_ERROR("pseries-serial-invalid-machine", NONE); =20 + DO_TEST("mach-virt-serial-native", + QEMU_CAPS_NODEFCONFIG); + DO_TEST("mach-virt-serial+console-native", + QEMU_CAPS_NODEFCONFIG); + DO_TEST("mach-virt-serial-compat", + QEMU_CAPS_NODEFCONFIG); + DO_TEST("mach-virt-serial-pci", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_OBJECT_GPEX, + QEMU_CAPS_PCI_MULTIFUNCTION, + QEMU_CAPS_DEVICE_PCIE_ROOT_PORT, + QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, + QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_PCI_SERIAL); + DO_TEST("mach-virt-serial-usb", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_OBJECT_GPEX, + QEMU_CAPS_PCI_MULTIFUNCTION, + QEMU_CAPS_DEVICE_PCIE_ROOT_PORT, + QEMU_CAPS_DEVICE_QEMU_XHCI, + QEMU_CAPS_DEVICE_USB_SERIAL); + DO_TEST("mach-virt-console-native", + QEMU_CAPS_NODEFCONFIG); + DO_TEST("mach-virt-console-virtio", + QEMU_CAPS_NODEFCONFIG); + DO_TEST_PARSE_ERROR("mach-virt-serial-invalid-machine", NONE); + DO_TEST("disk-ide-drive-split", QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_IDE_CD); diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-def= ault.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-defau= lt.xml index e5496424b..9796d7f63 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml @@ -71,7 +71,9 @@

- + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-console-nati= ve.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-console-native.x= ml new file mode 120000 index 000000000..a4768fcf8 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-console-native.xml @@ -0,0 +1 @@ +qemuxml2xmlout-mach-virt-serial-compat.xml \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-console-virt= io.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-console-virtio.x= ml new file mode 100644 index 000000000..3e46cd201 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-console-virtio.xml @@ -0,0 +1,27 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 524288 + 1 + + hvm + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-aarch64 + + + + + + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial+conso= le-native.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial+co= nsole-native.xml new file mode 120000 index 000000000..a4768fcf8 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial+console-nati= ve.xml @@ -0,0 +1 @@ +qemuxml2xmlout-mach-virt-serial-compat.xml \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-compa= t.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-compat.xml new file mode 100644 index 000000000..3d7325a8d --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-compat.xml @@ -0,0 +1,31 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 524288 + 1 + + hvm + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-aarch64 + + + + + + + + + + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-nativ= e.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-native.xml new file mode 120000 index 000000000..a4768fcf8 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-native.xml @@ -0,0 +1 @@ +qemuxml2xmlout-mach-virt-serial-compat.xml \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-pci.x= ml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-pci.xml new file mode 100644 index 000000000..4bcf69a3d --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-pci.xml @@ -0,0 +1,44 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 524288 + 1 + + hvm + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-aarch64 + + + + +
+ + + + +
+ + + + +
+ + + + + +
+ + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-usb.x= ml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-usb.xml new file mode 100644 index 000000000..01c2a5255 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-usb.xml @@ -0,0 +1,41 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 524288 + 1 + + hvm + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-aarch64 + +
+ + + + + +
+ + + + +
+ + + + + + + + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 45cb739cd..323845340 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -790,6 +790,32 @@ mymain(void) DO_TEST("pseries-console-virtio", QEMU_CAPS_NODEFCONFIG); =20 + DO_TEST("mach-virt-serial-native", + QEMU_CAPS_NODEFCONFIG); + DO_TEST("mach-virt-serial+console-native", + QEMU_CAPS_NODEFCONFIG); + DO_TEST("mach-virt-serial-compat", + QEMU_CAPS_NODEFCONFIG); + DO_TEST("mach-virt-serial-pci", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_OBJECT_GPEX, + QEMU_CAPS_PCI_MULTIFUNCTION, + QEMU_CAPS_DEVICE_PCIE_ROOT_PORT, + QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, + QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_PCI_SERIAL); + DO_TEST("mach-virt-serial-usb", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_OBJECT_GPEX, + QEMU_CAPS_PCI_MULTIFUNCTION, + QEMU_CAPS_DEVICE_PCIE_ROOT_PORT, + QEMU_CAPS_DEVICE_QEMU_XHCI, + QEMU_CAPS_DEVICE_USB_SERIAL); + DO_TEST("mach-virt-console-native", + QEMU_CAPS_NODEFCONFIG); + DO_TEST("mach-virt-console-virtio", + QEMU_CAPS_NODEFCONFIG); + DO_TEST("balloon-device-auto", NONE); DO_TEST("balloon-device-period", NONE); DO_TEST("channel-virtio-auto", NONE); --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511735271046959.189904187334; Sun, 26 Nov 2017 14:27:51 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2CE1B7E383; Sun, 26 Nov 2017 22:27:50 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F2E2961F55; Sun, 26 Nov 2017 22:27:49 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id BAD6B3D3A0; Sun, 26 Nov 2017 22:27:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQaKF028466 for ; Sun, 26 Nov 2017 17:26:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id EB65A60BE9; Sun, 26 Nov 2017 22:26:36 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 078CA648AC for ; Sun, 26 Nov 2017 22:26:35 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:42 +0100 Message-Id: <20171126222549.13681-22-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 21/28] conf: add VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Sun, 26 Nov 2017 22:27:50 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Pino Toscano Introduce specific a target types with two models for the console devices (sclp and sclplm) used in s390 and s390x guests, so isa-serial is no more used for them. This makes usable on s390 and s390x guests, with at most only a single sclpconsole and one sclplmconsole devices usable in a single guest (due to limitations in QEMU, which will enforce already at runtime). Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1449265 Signed-off-by: Pino Toscano Reviewed-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- docs/formatdomain.html.in | 18 ++++++++---- docs/schemas/domaincommon.rng | 3 ++ src/conf/domain_conf.c | 4 +++ src/conf/domain_conf.h | 3 ++ src/qemu/qemu_command.c | 6 ++++ src/qemu/qemu_domain.c | 20 +++++++++++++ src/qemu/qemu_domain_address.c | 1 + .../qemuxml2argv-s390-serial-2.args | 24 +++++++++++++++ .../qemuxml2argv-s390-serial-2.xml | 19 ++++++++++++ .../qemuxml2argv-s390-serial-console.args | 25 ++++++++++++++++ .../qemuxml2argv-s390-serial-console.xml | 15 ++++++++++ .../qemuxml2argvdata/qemuxml2argv-s390-serial.args | 22 ++++++++++++++ .../qemuxml2argvdata/qemuxml2argv-s390-serial.xml | 14 +++++++++ tests/qemuxml2argvtest.c | 16 ++++++++++ .../qemuxml2xmlout-s390-serial-2.xml | 33 ++++++++++++++++++= +++ .../qemuxml2xmlout-s390-serial-console.xml | 34 ++++++++++++++++++= ++++ .../qemuxml2xmlout-s390-serial.xml | 28 ++++++++++++++++++ tests/qemuxml2xmltest.c | 6 ++++ 18 files changed, 285 insertions(+), 6 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-serial-2.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-serial-2.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console= .args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console= .xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-serial.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-serial.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-2.x= ml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-con= sole.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial.xml diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 16bf4fd5e..841f1e3f2 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -6548,9 +6548,10 @@ qemu-kvm -net nic,model=3D? /dev/null usb-serial (usable whenever USB support is available) and pci-serial (usable whenever PCI support is availabl= e); since 3.10.0, - spapr-vio-serial (usable with ppc64/pSeries guests) and - system-serial (usable with aarch64/virt guests) are - available as well. + spapr-vio-serial (usable with ppc64/pSeries guests), + system-serial (usable with aarch64/virt guests) and + sclp-serial (usable with s390x guests) are available as + well.

=20

@@ -6563,7 +6564,9 @@ qemu-kvm -net nic,model=3D? /dev/null (usable with the pci-serial target type); spapr-vty (usable with the spapr-vio-serial target type); pl011 (usable with the - system-serial target type). + system-serial target type); sclpconsole and + sclplmconsole (usable with the sclp-serial + target type).

=20

@@ -6618,8 +6621,11 @@ qemu-kvm -net nic,model=3D? /dev/null virtio (usable whenever VirtIO support is available); xen, lxc, uml and openvz (available when the corresponding hypervisor is = in - use); sclp and sclplm (usable for s390 and - s390x QEMU guests). + use). sclp and sclplm (usable for s390 and + s390x QEMU guests) are supported for compatibility reasons but should + not be used for new guests: use the sclpconsole and + sclplmconsole target models, respectively, with the + serial element instead.

=20

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 5fff3a40f..5b9fc162c 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -3587,6 +3587,7 @@ pci-serial spapr-vio-serial system-serial + sclp-serial @@ -3600,6 +3601,8 @@ pci-serial spapr-vty pl011 + sclpconsole + sclplmconsole diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 820caba0f..b31917dad 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -454,6 +454,7 @@ VIR_ENUM_IMPL(virDomainChrSerialTarget, "pci-serial", "spapr-vio-serial", "system-serial", + "sclp-serial", ); =20 VIR_ENUM_IMPL(virDomainChrChannelTarget, @@ -483,6 +484,8 @@ VIR_ENUM_IMPL(virDomainChrSerialTargetModel, "pci-serial", "spapr-vty", "pl011", + "sclpconsole", + "sclplmconsole", ); =20 VIR_ENUM_IMPL(virDomainChrDevice, VIR_DOMAIN_CHR_DEVICE_TYPE_LAST, @@ -4064,6 +4067,7 @@ virDomainDefAddConsoleCompat(virDomainDefPtr def) case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: { =20 /* Create a stub console to match the serial port. diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 28d158980..48b07226e 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1083,6 +1083,7 @@ typedef enum { VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI, VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO, VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM, + VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP, =20 VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST } virDomainChrSerialTargetType; @@ -1117,6 +1118,8 @@ typedef enum { VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL, VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY, VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011, + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE, + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE, =20 VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST } virDomainChrSerialTargetModel; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index a8aaa3d8c..d0d72affe 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10356,6 +10356,10 @@ qemuChrSerialTargetModelToCaps(virDomainChrSerialT= argetModel targetModel) return QEMU_CAPS_DEVICE_PCI_SERIAL; case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY: return QEMU_CAPS_DEVICE_SPAPR_VTY; + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE: + return QEMU_CAPS_DEVICE_SCLPCONSOLE; + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE: + return QEMU_CAPS_DEVICE_SCLPLMCONSOLE; case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: @@ -10383,6 +10387,8 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE: =20 caps =3D qemuChrSerialTargetModelToCaps(serial->targetModel); =20 diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 2cc91b468..b3b34348b 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3473,6 +3473,7 @@ qemuDomainChrSerialTargetTypeToAddressType(int target= Type) case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO; case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: break; @@ -3496,6 +3497,9 @@ qemuDomainChrSerialTargetModelToTargetType(int target= Model) return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO; case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011: return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM; + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE: + return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP; case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: break; @@ -3533,6 +3537,7 @@ qemuDomainChrTargetDefValidate(const virDomainChrDef = *chr) break; =20 case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP: if (chr->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Target type '%s' cannot have an " @@ -3554,6 +3559,8 @@ qemuDomainChrTargetDefValidate(const virDomainChrDef = *chr) case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE: =20 expected =3D qemuDomainChrSerialTargetModelToTargetType(chr->t= argetModel); =20 @@ -3616,6 +3623,13 @@ qemuDomainChrDefValidate(const virDomainChrDef *dev, isCompatible =3D false; } =20 + if (!ARCH_IS_S390(def->os.arch) && + (dev->targetType =3D=3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP= || + dev->targetModel =3D=3D VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SC= LPCONSOLE || + dev->targetModel =3D=3D VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SC= LPLMCONSOLE)) { + isCompatible =3D false; + } + if (!isCompatible) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Serial device with target type '%s' and " @@ -4269,6 +4283,8 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr, chr->targetType =3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VI= O; } else if (qemuDomainIsVirt(def)) { chr->targetType =3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM; + } else if (ARCH_IS_S390(def->os.arch)) { + chr->targetType =3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP; } } =20 @@ -4291,6 +4307,9 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr, case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM: chr->targetModel =3D VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011; break; + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP: + chr->targetModel =3D VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCO= NSOLE; + break; case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: /* Nothing to do */ @@ -5214,6 +5233,7 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr drive= r, case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: /* Nothing to do */ diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index db9656a3a..a40cdb399 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -785,6 +785,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDevic= eDefPtr dev, case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: return 0; diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-2.args b/tests= /qemuxml2argvdata/qemuxml2argv-s390-serial-2.args new file mode 100644 index 000000000..346dcd16b --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-2.args @@ -0,0 +1,24 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-s390x \ +-name QEMUGuest1 \ +-S \ +-M s390-ccw-virtio \ +-m 214 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-nographic \ +-nodefconfig \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ +-boot c \ +-chardev pty,id=3Dcharserial0 \ +-device sclpconsole,chardev=3Dcharserial0,id=3Dserial0 \ +-chardev pty,id=3Dcharserial1 \ +-device sclplmconsole,chardev=3Dcharserial1,id=3Dserial1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-2.xml b/tests/= qemuxml2argvdata/qemuxml2argv-s390-serial-2.xml new file mode 100644 index 000000000..b6eb377c9 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-2.xml @@ -0,0 +1,19 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 1 + + hvm + + + /usr/bin/qemu-system-s390x + + + + + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.args b= /tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.args new file mode 100644 index 000000000..c405fb59e --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.args @@ -0,0 +1,25 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-s390x \ +-name QEMUGuest1 \ +-S \ +-M s390-ccw-virtio \ +-m 214 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-nographic \ +-nodefconfig \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ +-boot c \ +-device virtio-serial-ccw,id=3Dvirtio-serial0,devno=3Dfe.0.0000 \ +-chardev pty,id=3Dcharserial0 \ +-device sclpconsole,chardev=3Dcharserial0,id=3Dserial0 \ +-chardev pty,id=3Dcharconsole1 \ +-device virtconsole,chardev=3Dcharconsole1,id=3Dconsole1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.xml b/= tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.xml new file mode 100644 index 000000000..c841f1f24 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.xml @@ -0,0 +1,15 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 1 + + hvm + + + /usr/bin/qemu-system-s390x + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-serial.args b/tests/q= emuxml2argvdata/qemuxml2argv-s390-serial.args new file mode 100644 index 000000000..20968f794 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial.args @@ -0,0 +1,22 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-s390x \ +-name QEMUGuest1 \ +-S \ +-M s390-ccw-virtio \ +-m 214 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-nographic \ +-nodefconfig \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ +-boot c \ +-chardev pty,id=3Dcharserial0 \ +-device sclpconsole,chardev=3Dcharserial0,id=3Dserial0 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-serial.xml b/tests/qe= muxml2argvdata/qemuxml2argv-s390-serial.xml new file mode 100644 index 000000000..55b45bac0 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial.xml @@ -0,0 +1,14 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 1 + + hvm + + + /usr/bin/qemu-system-s390x + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 593057653..d9ed8af79 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2051,6 +2051,22 @@ mymain(void) QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390); + DO_TEST("s390-serial", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_VIRTIO_CCW, + QEMU_CAPS_VIRTIO_S390, + QEMU_CAPS_DEVICE_SCLPCONSOLE); + DO_TEST("s390-serial-2", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_VIRTIO_CCW, + QEMU_CAPS_VIRTIO_S390, + QEMU_CAPS_DEVICE_SCLPCONSOLE, + QEMU_CAPS_DEVICE_SCLPLMCONSOLE); + DO_TEST("s390-serial-console", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_VIRTIO_CCW, + QEMU_CAPS_VIRTIO_S390, + QEMU_CAPS_DEVICE_SCLPCONSOLE); =20 DO_TEST("ppc-dtb", QEMU_CAPS_KVM, diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-2.xml b/te= sts/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-2.xml new file mode 100644 index 000000000..bb9ca30f1 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-2.xml @@ -0,0 +1,33 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-s390x + + + + + + + + + + + + + + + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-console.xm= l b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-console.xml new file mode 100644 index 000000000..db3023b7a --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-console.xml @@ -0,0 +1,34 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-s390x + +

+ + + + + + + + + + + + + + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial.xml b/test= s/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial.xml new file mode 100644 index 000000000..9c9b4dd27 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial.xml @@ -0,0 +1,28 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-s390x + + + + + + + + + + + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 323845340..146a67ee2 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1157,6 +1157,12 @@ mymain(void) QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390); DO_TEST("s390-panic-no-address", QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390); + DO_TEST("s390-serial", + QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390); + DO_TEST("s390-serial-2", + QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390); + DO_TEST("s390-serial-console", + QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390); =20 DO_TEST("pcihole64", NONE); DO_TEST("pcihole64-gib", NONE); --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511735212624104.40373035050561; Sun, 26 Nov 2017 14:26:52 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8B8BCC047B6D; Sun, 26 Nov 2017 22:26:51 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 62AA118105; Sun, 26 Nov 2017 22:26:51 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 2D2EC1800C87; Sun, 26 Nov 2017 22:26:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQcnU028490 for ; Sun, 26 Nov 2017 17:26:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7B00C18EDA; Sun, 26 Nov 2017 22:26:38 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9AD0160BE9 for ; Sun, 26 Nov 2017 22:26:37 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:43 +0100 Message-Id: <20171126222549.13681-23-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 22/28] conf: pass parseFlags down to virDomainDefAddConsoleCompat X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sun, 26 Nov 2017 22:26:51 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Pino Toscano Signed-off-by: Pino Toscano Reviewed-by: Andrea Bolognani --- src/conf/domain_conf.c | 10 ++++++---- src/conf/domain_conf.h | 3 ++- src/vz/vz_sdk.c | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b31917dad..792d9bef4 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3987,7 +3987,8 @@ virDomainDefPostParseMemory(virDomainDefPtr def, =20 =20 static int -virDomainDefAddConsoleCompat(virDomainDefPtr def) +virDomainDefAddConsoleCompat(virDomainDefPtr def, + unsigned int parseFlags ATTRIBUTE_UNUSED) { size_t i; =20 @@ -4948,7 +4949,7 @@ virDomainDefPostParseCommon(virDomainDefPtr def, if (virDomainDefPostParseTimer(def) < 0) return -1; =20 - if (virDomainDefAddImplicitDevices(def) < 0) + if (virDomainDefAddImplicitDevices(def, data->parseFlags) < 0) return -1; =20 if (def->nvideos !=3D 0) { @@ -22017,9 +22018,10 @@ virDomainDefAddImplicitVideo(virDomainDefPtr def) } =20 int -virDomainDefAddImplicitDevices(virDomainDefPtr def) +virDomainDefAddImplicitDevices(virDomainDefPtr def, + unsigned int parseFlags) { - if (virDomainDefAddConsoleCompat(def) < 0) + if (virDomainDefAddConsoleCompat(def, parseFlags) < 0) return -1; =20 if (virDomainDefAddImplicitControllers(def) < 0) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 48b07226e..6e23cdd7d 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2945,7 +2945,8 @@ bool virDomainDefCheckABIStabilityFlags(virDomainDefP= tr src, virDomainXMLOptionPtr xmlopt, unsigned int flags); =20 -int virDomainDefAddImplicitDevices(virDomainDefPtr def); +int virDomainDefAddImplicitDevices(virDomainDefPtr def, + unsigned int parseFlags); =20 virDomainIOThreadIDDefPtr virDomainIOThreadIDFind(const virDomainDef *def, unsigned int iothread_id= ); diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c index eea5f6fc6..35522f46c 100644 --- a/src/vz/vz_sdk.c +++ b/src/vz/vz_sdk.c @@ -1932,7 +1932,7 @@ prlsdkLoadDomain(vzDriverPtr driver, if (prlsdkGetDomainState(dom, sdkdom, &domainState) < 0) goto error; =20 - if (!IS_CT(def) && virDomainDefAddImplicitDevices(def) < 0) + if (!IS_CT(def) && virDomainDefAddImplicitDevices(def, 0) < 0) goto error; =20 if (def->ngraphics > 0) { --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511735266453865.0875791761214; Sun, 26 Nov 2017 14:27:46 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2ADBF81E09; Sun, 26 Nov 2017 22:27:45 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 024415D979; Sun, 26 Nov 2017 22:27:45 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A108E1802121; Sun, 26 Nov 2017 22:27:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQdTp028501 for ; Sun, 26 Nov 2017 17:26:39 -0500 Received: by smtp.corp.redhat.com (Postfix) id E24FB18ED1; Sun, 26 Nov 2017 22:26:39 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 17B6660BE9 for ; Sun, 26 Nov 2017 22:26:38 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:44 +0100 Message-Id: <20171126222549.13681-24-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 23/28] conf: convert sclp/sclplm as X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Sun, 26 Nov 2017 22:27:45 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Pino Toscano In case we are allowed to break the ABI of a s390/s390x guest, then convert the first sclp/sclplm console from to , just like it is done on other architectures. Signed-off-by: Pino Toscano Reviewed-by: Andrea Bolognani Reviewed-by: Bjoern Walk --- This patch might need to be dropped. See https://www.redhat.com/archives/libvir-list/2017-November/msg00996.html src/conf/domain_conf.c | 46 ++++++++++++++++++= ++-- .../qemuxml2argv-s390-console2serial.args | 22 +++++++++++ .../qemuxml2argv-s390-console2serial.xml | 19 +++++++++ tests/qemuxml2argvtest.c | 6 +++ 4 files changed, 90 insertions(+), 3 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-console2serial= .args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-console2serial= .xml diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 792d9bef4..29afcb6c5 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3986,9 +3986,40 @@ virDomainDefPostParseMemory(virDomainDefPtr def, } =20 =20 +static void +virDomainChrConsoleTargetTypeToSerial(virDomainChrConsoleTargetType type, + int *targetType, + int *targetModel) +{ + switch (type) { + case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLP: + *targetType =3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP; + *targetModel =3D VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE; + break; + + case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLPLM: + *targetType =3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP; + *targetModel =3D VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE; + break; + + case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_NONE: + case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL: + case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_XEN: + case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_UML: + case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO: + case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LXC: + case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_OPENVZ: + case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST: + *targetType =3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE; + *targetModel =3D VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE; + break; + } +} + + static int virDomainDefAddConsoleCompat(virDomainDefPtr def, - unsigned int parseFlags ATTRIBUTE_UNUSED) + unsigned int parseFlags) { size_t i; =20 @@ -4005,6 +4036,10 @@ virDomainDefAddConsoleCompat(virDomainDefPtr def, * * We then fill def->consoles[0] with a stub just so we get sequencing * correct for consoles > 0 + * + * sclp/sclplm consoles (in s390 and s390x guests) are converted to se= rial + * only when we can update the ABI of the guest, to avoid breaking + * migrations to old libvirt. */ =20 /* Only the first console (if there are any) can be of type serial, @@ -4021,7 +4056,10 @@ virDomainDefAddConsoleCompat(virDomainDefPtr def, } if (def->nconsoles > 0 && def->os.type =3D=3D VIR_DOMAIN_OSTYPE_HVM && (def->consoles[0]->targetType =3D=3D VIR_DOMAIN_CHR_CONSOLE_TARGET= _TYPE_SERIAL || - def->consoles[0]->targetType =3D=3D VIR_DOMAIN_CHR_CONSOLE_TARGET= _TYPE_NONE)) { + def->consoles[0]->targetType =3D=3D VIR_DOMAIN_CHR_CONSOLE_TARGET= _TYPE_NONE || + ((def->consoles[0]->targetType =3D=3D VIR_DOMAIN_CHR_CONSOLE_TARG= ET_TYPE_SCLP || + def->consoles[0]->targetType =3D=3D VIR_DOMAIN_CHR_CONSOLE_TARG= ET_TYPE_SCLPLM) && + (parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE)))) { =20 /* If there isn't a corresponding serial port: * - create one and set, the console to be an alias for it @@ -4041,7 +4079,9 @@ virDomainDefAddConsoleCompat(virDomainDefPtr def, =20 /* modify it to be a serial port */ def->serials[0]->deviceType =3D VIR_DOMAIN_CHR_DEVICE_TYPE_SER= IAL; - def->serials[0]->targetType =3D VIR_DOMAIN_CHR_SERIAL_TARGET_T= YPE_NONE; + virDomainChrConsoleTargetTypeToSerial(def->serials[0]->targetT= ype, + &def->serials[0]->target= Type, + &def->serials[0]->target= Model); def->serials[0]->target.port =3D 0; } else { /* if the console source doesn't match */ diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-console2serial.args b= /tests/qemuxml2argvdata/qemuxml2argv-s390-console2serial.args new file mode 100644 index 000000000..20968f794 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-console2serial.args @@ -0,0 +1,22 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-s390x \ +-name QEMUGuest1 \ +-S \ +-M s390-ccw-virtio \ +-m 214 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-nographic \ +-nodefconfig \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ +-boot c \ +-chardev pty,id=3Dcharserial0 \ +-device sclpconsole,chardev=3Dcharserial0,id=3Dserial0 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-console2serial.xml b/= tests/qemuxml2argvdata/qemuxml2argv-s390-console2serial.xml new file mode 100644 index 000000000..5f02ec8a0 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-console2serial.xml @@ -0,0 +1,19 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 1 + + hvm + + + /usr/bin/qemu-system-s390x + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index d9ed8af79..9480f865f 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2067,6 +2067,12 @@ mymain(void) QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390, QEMU_CAPS_DEVICE_SCLPCONSOLE); + DO_TEST_FULL("s390-console2serial", NULL, -1, 0, + VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, GIC_NONE, + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_VIRTIO_CCW, + QEMU_CAPS_VIRTIO_S390, + QEMU_CAPS_DEVICE_SCLPCONSOLE); =20 DO_TEST("ppc-dtb", QEMU_CAPS_KVM, --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511735215130651.9949374241701; Sun, 26 Nov 2017 14:26:55 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 43CDC4ACAC; Sun, 26 Nov 2017 22:26:54 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 21C7718ED5; Sun, 26 Nov 2017 22:26:54 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E17D43D383; Sun, 26 Nov 2017 22:26:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQfQK028519 for ; Sun, 26 Nov 2017 17:26:41 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7280260BE9; Sun, 26 Nov 2017 22:26:41 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8208D18ED1 for ; Sun, 26 Nov 2017 22:26:40 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:45 +0100 Message-Id: <20171126222549.13681-25-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 24/28] qemu: switch s390/s390x default console back to serial X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Sun, 26 Nov 2017 22:26:54 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Pino Toscano Now that and on s390/s390x behave a bit more like the other architectures, remove this extra differentation, and use sclp console by default for new guests. New virtio consoles can still be added, and it is actually needed because of the limited number of instances for sclp and sclplm. This reverts commit b1c88c14764e0b043a269d454a83a6ac7af34eac, whose reasons are not totally clear. Signed-off-by: Pino Toscano Reviewed-by: Andrea Bolognani Reviewed-by: Bjoern Walk --- src/qemu/qemu_domain.c | 7 ------- tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.args | 5 +---- tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-defaultconsole.xml | 8 ++++++= -- tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-console.xml | 6 ------ 4 files changed, 7 insertions(+), 19 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index b3b34348b..d1e391f48 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4259,13 +4259,6 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr, virQEMUDriverPtr driver, unsigned int parseFlags) { - /* set the default console type for S390 arches */ - if (chr->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE && - chr->targetType =3D=3D VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_NONE && - ARCH_IS_S390(def->os.arch)) { - chr->targetType =3D VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO; - } - /* Historically, isa-serial and the default matched, so in order to * maintain backwards compatibility we map them here. The actual defau= lt * will be picked below based on the architecture and machine type. */ diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.args b= /tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.args index c405fb59e..20968f794 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.args @@ -18,8 +18,5 @@ QEMU_AUDIO_DRV=3Dnone \ server,nowait \ -mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ -boot c \ --device virtio-serial-ccw,id=3Dvirtio-serial0,devno=3Dfe.0.0000 \ -chardev pty,id=3Dcharserial0 \ --device sclpconsole,chardev=3Dcharserial0,id=3Dserial0 \ --chardev pty,id=3Dcharconsole1 \ --device virtconsole,chardev=3Dcharconsole1,id=3Dconsole1 +-device sclpconsole,chardev=3Dcharserial0,id=3Dserial0 diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-defaultconsole.xm= l b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-defaultconsole.xml index 7eb1a765a..0f278f2c9 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-defaultconsole.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-defaultconsole.xml @@ -14,9 +14,13 @@ destroy /usr/bin/qemu-system-s390x - + + + + + - + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-console.xm= l b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-console.xml index db3023b7a..9c9b4dd27 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-console.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-console.xml @@ -14,9 +14,6 @@ destroy /usr/bin/qemu-system-s390x - -
- @@ -25,9 +22,6 @@ - - - --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511735274319998.4321852400681; Sun, 26 Nov 2017 14:27:54 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C05707E392; Sun, 26 Nov 2017 22:27:52 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 96483183C0; Sun, 26 Nov 2017 22:27:52 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 60D693D3A3; Sun, 26 Nov 2017 22:27:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQhBS028536 for ; Sun, 26 Nov 2017 17:26:43 -0500 Received: by smtp.corp.redhat.com (Postfix) id F3F2018ED1; Sun, 26 Nov 2017 22:26:42 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 11B9C60BE9 for ; Sun, 26 Nov 2017 22:26:41 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:46 +0100 Message-Id: <20171126222549.13681-26-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 25/28] qemu: Add QEMU_CAPS_DEVICE_ISA_SERIAL X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Sun, 26 Nov 2017 22:27:53 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" All other serial devices have an associated capability. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.10.0-gicv2.aarch64.xml | 1 + tests/qemucapabilitiesdata/caps_2.10.0-gicv3.aarch64.xml | 1 + tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml | 1 + tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml | 1 + tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 + tests/qemuhelptest.c | 5 +++++ 24 files changed, 29 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index f2d24a309..cd519cb3c 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -452,6 +452,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "numa.dist", "disk-share-rw", "iscsi.password-secret", + "isa-serial", ); =20 =20 @@ -1682,6 +1683,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[= ] =3D { { "vmcoreinfo", QEMU_CAPS_DEVICE_VMCOREINFO }, { "spapr-vty", QEMU_CAPS_DEVICE_SPAPR_VTY }, { "sclplmconsole", QEMU_CAPS_DEVICE_SCLPLMCONSOLE }, + { "isa-serial", QEMU_CAPS_DEVICE_ISA_SERIAL }, }; =20 static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[]= =3D { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 68a2541d3..fc043b075 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -438,6 +438,7 @@ typedef enum { QEMU_CAPS_NUMA_DIST, /* -numa dist */ QEMU_CAPS_DISK_SHARE_RW, /* share-rw=3Don for concurrent disk access */ QEMU_CAPS_ISCSI_PASSWORD_SECRET, /* -drive file.driver=3Discsi,...,pas= sword-secret=3D */ + QEMU_CAPS_DEVICE_ISA_SERIAL, /* -device isa-serial */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_1.2.2.x86_64.xml index 956284d5d..d560811ab 100644 --- a/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml @@ -109,6 +109,7 @@ + 1002002 0 diff --git a/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_1.3.1.x86_64.xml index 99384ce5e..576475f7f 100644 --- a/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml @@ -127,6 +127,7 @@ + 1003001 0 diff --git a/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_1.4.2.x86_64.xml index aea043c57..0c271d3e4 100644 --- a/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml @@ -128,6 +128,7 @@ + 1004002 0 diff --git a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_1.5.3.x86_64.xml index 6f860e4f2..5c667975b 100644 --- a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml @@ -140,6 +140,7 @@ + 1005003 0 diff --git a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_1.6.0.x86_64.xml index e5dc8360d..8ae07a91d 100644 --- a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml @@ -145,6 +145,7 @@ + 1006000 0 diff --git a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_1.7.0.x86_64.xml index 86d87eaf0..34bd6be1c 100644 --- a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml @@ -147,6 +147,7 @@ + 1007000 0 diff --git a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.1.1.x86_64.xml index 2fa551b1a..0d7c144ff 100644 --- a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml @@ -163,6 +163,7 @@ + 2001001 0 diff --git a/tests/qemucapabilitiesdata/caps_2.10.0-gicv2.aarch64.xml b/tes= ts/qemucapabilitiesdata/caps_2.10.0-gicv2.aarch64.xml index 96b42bbe9..b4dc8f196 100644 --- a/tests/qemucapabilitiesdata/caps_2.10.0-gicv2.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_2.10.0-gicv2.aarch64.xml @@ -183,6 +183,7 @@ + 2010000 0 (v2.10.0) diff --git a/tests/qemucapabilitiesdata/caps_2.10.0-gicv3.aarch64.xml b/tes= ts/qemucapabilitiesdata/caps_2.10.0-gicv3.aarch64.xml index 79866a025..f2f598967 100644 --- a/tests/qemucapabilitiesdata/caps_2.10.0-gicv3.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_2.10.0-gicv3.aarch64.xml @@ -183,6 +183,7 @@ + 2010000 0 (v2.10.0) diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml b/tests/qemuc= apabilitiesdata/caps_2.10.0.ppc64.xml index 5f97bc393..ca55e11eb 100644 --- a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml @@ -182,6 +182,7 @@ + 2010000 0 (v2.10.0) diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml b/tests/qemu= capabilitiesdata/caps_2.10.0.x86_64.xml index ec7f29cc1..8fea70a52 100644 --- a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml @@ -227,6 +227,7 @@ + 2010000 0 (v2.10.0) diff --git a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.4.0.x86_64.xml index f97e4cb81..5007523c1 100644 --- a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml @@ -188,6 +188,7 @@ + 2004000 0 diff --git a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.5.0.x86_64.xml index 2ba40fc49..a9ad292d0 100644 --- a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml @@ -194,6 +194,7 @@ + 2005000 0 diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml b/test= s/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml index 0b34fa30d..e699bdbaf 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml @@ -172,6 +172,7 @@ + 2006000 0 diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml b/test= s/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml index d41d578c7..f4c1de7e1 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml @@ -172,6 +172,7 @@ + 2006000 0 diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_2.6.0.ppc64.xml index 5ff8598fc..27d99bd93 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml @@ -168,6 +168,7 @@ + 2006000 0 diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.6.0.x86_64.xml index bdf006f6b..97621612a 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml @@ -204,6 +204,7 @@ + 2006000 0 diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.7.0.x86_64.xml index 59adff6c9..e4ea9452c 100644 --- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml @@ -208,6 +208,7 @@ + 2007000 0 (v2.7.0) diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.8.0.x86_64.xml index 3165b2dee..c6d3e21d5 100644 --- a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml @@ -210,6 +210,7 @@ + 2008000 0 (v2.8.0) diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_2.9.0.ppc64.xml index 4e712f69e..96aa5d59f 100644 --- a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml @@ -176,6 +176,7 @@ + 2009000 0 (v2.9.0) diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.9.0.x86_64.xml index 4e8079d8f..9f489129f 100644 --- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml @@ -223,6 +223,7 @@ + 2009000 0 (v2.9.0) diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c index 2280e96a3..1336eeef5 100644 --- a/tests/qemuhelptest.c +++ b/tests/qemuhelptest.c @@ -174,6 +174,7 @@ mymain(void) QEMU_CAPS_DEVICE_USB_KBD, QEMU_CAPS_DEVICE_RTL8139, QEMU_CAPS_DEVICE_E1000, + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_DEVICE_VIRTIO_NET); DO_TEST("qemu-kvm-0.12.3", 12003, 1, 0, QEMU_CAPS_DRIVE_BOOT, @@ -210,6 +211,7 @@ mymain(void) QEMU_CAPS_DEVICE_USB_KBD, QEMU_CAPS_DEVICE_RTL8139, QEMU_CAPS_DEVICE_E1000, + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_DEVICE_VIRTIO_NET); DO_TEST("qemu-kvm-0.13.0", 13000, 1, 0, QEMU_CAPS_DRIVE_BOOT, @@ -258,6 +260,7 @@ mymain(void) QEMU_CAPS_DEVICE_IVSHMEM, QEMU_CAPS_DEVICE_RTL8139, QEMU_CAPS_DEVICE_E1000, + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_DEVICE_VIRTIO_NET); DO_TEST("qemu-1.0", 1000000, 0, 0, QEMU_CAPS_DRIVE_CACHE_UNSAFE, @@ -328,6 +331,7 @@ mymain(void) QEMU_CAPS_DEVICE_RTL8139, QEMU_CAPS_DEVICE_E1000, QEMU_CAPS_DEVICE_VIRTIO_NET, + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_DISPLAY); DO_TEST("qemu-1.1.0", 1001000, 0, 0, QEMU_CAPS_DRIVE_CACHE_UNSAFE, @@ -411,6 +415,7 @@ mymain(void) QEMU_CAPS_DEVICE_RTL8139, QEMU_CAPS_DEVICE_E1000, QEMU_CAPS_DEVICE_VIRTIO_NET, + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_DISPLAY); DO_TEST_FULL("qemu-1.2.0", 1002000, 0, 0, VIR_ERR_CONFIG_UNSUPPORTED, QEMU_CAPS_LAST); --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511735269007207.57878083394553; Sun, 26 Nov 2017 14:27:49 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EA28661475; Sun, 26 Nov 2017 22:27:47 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C9E6060317; Sun, 26 Nov 2017 22:27:47 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 908E41802126; Sun, 26 Nov 2017 22:27:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQis6028546 for ; Sun, 26 Nov 2017 17:26:44 -0500 Received: by smtp.corp.redhat.com (Postfix) id B752518ED8; Sun, 26 Nov 2017 22:26:44 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CF077614F3 for ; Sun, 26 Nov 2017 22:26:43 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:47 +0100 Message-Id: <20171126222549.13681-27-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 26/28] qemu: Require QEMU_CAPS_DEVICE_ISA_SERIAL for isa-serial X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Sun, 26 Nov 2017 22:27:48 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We should make sure the isa-serial device is available before formatting it on the QEMU command line. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- src/qemu/qemu_command.c | 7 +++---- tests/qemuxml2argvtest.c | 29 +++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d0d72affe..7d0d32c2a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10350,6 +10350,8 @@ static virQEMUCapsFlags qemuChrSerialTargetModelToCaps(virDomainChrSerialTargetModel targetModel) { switch (targetModel) { + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: + return QEMU_CAPS_DEVICE_ISA_SERIAL; case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL: return QEMU_CAPS_DEVICE_USB_SERIAL; case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: @@ -10360,7 +10362,6 @@ qemuChrSerialTargetModelToCaps(virDomainChrSerialTa= rgetModel targetModel) return QEMU_CAPS_DEVICE_SCLPCONSOLE; case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE: return QEMU_CAPS_DEVICE_SCLPLMCONSOLE; - case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: @@ -10384,6 +10385,7 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, virQEMUCapsFlags caps; =20 switch ((virDomainChrSerialTargetModel) serial->targetModel) { + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY: @@ -10400,9 +10402,6 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, } break; =20 - case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: - break; - case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 9480f865f..cd6c66b3f 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -771,6 +771,7 @@ mymain(void) DO_TEST_FAILURE("reboot-timeout-enabled", NONE); =20 DO_TEST("bios", + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_SGA); DO_TEST("bios-nvram", NONE); DO_TEST("bios-nvram-secure", @@ -814,6 +815,7 @@ mymain(void) QEMU_CAPS_SPICE, QEMU_CAPS_HDA_DUPLEX, QEMU_CAPS_USB_HUB, + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("eoi-disabled", NONE); DO_TEST("eoi-enabled", NONE); @@ -1231,48 +1233,64 @@ mymain(void) =20 DO_TEST("serial-file-log", QEMU_CAPS_CHARDEV_FILE_APPEND, + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_CHARDEV_LOGFILE); DO_TEST("serial-spiceport", QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_SPICE, + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_CHARDEV_SPICEPORT); DO_TEST("serial-spiceport-nospice", NONE); =20 - DO_TEST("console-compat", NONE); - DO_TEST("console-compat-auto", NONE); + DO_TEST("console-compat", + QEMU_CAPS_DEVICE_ISA_SERIAL); + DO_TEST("console-compat-auto", + QEMU_CAPS_DEVICE_ISA_SERIAL); =20 DO_TEST("serial-vc-chardev", + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_NODEFCONFIG); DO_TEST("serial-pty-chardev", + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_NODEFCONFIG); DO_TEST("serial-dev-chardev", + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_NODEFCONFIG); DO_TEST("serial-dev-chardev-iobase", + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_NODEFCONFIG); DO_TEST("serial-file-chardev", QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_CHARDEV_FILE_APPEND); DO_TEST("serial-unix-chardev", + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_NODEFCONFIG); DO_TEST("serial-tcp-chardev", + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_NODEFCONFIG); DO_TEST("serial-udp-chardev", + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_NODEFCONFIG); DO_TEST("serial-tcp-telnet-chardev", + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_NODEFCONFIG); driver.config->chardevTLS =3D 1; DO_TEST("serial-tcp-tlsx509-chardev", QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_OBJECT_TLS_CREDS_X509); driver.config->chardevTLSx509verify =3D 1; DO_TEST("serial-tcp-tlsx509-chardev-verify", QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_OBJECT_TLS_CREDS_X509); driver.config->chardevTLSx509verify =3D 0; DO_TEST("serial-tcp-tlsx509-chardev-notls", QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_OBJECT_TLS_CREDS_X509); VIR_FREE(driver.config->chardevTLSx509certdir); if (VIR_STRDUP_QUIET(driver.config->chardevTLSx509certdir, "/etc/pki/l= ibvirt-chardev") < 0) @@ -1284,22 +1302,26 @@ mymain(void) DO_TEST("serial-tcp-tlsx509-secret-chardev", QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_OBJECT_SECRET, + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_OBJECT_TLS_CREDS_X509); # else DO_TEST_FAILURE("serial-tcp-tlsx509-secret-chardev", QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_OBJECT_SECRET, + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_OBJECT_TLS_CREDS_X509); # endif driver.config->chardevTLS =3D 0; VIR_FREE(driver.config->chardevTLSx509certdir); DO_TEST("serial-many-chardev", + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_NODEFCONFIG); DO_TEST("parallel-tcp-chardev", QEMU_CAPS_NODEFCONFIG); DO_TEST("parallel-parport-chardev", QEMU_CAPS_NODEFCONFIG); DO_TEST("console-compat-chardev", + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_NODEFCONFIG); DO_TEST("pci-serial-dev-chardev", QEMU_CAPS_NODEFCONFIG, @@ -1320,6 +1342,7 @@ mymain(void) DO_TEST("console-virtio", QEMU_CAPS_NODEFCONFIG); DO_TEST("console-virtio-many", + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_NODEFCONFIG); DO_TEST("console-virtio-s390", QEMU_CAPS_NODEFCONFIG, @@ -2318,6 +2341,7 @@ mymain(void) QEMU_CAPS_CHARDEV_SPICEVMC, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_HDA_DUPLEX, + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_USB_REDIR); =20 /* Test automatic and manual setting of pcie-root-port attributes */ @@ -2922,6 +2946,7 @@ mymain(void) DO_TEST("user-aliases", QEMU_CAPS_KVM, QEMU_CAPS_DEVICE_CIRRUS_VGA, QEMU_CAPS_OBJECT_MEMORY_FILE, QEMU_CAPS_PIIX_DISABLE_S3, QEMU_CAPS_PIIX_DISABLE_S4, QEMU_CAPS_VNC, + QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_HDA_DUPLEX); DO_TEST("user-aliases2", QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI= ); =20 --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511735217991680.547309922346; Sun, 26 Nov 2017 14:26:57 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2B80C4ACA0; Sun, 26 Nov 2017 22:26:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0B38E18EDD; Sun, 26 Nov 2017 22:26:57 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C4C97180474B; Sun, 26 Nov 2017 22:26:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQk2M028556 for ; Sun, 26 Nov 2017 17:26:46 -0500 Received: by smtp.corp.redhat.com (Postfix) id 43E3F18EDA; Sun, 26 Nov 2017 22:26:46 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 53A1760BE9 for ; Sun, 26 Nov 2017 22:26:45 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:48 +0100 Message-Id: <20171126222549.13681-28-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 27/28] qemu: Limit isa-serial usage to x86 guests X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Sun, 26 Nov 2017 22:26:57 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The ISA bus is x86 specific, so we should limit usage of isa-serial to x86 guests only, just like we already do eg. with sclpconsole and s390x guests. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_domain.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d1e391f48..cf4af14dd 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3611,6 +3611,12 @@ qemuDomainChrDefValidate(const virDomainChrDef *dev, if (dev->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL) { bool isCompatible =3D true; =20 + if (!ARCH_IS_X86(def->os.arch) && + (dev->targetType =3D=3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA = || + dev->targetModel =3D=3D VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_IS= A_SERIAL)) { + isCompatible =3D false; + } + if (!qemuDomainIsPSeries(def) && (dev->targetType =3D=3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAP= R_VIO || dev->targetModel =3D=3D VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SP= APR_VTY)) { --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:03:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511735220857486.7335646269074; Sun, 26 Nov 2017 14:27:00 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 07B5A7E423; Sun, 26 Nov 2017 22:27:00 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BB8785D97B; Sun, 26 Nov 2017 22:26:59 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 856763D386; Sun, 26 Nov 2017 22:26:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAQMQlnH028563 for ; Sun, 26 Nov 2017 17:26:47 -0500 Received: by smtp.corp.redhat.com (Postfix) id C70E318ED1; Sun, 26 Nov 2017 22:26:47 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D67F460BE9 for ; Sun, 26 Nov 2017 22:26:46 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Sun, 26 Nov 2017 23:25:49 +0100 Message-Id: <20171126222549.13681-29-abologna@redhat.com> In-Reply-To: <20171126222549.13681-1-abologna@redhat.com> References: <20171126222549.13681-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 28/28] news: Update for serial console fixes X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Sun, 26 Nov 2017 22:27:00 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani --- docs/news.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 104668ce9..397e382b9 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -148,6 +148,18 @@ can prepare the files if they need to do so. + + + Improve serial console behavior on non-x86 architectures + + + ppc64, aarch64 and s390x guests were treating the <serial> + and <console> elements differently from x86, in some cases + presenting misleading information to the user. The behavior is n= ow + consistent across all architectures and the information reported + is always accurate. + +
--=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list