From nobody Thu Apr 18 00:48:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) client-ip=209.132.183.39; envelope-from=libvir-list-bounces@redhat.com; helo=mx6-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com [209.132.183.39]) by mx.zohomail.com with SMTPS id 1487690757056340.6449573854369; Tue, 21 Feb 2017 07:25:57 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LFL9Ik059398; Tue, 21 Feb 2017 10:21:09 -0500 Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1LFL94O016747 for ; Tue, 21 Feb 2017 10:21:09 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0C5FD749F4; Tue, 21 Feb 2017 15:21:09 +0000 (UTC) Received: from angien.brq.redhat.com (dhcp129-47.brq.redhat.com [10.34.129.47]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5F753749E0; Tue, 21 Feb 2017 15:21:08 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 21 Feb 2017 16:22:05 +0100 Message-Id: <0602546b146206f82d57cbab1916ce56c21e2ed3.1487690478.git.pkrempa@redhat.com> X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH] conf: Allow omitting of numa node memory size 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" Memory-less numa nodes could be specified by setting the memory size to 0. Allow ommiting of the parameter completely to specify the same. Partially resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1217144 --- docs/schemas/cputypes.rng | 12 ++++---- src/conf/numa_conf.c | 11 ++++--- tests/qemuxml2argvdata/qemuxml2argv-cpu-numa4.args | 22 ++++++++++++++ tests/qemuxml2argvdata/qemuxml2argv-cpu-numa4.xml | 25 ++++++++++++++++ tests/qemuxml2argvtest.c | 1 + .../qemuxml2xmlout-cpu-numa4.xml | 34 ++++++++++++++++++= ++++ tests/qemuxml2xmltest.c | 1 + 7 files changed, 97 insertions(+), 9 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-numa4.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-numa4.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-cpu-numa4.xml diff --git a/docs/schemas/cputypes.rng b/docs/schemas/cputypes.rng index 7cc9dd3d8..fdac7878f 100644 --- a/docs/schemas/cputypes.rng +++ b/docs/schemas/cputypes.rng @@ -103,13 +103,15 @@ - - - - - + + + + + + + diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c index bfd37032a..ee55b421b 100644 --- a/src/conf/numa_conf.c +++ b/src/conf/numa_conf.c @@ -774,7 +774,7 @@ virDomainNumaDefCPUParseXML(virDomainNumaPtr def, ctxt->node =3D nodes[i]; if (virDomainParseMemory("./@memory", "./@unit", ctxt, - &def->mem_nodes[cur_cell].mem, true, fals= e) < 0) + &def->mem_nodes[cur_cell].mem, false, fal= se) < 0) goto cleanup; if ((tmp =3D virXMLPropString(nodes[i], "memAccess"))) { @@ -807,6 +807,7 @@ virDomainNumaDefCPUFormat(virBufferPtr buf, virDomainMemoryAccess memAccess; char *cpustr; size_t ncells =3D virDomainNumaGetNodeCount(def); + unsigned long long cellmem; size_t i; if (ncells =3D=3D 0) @@ -823,9 +824,11 @@ virDomainNumaDefCPUFormat(virBufferPtr buf, virBufferAddLit(buf, " 0) { + virBufferAsprintf(buf, " memory=3D'%llu'", cellmem); + virBufferAddLit(buf, " unit=3D'KiB'"); + } if (memAccess) virBufferAsprintf(buf, " memAccess=3D'%s'", virDomainMemoryAccessTypeToString(memAccess)= ); diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa4.args b/tests/qem= uxml2argvdata/qemuxml2argv-cpu-numa4.args new file mode 100644 index 000000000..db53409a4 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa4.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 \ +-name QEMUGuest1 \ +-S \ +-M pc \ +-m 107 \ +-smp 1,maxcpus=3D16,sockets=3D2,cores=3D4,threads=3D2 \ +-numa node,nodeid=3D0,cpus=3D0-7,mem=3D107 \ +-numa node,nodeid=3D1,cpus=3D8-15,mem=3D0 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-nographic \ +-nodefaults \ +-monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ +-no-acpi \ +-boot n \ +-usb \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa4.xml b/tests/qemu= xml2argvdata/qemuxml2argv-cpu-numa4.xml new file mode 100644 index 000000000..af30f785f --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa4.xml @@ -0,0 +1,25 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 16 + + hvm + + + + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index f55b04b05..7ef555736 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1521,6 +1521,7 @@ mymain(void) DO_TEST("cpu-strict1", QEMU_CAPS_KVM); DO_TEST("cpu-numa1", NONE); DO_TEST("cpu-numa2", NONE); + DO_TEST("cpu-numa4", NONE); DO_TEST("cpu-numa-no-memory-element", NONE); DO_TEST_PARSE_ERROR("cpu-numa3", NONE); DO_TEST_FAILURE("cpu-numa-disjoint", NONE); diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-cpu-numa4.xml b/tests/= qemuxml2xmloutdata/qemuxml2xmlout-cpu-numa4.xml new file mode 100644 index 000000000..a5161a158 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-cpu-numa4.xml @@ -0,0 +1,34 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 16 + + hvm + + + + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu + +
+ + + + + +
+ + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 0702f581e..ae55d1d7f 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -962,6 +962,7 @@ mymain(void) DO_TEST("cpu-numa1", NONE); DO_TEST("cpu-numa2", NONE); + DO_TEST("cpu-numa4", NONE); DO_TEST("cpu-numa-no-memory-element", NONE); DO_TEST("cpu-numa-disordered", NONE); DO_TEST("cpu-numa-disjoint", NONE); --=20 2.11.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list