From nobody Sun Feb 8 07:14:29 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) client-ip=209.132.183.25; envelope-from=libvir-list-bounces@redhat.com; helo=mx4-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by mx.zohomail.com with SMTPS id 1487343214841477.6842568223424; Fri, 17 Feb 2017 06:53:34 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1HEnZ4l012704; Fri, 17 Feb 2017 09:49:35 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1HEnNAD003703 for ; Fri, 17 Feb 2017 09:49:23 -0500 Received: from antique-work.brq.redhat.com (dhcp129-175.brq.redhat.com [10.34.129.175]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1HEnIn2022242 for ; Fri, 17 Feb 2017 09:49:23 -0500 From: Pavel Hrdina To: libvir-list@redhat.com Date: Fri, 17 Feb 2017 15:49:09 +0100 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 05/13] conf: always display iothread ids in the XML 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" There was at first only iothreads element in the XML. Because iothreads are used by theirs ids we should always print them in the XML even if they are auto-generated. Signed-off-by: Pavel Hrdina --- src/conf/domain_conf.c | 32 +++++-------------= ---- src/conf/domain_conf.h | 1 - src/qemu/qemu_driver.c | 2 -- src/qemu/qemu_process.c | 5 ++-- .../qemuxml2xmlout-cputune-iothreads.xml | 4 +++ ...l2xmlout-cputune-iothreadsched-zeropriority.xml | 6 ++++ .../qemuxml2xmlout-cputune-iothreadsched.xml | 6 ++++ .../qemuxml2xmlout-cputune-numatune.xml | 4 +++ .../qemuxml2xmlout-iothreads-disk-virtio-ccw.xml | 4 +++ .../qemuxml2xmlout-iothreads-disk.xml | 4 +++ .../qemuxml2xmlout-iothreads-ids-partial.xml | 2 ++ .../qemuxml2xmlout-iothreads-virtio-scsi-ccw.xml | 4 +++ .../qemuxml2xmlout-iothreads-virtio-scsi-pci.xml | 4 +++ .../qemuxml2xmlout-iothreads.xml | 4 +++ .../qemuxml2xmlout-vcpu-placement-static.xml | 4 +++ 15 files changed, 55 insertions(+), 31 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 69db692217..ab0e19ef16 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2623,7 +2623,6 @@ virDomainIOThreadIDDefArrayInit(virDomainDefPtr def, if (VIR_ALLOC(iothrid) < 0) goto error; iothrid->iothread_id =3D nxt; - iothrid->autofill =3D true; =20 pos =3D virDomainIOThreadInsertGetPos(def, iothrid); =20 @@ -20216,18 +20215,10 @@ void virDomainIOThreadIDDel(virDomainDefPtr def, unsigned int iothread_id) { - size_t i, j; + size_t i; =20 for (i =3D 0; i < def->niothreadids; i++) { if (def->iothreadids[i]->iothread_id =3D=3D iothread_id) { - /* If we were sequential and removed a threadid in the - * beginning or middle of the list, then unconditionally - * clear the autofill flag so we don't lose these - * definitions for XML formatting. - */ - for (j =3D i + 1; j < def->niothreadids; j++) - def->iothreadids[j]->autofill =3D false; - virDomainIOThreadIDDefFree(def->iothreadids[i]); VIR_DELETE_ELEMENT(def->iothreadids, i, def->niothreadids); =20 @@ -23873,23 +23864,14 @@ virDomainDefFormatInternal(virDomainDefPtr def, if (def->niothreadids > 0) { virBufferAsprintf(buf, "%lu\n", def->niothreadids); - /* Only print out iothreadids if we read at least one */ + virBufferAddLit(buf, "\n"); + virBufferAdjustIndent(buf, 2); for (i =3D 0; i < def->niothreadids; i++) { - if (!def->iothreadids[i]->autofill) - break; - } - if (i < def->niothreadids) { - virBufferAddLit(buf, "\n"); - virBufferAdjustIndent(buf, 2); - for (i =3D 0; i < def->niothreadids; i++) { - if (def->iothreadids[i]->autofill) - continue; - virBufferAsprintf(buf, "\n", - def->iothreadids[i]->iothread_id); - } - virBufferAdjustIndent(buf, -2); - virBufferAddLit(buf, "\n"); + virBufferAsprintf(buf, "\n", + def->iothreadids[i]->iothread_id); } + virBufferAdjustIndent(buf, -2); + virBufferAddLit(buf, "\n"); } =20 if (virDomainCputuneDefFormat(buf, def) < 0) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 8ff2de8c25..63faec499a 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2068,7 +2068,6 @@ typedef struct _virDomainIOThreadIDDef virDomainIOThr= eadIDDef; typedef virDomainIOThreadIDDef *virDomainIOThreadIDDefPtr; =20 struct _virDomainIOThreadIDDef { - bool autofill; unsigned int iothread_id; int thread_id; virBitmapPtr cpumask; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 661f6f5d34..3f0237da48 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -5496,7 +5496,6 @@ qemuDomainPinIOThread(virDomainPtr dom, =20 virBitmapFree(iothrid->cpumask); iothrid->cpumask =3D cpumask; - iothrid->autofill =3D false; =20 /* Configure the corresponding cpuset cgroup before set affinity. = */ if (virCgroupHasController(priv->cgroup, @@ -5546,7 +5545,6 @@ qemuDomainPinIOThread(virDomainPtr dom, =20 virBitmapFree(iothrid->cpumask); iothrid->cpumask =3D cpumask; - iothrid->autofill =3D false; =20 ret =3D virDomainSaveConfig(cfg->configDir, driver->caps, persiste= ntDef); goto endjob; diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 62f0b9b630..2a65e9043c 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2115,9 +2115,8 @@ qemuProcessDetectIOThreadPIDs(virQEMUDriverPtr driver, /* Check if the domain had defined any iothreadid elements * and supply a VIR_INFO indicating that it's being remove= d. */ - if (!vm->def->iothreadids[i]->autofill) - VIR_INFO("IOThreads not supported, remove iothread id = '%u'", - vm->def->iothreadids[i]->iothread_id); + VIR_INFO("IOThreads not supported, remove iothread id '%u'= ", + vm->def->iothreadids[i]->iothread_id); virDomainIOThreadIDDefFree(vm->def->iothreadids[i]); } /* Remove any trace */ diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-iothreads.xml = b/tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-iothreads.xml index 6c95e05131..bf8fa0b1de 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-iothreads.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-iothreads.xml @@ -5,6 +5,10 @@ 219136 2 2 + + + + 2048 1000000 diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-iothreadsched-= zeropriority.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-iothread= sched-zeropriority.xml index 794a52d571..6547f96835 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-iothreadsched-zeropri= ority.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-iothreadsched-zeropri= ority.xml @@ -5,6 +5,12 @@ 219136 2 4 + + + + + + 2048 1000000 diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-iothreadsched.= xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-iothreadsched.xml index cd1dc87b52..0c1479f199 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-iothreadsched.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-iothreadsched.xml @@ -5,6 +5,12 @@ 219136 2 4 + + + + + + 2048 1000000 diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-numatune.xml b= /tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-numatune.xml index ff987e7d59..a77eeab934 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-numatune.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-numatune.xml @@ -5,6 +5,10 @@ 65536 6 2 + + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-disk-virtio-= ccw.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-disk-virtio-ccw= .xml index f6d103978d..de5d276ecb 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-disk-virtio-ccw.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-disk-virtio-ccw.xml @@ -5,6 +5,10 @@ 219136 1 2 + + + + hvm diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-disk.xml b/t= ests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-disk.xml index 0eb45b7d15..0b001b9fd3 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-disk.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-disk.xml @@ -5,6 +5,10 @@ 219136 2 2 + + + + hvm diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-ids-partial.= xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-ids-partial.xml index d6deced96a..57f3be96fc 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-ids-partial.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-ids-partial.xml @@ -6,6 +6,8 @@ 2 4 + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-virtio-scsi-= ccw.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-virtio-scsi-ccw= .xml index 5e91f1c4aa..161dec9bce 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-virtio-scsi-ccw.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-virtio-scsi-ccw.xml @@ -5,6 +5,10 @@ 219136 1 2 + + + + hvm diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-virtio-scsi-= pci.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-virtio-scsi-pci= .xml index d8306d4304..c3051599b2 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-virtio-scsi-pci.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-virtio-scsi-pci.xml @@ -5,6 +5,10 @@ 219136 2 2 + + + + hvm diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads.xml b/tests/= qemuxml2xmloutdata/qemuxml2xmlout-iothreads.xml index 5c5d9dbdb1..ff4ae53366 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads.xml @@ -5,6 +5,10 @@ 219136 2 2 + + + + hvm diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-vcpu-placement-static.= xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-vcpu-placement-static.xml index c6471e3a07..9949b17eb6 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-vcpu-placement-static.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-vcpu-placement-static.xml @@ -5,6 +5,10 @@ 65536 6 2 + + + + --=20 2.11.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list