From nobody Fri Apr 26 12:19:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=nutanix.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 163775694241911.77010033906447; Wed, 24 Nov 2021 04:29:02 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-413-5VOYd2z_O52jupljCJ2CQw-1; Wed, 24 Nov 2021 07:28:57 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 68D7883DD5F; Wed, 24 Nov 2021 12:28: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 3ADF85D9CA; Wed, 24 Nov 2021 12:28: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 A1EF557682; Wed, 24 Nov 2021 12:28:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1AOC6tOi031606 for ; Wed, 24 Nov 2021 07:06:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id B70DD2026D6A; Wed, 24 Nov 2021 12:06:55 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B0BD62026D11 for ; Wed, 24 Nov 2021 12:06:52 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A7F6E802DFD for ; Wed, 24 Nov 2021 12:06:52 +0000 (UTC) Received: from mx0b-002c1b01.pphosted.com (mx0b-002c1b01.pphosted.com [148.163.155.12]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-114-YYt4gwdOMC-PjgXk0nOfKA-1; Wed, 24 Nov 2021 07:06:51 -0500 Received: from pps.filterd (m0127844.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1AOBtqVg016519; Wed, 24 Nov 2021 04:06:48 -0800 Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2172.outbound.protection.outlook.com [104.47.57.172]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3cgvxmb1gx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Nov 2021 04:06:48 -0800 Received: from SA2PR02MB7769.namprd02.prod.outlook.com (2603:10b6:806:141::5) by SN4PR0201MB8742.namprd02.prod.outlook.com (2603:10b6:806:1e9::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.20; Wed, 24 Nov 2021 12:06:46 +0000 Received: from SA2PR02MB7769.namprd02.prod.outlook.com ([fe80::fc13:e2a4:59ce:ad7c]) by SA2PR02MB7769.namprd02.prod.outlook.com ([fe80::fc13:e2a4:59ce:ad7c%6]) with mapi id 15.20.4713.025; Wed, 24 Nov 2021 12:06:46 +0000 Received: from asdfghjkdfghjklz.asdfghjzasdfgh.jklzasdfghjklzasd.fghjklzasdf.mm.eng.nutanix.com (192.146.154.241) by SJ0PR03CA0043.namprd03.prod.outlook.com (2603:10b6:a03:33e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.21 via Frontend Transport; Wed, 24 Nov 2021 12:06:45 +0000 X-MC-Unique: 5VOYd2z_O52jupljCJ2CQw-1 X-MC-Unique: YYt4gwdOMC-PjgXk0nOfKA-1 From: divya To: libvir-list@redhat.com Subject: [RFC 1/1] update index for serial device using taget.port Date: Wed, 24 Nov 2021 07:06:06 -0500 Message-Id: <20211124120605.719078-2-divya.garg@nutanix.com> In-Reply-To: <20211124120605.719078-1-divya.garg@nutanix.com> References: <20211124120605.719078-1-divya.garg@nutanix.com> X-ClientProxiedBy: SJ0PR03CA0043.namprd03.prod.outlook.com (2603:10b6:a03:33e::18) To SA2PR02MB7769.namprd02.prod.outlook.com (2603:10b6:806:141::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 991a507f-59b4-48a8-3087-08d9af42e2cf X-MS-TrafficTypeDiagnostic: SN4PR0201MB8742: X-Microsoft-Antispam-PRVS: x-proofpoint-crosstenant: true X-MS-Oob-TLC-OOBClassifiers: OLM:765 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: GVoddiafIqamIjqJBlQUvRNRQ9x3uL/FxlMNDo+hBAZsUK8NuH3i3sR823G0MqxnCAuTh0u8PxBaCMJHPSlJpkGe2qvOACa7t1YiBQgBlVWarPgMiTboDhoJD81xy+B5e+Cfti2V2ArTOQCeYuZA7mHez271GYhBzGiVw9WRRi8FoIlq8NrWi9veHIdh8IJVqCXZte1Z6eZVYOjf5Lxd8w5ZI2Bgtn0SH+1qVntbcPZY5nSPOklwrNLtE/EfSJWiWyAfrnQ+/lisvyPS4oZP6JoHcCXMrp3UBadYQQyX5DWer31iZuqZCI9BeqYu4t4VxvKgbQE/PBEdUMFLmsy0x2maz5ARhFvo3lmF6y55UVWbhkRZXfDQJ4/afByZiMuoJVdXAQl78Xl20WlEhYxEeTNi/n+EtbRuWMTauFZIQ1MkoiT31FA5SSRzzilztrsM6/Dujwcmn3FnNAxmqrW/XklpQm6yD6IdVnXkuA0WljLHRQ7uM2m7an0GzpM47a46ElFHPuKJX1YXqXHkWGYSzVObCTX3CXGrB4W1YF7WBfS8wms9aLvjQkFrCXwWQHEQSdBOvWztGioBn41LvxrdHLVxjZMkrLpzqy2rexuUkVk+WCA+pSFVrJiSKc1d5NcAu5vnZxPK1Kc0m96unAhz7HVJIMnLndALFRDTuxWpwC4mkdYrY5JXao1U9FxC/jPJUlm8r3v8U4z0pOYomHfIhQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA2PR02MB7769.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(186003)(30864003)(6916009)(26005)(6486002)(316002)(66556008)(66476007)(38100700002)(38350700002)(2906002)(66946007)(15650500001)(83380400001)(5660300002)(508600001)(8936002)(52116002)(36756003)(4326008)(7696005)(1076003)(956004)(2616005)(86362001)(6666004)(8676002)(579004); DIR:OUT; SFP:1102 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Ji/X0dadcQ/ytthDEMk5X/PWjwUjXIi0XUsdXLYXhgMSpV6MpaP2bF7451TS?= =?us-ascii?Q?oHmBVUUw2IjTdkDLjKz+xrYEscp5Br4XehhfFo8mVdy0ssGxa3ZMt8kO9GIL?= =?us-ascii?Q?OXrq6rRLVIRt2OWZnMLVs6CoCmPVXmfqmhAdqc0MvD15uHNNctOQvt9P50YD?= =?us-ascii?Q?tdv5rbObpy1W9u/VMUjHBns/UwIvDzzWQgaX+fb+EsJk4kxRL/PkkR2K8nRE?= =?us-ascii?Q?de9QocByKESMJ3KrohVtWzj1eG6WrCBOWA2fY55w6rntj6rPM0nJspTxiSVc?= =?us-ascii?Q?cMY+mJACvv/RJCISDAyaEsoQIidxXOc+Gg/RQRxwNhCEBVZfjX+hoqQ7xcBk?= =?us-ascii?Q?w3HMdnqvUR6dOcNozdGzTMC42bak8NFfkFv/xALPZm/xTX+ctWDm7qev8mK+?= =?us-ascii?Q?yyCJR9S8RyE5OzaPw7q7auJIdQhS7+M2CKA65UV9J8Y7T+bmX93i/puGqo1i?= =?us-ascii?Q?F/yOJ9eCmq/Lz8lK/0YVXK2wryH80gNTFbmJMmqyWADOCTDR5MPVCVMVDzVK?= =?us-ascii?Q?0FoTmX6ATFFoD2yv2ZOhc1lKdLWEO4btccxQUVUZzVT4+R7sUK2WqpoGerYZ?= =?us-ascii?Q?U8mwFKRJRt5ktkvIOUsrhzXiGPJcQnWMaJl+toGPcxgs6IYuOQvFxfbnvVhA?= =?us-ascii?Q?Q8b220/NPhrknmYiWgT+utcDL+m7rGVb4BpYVlHmzCwltFYs/tcwwQ+yUn5T?= =?us-ascii?Q?uuu/I4tQ2IQXBPHaS0palt/YXtSj7z3VjjX5SA0OMd4UKLJEREytKSiaNDCx?= =?us-ascii?Q?HZwSgCGnku5uiwb6whq30hti4EdAN69kc/1z4piv/NCKpbeM0TX0HXggZ7N1?= =?us-ascii?Q?omy4MGDfaMszWVSBAJ/0tCZmtkyI+b476zXtGGX1mNBLJaBFcOU8E+2O+Sa6?= =?us-ascii?Q?SY1O61sFe1uixyIS27cwHKITzQTSFO1PdsVjYyEHqGg1I7KK53Q5xepWpK59?= =?us-ascii?Q?DJGX+F0mPPJtEz8a6qvTqlYSQWzfc0WIKhf3fcRzkTOqwRgYsKyJvdECG9Bs?= =?us-ascii?Q?Hf1LYRvVrA9rdqbsFnIy7/7iXCCok3I1QdKQGl9pBA9TDisX44nvXlZdcrZ0?= =?us-ascii?Q?Jdwd7oG9YQo8Er8+MBhMd9swFep9Ob9427Q5yzanMef3ckKHw4EypudBs+x4?= =?us-ascii?Q?lIobQBPPx63ReafQGJ4PKA1XzpnxdvzB4+e63kbwflfZkHJ1BdrjIWdhmKMw?= =?us-ascii?Q?FjTEg7Nfety3dKDxzp0BtCkBfiAFaK1MMU0+UGqJ9fPNiDjMsqlZavb/QXWd?= =?us-ascii?Q?sKtuWVdO99jlOwzmtLLRk5V3u7YP7U4ObRNeBQgQtY6xXotqmzZQX4t/B/CN?= =?us-ascii?Q?bW+KuWTt50LnqVGDr3Py0ZiZ2K0/sxXJaAK1410XFJqIXPyxTkI3C8mRg4V1?= =?us-ascii?Q?xFW3GeDsyPlYbt4EyqPrMFD55Z1C6rcGlSbr6yMJKaP4LsSUSBc2VwOkmQKk?= =?us-ascii?Q?hWFEf54kDgSBbza9XXTGp2XtEPwSikb4Rp9ueLvVz4rUgqJorGupDP/P8TXo?= =?us-ascii?Q?ArCzbyZtHBoDfqx+i4SkhhE4B6+/nCIaMu6ECdy9vDA9tdP5d+F565v0c/1c?= =?us-ascii?Q?D+tW7pwRaynK5Adk8TUP65ZKdRQrrOf1J1mGY2WNAyeg9H6rGlAoCIf+tM4j?= =?us-ascii?Q?j+UFPmZYwb0vFAJHtoGKHdU=3D?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 991a507f-59b4-48a8-3087-08d9af42e2cf X-MS-Exchange-CrossTenant-AuthSource: SA2PR02MB7769.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Nov 2021 12:06:45.9080 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bb047546-786f-4de1-bd75-24e5b6f79043 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: V2M7OFz99BwRHPFi1ObNPHmo97L77OfQ916ZB+akqEvBkenhXqxjV5RJP+DT0JAHYhjYeMXz24x4u7FoDvP3OQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR0201MB8742 X-Proofpoint-ORIG-GUID: wc4enXIbw6BF5MZ3shfyEQ9nYAqwKh6o X-Proofpoint-GUID: wc4enXIbw6BF5MZ3shfyEQ9nYAqwKh6o X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205, Aquarius:18.0.790, Hydra:6.0.425, FMLib:17.0.607.475 definitions=2021-11-24_04,2021-11-24_01,2020-04-07_01 X-Proofpoint-Spam-Reason: safe X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Cc: manish.mishra@nutanix.com, root , prerna.saxena@nutanix.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1637756943528100005 Content-Type: text/plain; charset="utf-8" From: root --- src/conf/domain_conf.c | 70 +++++++++++++++++-- src/qemu/qemu_command.c | 20 ++++-- tests/qemuhotplugtest.c | 1 - ...g-console-compat-2-live+console-virtio.xml | 4 +- .../qemuhotplug-console-compat-2-live.xml | 4 +- tests/qemuxml2argvdata/bios.args | 2 +- .../qemuxml2argvdata/console-compat-auto.args | 2 +- .../console-compat-chardev.args | 2 +- tests/qemuxml2argvdata/console-compat.args | 2 +- .../qemuxml2argvdata/console-virtio-many.args | 2 +- tests/qemuxml2argvdata/controller-order.args | 2 +- .../name-escape.x86_64-2.11.0.args | 4 +- tests/qemuxml2argvdata/name-escape.xml | 1 + .../q35-virt-manager-basic.args | 2 +- .../serial-dev-chardev-iobase.args | 2 +- .../qemuxml2argvdata/serial-dev-chardev.args | 2 +- .../qemuxml2argvdata/serial-file-chardev.args | 2 +- tests/qemuxml2argvdata/serial-file-log.args | 2 +- .../qemuxml2argvdata/serial-many-chardev.args | 4 +- .../qemuxml2argvdata/serial-pty-chardev.args | 2 +- tests/qemuxml2argvdata/serial-spiceport.args | 2 +- .../qemuxml2argvdata/serial-tcp-chardev.args | 2 +- .../serial-tcp-telnet-chardev.args | 2 +- .../serial-tcp-tlsx509-chardev-notls.args | 8 ++- .../serial-tcp-tlsx509-chardev-notls.xml | 18 ++++- .../serial-tcp-tlsx509-chardev-verify.args | 4 +- .../serial-tcp-tlsx509-chardev-verify.xml | 2 +- .../serial-tcp-tlsx509-chardev.args | 4 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- .../serial-tcp-tlsx509-secret-chardev.args | 4 +- .../serial-tcp-tlsx509-secret-chardev.xml | 2 +- .../qemuxml2argvdata/serial-udp-chardev.args | 4 +- .../qemuxml2argvdata/serial-unix-chardev.args | 4 +- .../serial-unix-chardev.x86_64-latest.args | 4 +- tests/qemuxml2argvdata/serial-vc-chardev.args | 2 +- tests/qemuxml2argvdata/user-aliases.args | 4 +- .../virtio-9p-createmode.x86_64-latest.args | 2 +- .../virtio-9p-multidevs.x86_64-latest.args | 2 +- .../x86_64-pc-graphics.x86_64-latest.args | 2 +- .../x86_64-pc-headless.x86_64-latest.args | 2 +- .../x86_64-q35-graphics.x86_64-latest.args | 2 +- .../x86_64-q35-headless.x86_64-latest.args | 2 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- 43 files changed, 149 insertions(+), 65 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5cfb2d91eb..edc5e897be 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -65,6 +65,7 @@ #include "virutil.h" =20 #define VIR_FROM_THIS VIR_FROM_DOMAIN +#define max_available_isa_serial_ports 4 =20 VIR_LOG_INIT("conf.domain_conf"); =20 @@ -19649,6 +19650,10 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, g_autofree xmlNodePtr *nodes =3D NULL; g_autofree char *tmp =3D NULL; g_autoptr(virDomainDef) def =3D NULL; + uint8_t used_serial_port_buffer =3D 0; + int isa_serial_count =3D 0; + int next_available_serial_port =3D 0; + int max_serial_port =3D -1; =20 if (!(def =3D virDomainDefNew(xmlopt))) return NULL; @@ -19886,16 +19891,67 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, if (!chr) return NULL; =20 - if (chr->target.port =3D=3D -1) { - int maxport =3D -1; - for (j =3D 0; j < i; j++) { - if (def->serials[j]->target.port > maxport) - maxport =3D def->serials[j]->target.port; + def->serials[def->nserials++] =3D chr; + + // Giving precedence to the isa-serial device since + // only limited ports can be used for such devices. + if (chr->targetType =3D=3D VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_= SERIAL) { + // Taking the isa serial devices to start of the array. + for (j =3D def->nserials; j > isa_serial_count; j--) + def->serials[j] =3D def->serials[j-1]; + def->serials[isa_serial_count++] =3D chr; + } + + // Maintaining the buffer for first max_available_isa_serial_ports= unused ports. + if (chr->target.port !=3D -1 && chr->target.port <=3D max_availabl= e_isa_serial_ports) { + if (used_serial_port_buffer & (1 << chr->target.port)) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("target port [%d] already allocated."), + chr->target.port); + return NULL; } - chr->target.port =3D maxport + 1; + used_serial_port_buffer |=3D 1 << chr->target.port; + } + + // Update max serial port used. + if (chr->target.port > max_serial_port) + max_serial_port =3D chr->target.port; + } + + // Assign the ports to the devices. + for (i =3D 0; i < n; i++) { + if (def->serials[i]->target.port !=3D -1) continue; + // Assign one of the unused ports from first max_available_isa_ser= ial_ports ports + // to isa-serial device. + if (def->serials[i]->targetType =3D=3D VIR_DOMAIN_CHR_SERIAL_TARGE= T_MODEL_ISA_SERIAL) { + + // Search for the next available port. + while (used_serial_port_buffer & (1 << next_available_serial_p= ort) && + next_available_serial_port <=3D max_available_isa_serial_p= orts) { + next_available_serial_port++; + } + + // qemu doesn't support more than max_available_isa_serial_por= ts isa devices. + if (i > max_available_isa_serial_ports || + next_available_serial_port > max_available_isa_serial_port= s) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Maximum supported number of ISA serial ports is %d.= "), + max_available_isa_serial_ports); + return NULL; + } + + used_serial_port_buffer |=3D 1 << next_available_serial_port; + def->serials[i]->target.port =3D next_available_serial_port; + + // Update max serial port used. + if (def->serials[i]->target.port > max_serial_port) + max_serial_port =3D def->serials[i]->target.port; + + } else { + def->serials[i]->target.port =3D ++max_serial_port; } - def->serials[def->nserials++] =3D chr; } + VIR_FREE(nodes); =20 if ((n =3D virXPathNodeSet("./devices/console", ctxt, &nodes)) < 0) { diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 7a185061d8..c8f8a27f30 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10947,11 +10947,21 @@ qemuBuildSerialChrDeviceProps(const virDomainDef = *def, return NULL; } =20 - if (virJSONValueObjectAdd(&props, - "s:driver", virDomainChrSerialTargetModelTyp= eToString(serial->targetModel), - "s:chardev", chardev, - "s:id", serial->info.alias, - NULL) < 0) + if (serial->targetModel =3D=3D VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_= SERIAL && + serial->target.port !=3D -1) { + if (virJSONValueObjectAdd(&props, + "s:driver", virDomainChrSerialTargetModel= TypeToString(serial->targetModel), + "s:chardev", chardev, + "s:id", serial->info.alias, + "i:index", serial->target.port, + NULL) < 0) + return NULL; + } + else if (virJSONValueObjectAdd(&props, + "s:driver", virDomainChrSerialTargetModel= TypeToString(serial->targetModel), + "s:chardev", chardev, + "s:id", serial->info.alias, + NULL) < 0) return NULL; =20 if (qemuBuildDeviceAddressProps(props, def, &serial->info) < 0) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 263a92425c..88c9ea0339 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -355,7 +355,6 @@ testQemuHotplug(const void *data) if (keep) { test->vm =3D vm; } else { - virObjectUnref(vm); test->vm =3D NULL; } virDomainDeviceDefFree(dev); 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 5d688e7748..295d75b768 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 @@ -74,7 +74,7 @@ - + @@ -82,7 +82,7 @@ - + diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live= .xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml index b916f30412..850ebddf52 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml @@ -74,7 +74,7 @@ - + @@ -82,7 +82,7 @@ - + diff --git a/tests/qemuxml2argvdata/bios.args b/tests/qemuxml2argvdata/bios= .args index 0469b7419e..62ec87541d 100644 --- a/tests/qemuxml2argvdata/bios.args +++ b/tests/qemuxml2argvdata/bios.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=3Dnone \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ -chardev pty,id=3Dcharserial0 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -device usb-tablet,id=3Dinput0,bus=3Dusb.0,port=3D1 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/console-compat-auto.args b/tests/qemuxm= l2argvdata/console-compat-auto.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/console-compat-auto.args +++ b/tests/qemuxml2argvdata/console-compat-auto.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=3Dnone \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ -chardev pty,id=3Dcharserial0 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/console-compat-chardev.args b/tests/qem= uxml2argvdata/console-compat-chardev.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/console-compat-chardev.args +++ b/tests/qemuxml2argvdata/console-compat-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=3Dnone \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ -chardev pty,id=3Dcharserial0 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/console-compat.args b/tests/qemuxml2arg= vdata/console-compat.args index 9f37788586..709a82faad 100644 --- a/tests/qemuxml2argvdata/console-compat.args +++ b/tests/qemuxml2argvdata/console-compat.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=3Dnone \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ -chardev pty,id=3Dcharserial0 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/console-virtio-many.args b/tests/qemuxm= l2argvdata/console-virtio-many.args index dc1aca1129..b509cd55b5 100644 --- a/tests/qemuxml2argvdata/console-virtio-many.args +++ b/tests/qemuxml2argvdata/console-virtio-many.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=3Dnone \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ -chardev pty,id=3Dcharserial0 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -chardev pty,id=3Dcharconsole1 \ -device virtconsole,chardev=3Dcharconsole1,id=3Dconsole1 \ -chardev pty,id=3Dcharconsole2 \ diff --git a/tests/qemuxml2argvdata/controller-order.args b/tests/qemuxml2a= rgvdata/controller-order.args index 51571a27bf..51fa04dfd8 100644 --- a/tests/qemuxml2argvdata/controller-order.args +++ b/tests/qemuxml2argvdata/controller-order.args @@ -37,7 +37,7 @@ QEMU_AUDIO_DRV=3Dspice \ -chardev spicevmc,id=3Dcharsmartcard0,name=3Dsmartcard \ -device ccid-card-passthru,chardev=3Dcharsmartcard0,id=3Dsmartcard0,bus=3D= ccid0.0 \ -chardev pty,id=3Dcharserial0 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -chardev spicevmc,id=3Dcharchannel0,name=3Dvdagent \ -device virtserialport,bus=3Dvirtio-serial0.0,nr=3D1,chardev=3Dcharchannel= 0,id=3Dchannel0,name=3Dcom.redhat.spice.0 \ -device usb-tablet,id=3Dinput0,bus=3Dusb.0,port=3D1.2 \ diff --git a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args b/tests/= qemuxml2argvdata/name-escape.x86_64-2.11.0.args index 1ce91ff354..a57adedfa5 100644 --- a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args +++ b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args @@ -32,9 +32,9 @@ QEMU_AUDIO_DRV=3Dspice \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1,write-cache=3Don \ -device ccid-card-emulated,backend=3Dcertificates,cert1=3Dcert1,,foo,cert2= =3Dcert2,cert3=3Dcert3,db=3D/etc/pki/nssdb,,foo,id=3Dsmartcard0,bus=3Dccid0= .0 \ -chardev tty,id=3Dcharserial0,path=3D/dev/ttyS2,,foo \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D1 \ -chardev file,id=3Dcharserial1,path=3D/tmp/serial.log,,foo,append=3Don \ --device isa-serial,chardev=3Dcharserial1,id=3Dserial1 \ +-device isa-serial,chardev=3Dcharserial1,id=3Dserial1,index=3D0 \ -chardev pipe,id=3Dcharchannel0,path=3D/tmp/guestfwd,,foo \ -netdev user,guestfwd=3Dtcp:10.0.2.1:4600-chardev:charchannel0,id=3Dchanne= l0 \ -vnc vnc=3Dunix:/tmp/lib/domain--1-foo=3D1,,bar=3D2/vnc.sock \ diff --git a/tests/qemuxml2argvdata/name-escape.xml b/tests/qemuxml2argvdat= a/name-escape.xml index 6aefac19b2..e2de9aeb10 100644 --- a/tests/qemuxml2argvdata/name-escape.xml +++ b/tests/qemuxml2argvdata/name-escape.xml @@ -43,6 +43,7 @@ + diff --git a/tests/qemuxml2argvdata/q35-virt-manager-basic.args b/tests/qem= uxml2argvdata/q35-virt-manager-basic.args index 6e84c9ca2a..a33a74e355 100644 --- a/tests/qemuxml2argvdata/q35-virt-manager-basic.args +++ b/tests/qemuxml2argvdata/q35-virt-manager-basic.args @@ -40,7 +40,7 @@ QEMU_AUDIO_DRV=3Dspice \ -netdev user,id=3Dhostnet0 \ -device virtio-net-pci,netdev=3Dhostnet0,id=3Dnet0,mac=3D52:54:00:9a:e6:c6= ,bus=3Dpci.1,addr=3D0x0 \ -chardev pty,id=3Dcharserial0 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -chardev socket,id=3Dcharchannel0,path=3D/tmp/channel/domain--1-virt-manag= er-basic/org.qemu.guest_agent.0,server=3Don,wait=3Doff \ -device virtserialport,bus=3Dvirtio-serial0.0,nr=3D1,chardev=3Dcharchannel= 0,id=3Dchannel0,name=3Dorg.qemu.guest_agent.0 \ -chardev spicevmc,id=3Dcharchannel1,name=3Dvdagent \ diff --git a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args b/tests/= qemuxml2argvdata/serial-dev-chardev-iobase.args index dfa6785795..1f358b6469 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=3Dnone \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ -chardev tty,id=3Dcharserial0,path=3D/dev/ttyS2 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0,iobase=3D1016,irq=3D= 4 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0,iobase=3D1= 016,irq=3D4 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/serial-dev-chardev.args b/tests/qemuxml= 2argvdata/serial-dev-chardev.args index c325f21e0c..47da5b8454 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=3Dnone \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ -chardev tty,id=3Dcharserial0,path=3D/dev/ttyS2 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/serial-file-chardev.args b/tests/qemuxm= l2argvdata/serial-file-chardev.args index 4cbd0edf1c..5b8f3be45a 100644 --- a/tests/qemuxml2argvdata/serial-file-chardev.args +++ b/tests/qemuxml2argvdata/serial-file-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=3Dnone \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ -chardev file,id=3Dcharserial0,path=3D/tmp/serial.log,append=3Don \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/serial-file-log.args b/tests/qemuxml2ar= gvdata/serial-file-log.args index c4c6106200..9ee066ef49 100644 --- a/tests/qemuxml2argvdata/serial-file-log.args +++ b/tests/qemuxml2argvdata/serial-file-log.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=3Dnone \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ -chardev file,id=3Dcharserial0,path=3D/tmp/serial.log,logfile=3D/var/lib/l= ibvirt/qemu/demo-serial.log,logappend=3Doff \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/serial-many-chardev.args b/tests/qemuxm= l2argvdata/serial-many-chardev.args index 2c548c9e4b..da0d0b21c3 100644 --- a/tests/qemuxml2argvdata/serial-many-chardev.args +++ b/tests/qemuxml2argvdata/serial-many-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=3Dnone \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ -chardev pty,id=3Dcharserial0 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -chardev file,id=3Dcharserial1,path=3D/tmp/serial.log \ --device isa-serial,chardev=3Dcharserial1,id=3Dserial1 \ +-device isa-serial,chardev=3Dcharserial1,id=3Dserial1,index=3D1 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/serial-pty-chardev.args b/tests/qemuxml= 2argvdata/serial-pty-chardev.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/serial-pty-chardev.args +++ b/tests/qemuxml2argvdata/serial-pty-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=3Dnone \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ -chardev pty,id=3Dcharserial0 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/serial-spiceport.args b/tests/qemuxml2a= rgvdata/serial-spiceport.args index 43e65a0679..704e6d1820 100644 --- a/tests/qemuxml2argvdata/serial-spiceport.args +++ b/tests/qemuxml2argvdata/serial-spiceport.args @@ -29,7 +29,7 @@ QEMU_AUDIO_DRV=3Dspice \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ -chardev spiceport,id=3Dcharserial0,name=3Dorg.qemu.console.serial.0 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -device usb-tablet,id=3Dinput0,bus=3Dusb.0,port=3D1 \ -spice port=3D5903,tls-port=3D5904,addr=3D127.0.0.1,x509-dir=3D/etc/pki/li= bvirt-spice,seamless-migration=3Don \ -device qxl-vga,id=3Dvideo0,ram_size=3D67108864,vram_size=3D67108864,bus= =3Dpci.0,addr=3D0x2 \ diff --git a/tests/qemuxml2argvdata/serial-tcp-chardev.args b/tests/qemuxml= 2argvdata/serial-tcp-chardev.args index aec7093d03..263add4409 100644 --- a/tests/qemuxml2argvdata/serial-tcp-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=3Dnone \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ -chardev socket,id=3Dcharserial0,host=3D127.0.0.1,port=3D9999 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args b/tests/= qemuxml2argvdata/serial-tcp-telnet-chardev.args index 72f81d7938..13e092c4c7 100644 --- a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=3Dnone \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ -chardev socket,id=3Dcharserial0,host=3D127.0.0.1,port=3D9999,telnet=3Don,= server=3Don,wait=3Doff \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args b= /tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args index 7db40862e9..c2e23e5bc7 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args @@ -30,8 +30,12 @@ QEMU_AUDIO_DRV=3Dnone \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ -chardev udp,id=3Dcharserial0,host=3D127.0.0.1,port=3D2222,localaddr=3D127= .0.0.1,localport=3D1111 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D2 \ -chardev socket,id=3Dcharserial1,host=3D127.0.0.1,port=3D5555 \ --device isa-serial,chardev=3Dcharserial1,id=3Dserial1 \ +-device isa-serial,chardev=3Dcharserial1,id=3Dserial1,index=3D0 \ +-chardev socket,id=3Dcharserial2,host=3D127.0.0.1,port=3D5555 \ +-device isa-serial,chardev=3Dcharserial2,id=3Dserial2,index=3D1 \ +-chardev socket,id=3Dcharserial3,host=3D127.0.0.1,port=3D5555 \ +-device isa-serial,chardev=3Dcharserial3,id=3Dserial3,index=3D3 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml b/= tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml index 9b0b8b3e73..73ed3e9712 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml @@ -30,7 +30,7 @@ - + @@ -41,10 +41,24 @@ + + + + + + + + + + + + + + - + diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args = b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args index f3dc5f5019..374d24ec00 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=3Dnone \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ -chardev udp,id=3Dcharserial0,host=3D127.0.0.1,port=3D2222,localaddr=3D127= .0.0.1,localport=3D1111 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -object tls-creds-x509,id=3Dobjcharserial1_tls0,dir=3D/etc/pki/libvirt-cha= rdev,endpoint=3Dclient,verify-peer=3Don \ -chardev socket,id=3Dcharserial1,host=3D127.0.0.1,port=3D5555,tls-creds=3D= objcharserial1_tls0 \ --device isa-serial,chardev=3Dcharserial1,id=3Dserial1 \ +-device isa-serial,chardev=3Dcharserial1,id=3Dserial1,index=3D1 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml b= /tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml index 75c6c7f5f4..d41f5ee03e 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml @@ -29,7 +29,7 @@ - + diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args b/tests= /qemuxml2argvdata/serial-tcp-tlsx509-chardev.args index f3dc5f5019..374d24ec00 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=3Dnone \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ -chardev udp,id=3Dcharserial0,host=3D127.0.0.1,port=3D2222,localaddr=3D127= .0.0.1,localport=3D1111 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -object tls-creds-x509,id=3Dobjcharserial1_tls0,dir=3D/etc/pki/libvirt-cha= rdev,endpoint=3Dclient,verify-peer=3Don \ -chardev socket,id=3Dcharserial1,host=3D127.0.0.1,port=3D5555,tls-creds=3D= objcharserial1_tls0 \ --device isa-serial,chardev=3Dcharserial1,id=3Dserial1 \ +-device isa-serial,chardev=3Dcharserial1,id=3Dserial1,index=3D1 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml b/tests/= qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml index 75c6c7f5f4..d41f5ee03e 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml @@ -29,7 +29,7 @@ - + diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args = b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args index 151629458b..2defeb28da 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args @@ -30,10 +30,10 @@ QEMU_AUDIO_DRV=3Dnone \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ -chardev udp,id=3Dcharserial0,host=3D127.0.0.1,port=3D2222,localaddr=3D127= .0.0.1,localport=3D1111 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -object secret,id=3Dcharserial1-secret0,data=3D9eao5F8qtkGt+seB1HYivWIxbtw= Uu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=3DmasterKey0,iv=3DAAECAwQFBgcIC= QoLDA0ODw=3D=3D,format=3Dbase64 \ -object tls-creds-x509,id=3Dobjcharserial1_tls0,dir=3D/etc/pki/libvirt-cha= rdev,endpoint=3Dclient,verify-peer=3Don,passwordid=3Dcharserial1-secret0 \ -chardev socket,id=3Dcharserial1,host=3D127.0.0.1,port=3D5555,tls-creds=3D= objcharserial1_tls0 \ --device isa-serial,chardev=3Dcharserial1,id=3Dserial1 \ +-device isa-serial,chardev=3Dcharserial1,id=3Dserial1,index=3D1 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml b= /tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml index 670f282b84..2bf954bc9f 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml @@ -34,7 +34,7 @@ - + diff --git a/tests/qemuxml2argvdata/serial-udp-chardev.args b/tests/qemuxml= 2argvdata/serial-udp-chardev.args index 9d2f2e03e9..de6621f0e2 100644 --- a/tests/qemuxml2argvdata/serial-udp-chardev.args +++ b/tests/qemuxml2argvdata/serial-udp-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=3Dnone \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ -chardev udp,id=3Dcharserial0,host=3D127.0.0.1,port=3D9998,localaddr=3D127= .0.0.1,localport=3D9999 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -chardev udp,id=3Dcharserial1,host=3D,port=3D9999,localaddr=3D,localport= =3D0 \ --device isa-serial,chardev=3Dcharserial1,id=3Dserial1 \ +-device isa-serial,chardev=3Dcharserial1,id=3Dserial1,index=3D1 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.args b/tests/qemuxm= l2argvdata/serial-unix-chardev.args index 19731b02b2..1e2444f824 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.args @@ -28,8 +28,8 @@ QEMU_AUDIO_DRV=3Dnone \ -boot strict=3Don \ -usb \ -chardev socket,id=3Dcharserial0,path=3D/tmp/serial.sock \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -chardev socket,id=3Dcharserial1,path=3D/tmp/serial-server.sock,server=3Do= n,wait=3Doff \ --device isa-serial,chardev=3Dcharserial1,id=3Dserial1 \ +-device isa-serial,chardev=3Dcharserial1,id=3Dserial1,index=3D1 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args = b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args index 1e3d5772b4..1387fc9a1d 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args @@ -29,9 +29,9 @@ XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ -chardev socket,id=3Dcharserial0,path=3D/tmp/serial.sock \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","in= dex":0}' \ -chardev socket,id=3Dcharserial1,fd=3D1729,server=3Don,wait=3Doff \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","in= dex":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","add= r":"0x2"}' \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ diff --git a/tests/qemuxml2argvdata/serial-vc-chardev.args b/tests/qemuxml2= argvdata/serial-vc-chardev.args index d28a3eee47..09b33a15ee 100644 --- a/tests/qemuxml2argvdata/serial-vc-chardev.args +++ b/tests/qemuxml2argvdata/serial-vc-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=3Dnone \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ -chardev vc,id=3Dcharserial0 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/user-aliases.args b/tests/qemuxml2argvd= ata/user-aliases.args index 486473a566..8608144b5e 100644 --- a/tests/qemuxml2argvdata/user-aliases.args +++ b/tests/qemuxml2argvdata/user-aliases.args @@ -55,9 +55,9 @@ QEMU_AUDIO_DRV=3Dnone \ -device rtl8139,netdev=3Dhostua-AndAlsoClientMode,id=3Dua-AndAlsoClientMod= e,mac=3D52:54:00:8c:b1:f8,bus=3Dpci.0,addr=3D0xa \ -device ccid-card-emulated,backend=3Dnss-emulated,id=3Dsmartcard0,bus=3Dua= -myCCID.0 \ -chardev pty,id=3Dcharserial0 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -chardev pty,id=3Dcharserial1 \ --device isa-serial,chardev=3Dcharserial1,id=3Dserial1 \ +-device isa-serial,chardev=3Dcharserial1,id=3Dserial1,index=3D1 \ -chardev socket,id=3Dcharchannel0,path=3D/var/lib/libvirt/qemu/channel/tar= get/gentoo.org.qemu.guest_agent.0,server=3Don,wait=3Doff \ -device virtserialport,bus=3Dvirtio-serial0.0,nr=3D1,chardev=3Dcharchannel= 0,id=3Dchannel0,name=3Dorg.qemu.guest_agent.0 \ -vnc 127.0.0.1:0 \ diff --git a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args= b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args index 01fe01e3c6..d306b37b53 100644 --- a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=3Dmapped,id=3Dfsdev-fs3,path=3D/export/fs3 \ -device '{"driver":"virtio-9p-pci","id":"fs3","fsdev":"fsdev-fs3","mount_t= ag":"fs3","bus":"pci.0","addr":"0x5"}' \ -chardev pty,id=3Dcharserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","in= dex":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","add= r":"0xc"}' \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ diff --git a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args = b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args index 8b325bb7ec..0752f09fe9 100644 --- a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args @@ -35,7 +35,7 @@ XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=3Dmapped,multidevs=3Dwarn,id=3Dfsdev-fs2,path= =3D/export/fs2 \ -device '{"driver":"virtio-9p-pci","id":"fs2","fsdev":"fsdev-fs2","mount_t= ag":"fs2","bus":"pci.0","addr":"0x4"}' \ -chardev pty,id=3Dcharserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","in= dex":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","add= r":"0xc"}' \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args b= /tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args index 3cae9fafa0..8cad1d9f38 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=3D/tmp/lib/domain--1-guest/.config \ -netdev user,id=3Dhostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":= "52:54:00:4c:e3:86","bus":"pci.0","addr":"0x3"}' \ -chardev pty,id=3Dcharserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","in= dex":0}' \ -chardev socket,id=3Dcharchannel0,fd=3D1729,server=3Don,wait=3Doff \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chard= ev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args b= /tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args index fbfb823d83..3c4688a89e 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args @@ -38,7 +38,7 @@ XDG_CONFIG_HOME=3D/tmp/lib/domain--1-guest/.config \ -netdev user,id=3Dhostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":= "52:54:00:09:a4:37","bus":"pci.0","addr":"0x2"}' \ -chardev pty,id=3Dcharserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","in= dex":0}' \ -chardev socket,id=3Dcharchannel0,fd=3D1729,server=3Don,wait=3Doff \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chard= ev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args = b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args index ca0e00f468..9e4c361ec9 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args @@ -44,7 +44,7 @@ XDG_CONFIG_HOME=3D/tmp/lib/domain--1-guest/.config \ -netdev user,id=3Dhostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":= "52:54:00:d2:70:0b","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=3Dcharserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","in= dex":0}' \ -chardev socket,id=3Dcharchannel0,fd=3D1729,server=3Don,wait=3Doff \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chard= ev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args = b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args index c6970e349d..b4d90dff5e 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args @@ -45,7 +45,7 @@ XDG_CONFIG_HOME=3D/tmp/lib/domain--1-guest/.config \ -netdev user,id=3Dhostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":= "52:54:00:09:a4:37","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=3Dcharserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","in= dex":0}' \ -chardev socket,id=3Dcharchannel0,fd=3D1729,server=3Don,wait=3Doff \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chard= ev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml b/test= s/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml index 7fde19f283..de11465233 100644 --- a/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml @@ -37,7 +37,7 @@ - + --=20 2.27.0