From nobody Mon Feb 9 16:45:47 2026 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 1552086387252489.3562853795444; Fri, 8 Mar 2019 15:06:27 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DFAC2C04BD37; Fri, 8 Mar 2019 23:06:24 +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 7C3161001DD8; Fri, 8 Mar 2019 23:06:24 +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 ECA0441F3E; Fri, 8 Mar 2019 23:06:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x28N6LZk031596 for ; Fri, 8 Mar 2019 18:06:21 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7718B17C4B; Fri, 8 Mar 2019 23:06:21 +0000 (UTC) Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 727454141 for ; Fri, 8 Mar 2019 23:06:19 +0000 (UTC) Received: from smtp2.provo.novell.com (smtp2.provo.novell.com [137.65.250.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3DDAD3092657 for ; Fri, 8 Mar 2019 23:06:18 +0000 (UTC) Received: from linux-tbji.provo.novell.com (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by smtp2.provo.novell.com with ESMTP (NOT encrypted); Fri, 08 Mar 2019 16:06:09 -0700 From: Jim Fehlig To: libvir-list@redhat.com Date: Fri, 8 Mar 2019 16:05:57 -0700 Message-Id: <20190308230559.5219-4-jfehlig@suse.com> In-Reply-To: <20190308230559.5219-1-jfehlig@suse.com> References: <20190308230559.5219-1-jfehlig@suse.com> MIME-Version: 1.0 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Fri, 08 Mar 2019 23:06:18 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Fri, 08 Mar 2019 23:06:18 +0000 (UTC) for IP:'137.65.250.81' DOMAIN:'smtp2.provo.novell.com' HELO:'smtp2.provo.novell.com' FROM:'jfehlig@suse.com' RCPT:'' X-RedHat-Spam-Score: -2.301 (RCVD_IN_DNSWL_MED, SPF_PASS) 137.65.250.81 smtp2.provo.novell.com 137.65.250.81 smtp2.provo.novell.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.43 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/4] libxl: Add support for max_grant_frames 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 08 Mar 2019 23:06:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Add support for setting max_grant_frames in libxl domain config object and include a test to check that it is properly converted from XML to libxl domain config. Signed-off-by: Jim Fehlig Reviewed-by: Daniel P. Berrang=C3=A9 --- src/libxl/libxl_conf.c | 9 ++ .../max-gntframes-hvm.json | 90 +++++++++++++++++++ .../max-gntframes-hvm.xml | 37 ++++++++ tests/libxlxml2domconfigtest.c | 3 + 4 files changed, 139 insertions(+) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index c769050ff1..e55a9fe22e 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -393,6 +393,15 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, def->mem.cur_balloon =3D VIR_ROUND_UP(def->mem.cur_balloon, 1024); b_info->max_memkb =3D virDomainDefGetMemoryInitial(def); b_info->target_memkb =3D def->mem.cur_balloon; + +#ifdef LIBXL_HAVE_BUILDINFO_GRANT_LIMITS + for (i =3D 0; i < def->ncontrollers; i++) { + if (def->controllers[i]->type =3D=3D VIR_DOMAIN_CONTROLLER_TYPE_XE= NBUS && + def->controllers[i]->opts.xenbusopts.maxGrantFrames > 0) + b_info->max_grant_frames =3D def->controllers[i]->opts.xenbuso= pts.maxGrantFrames; + } +#endif + if (hvm || pvh) { if (caps && def->cpu && def->cpu->mode =3D=3D (VIR_CPU_MODE_HOST_PASSTHROU= GH)) { diff --git a/tests/libxlxml2domconfigdata/max-gntframes-hvm.json b/tests/li= bxlxml2domconfigdata/max-gntframes-hvm.json new file mode 100644 index 0000000000..ef602f09fc --- /dev/null +++ b/tests/libxlxml2domconfigdata/max-gntframes-hvm.json @@ -0,0 +1,90 @@ +{ + "c_info": { + "type": "hvm", + "name": "test-hvm", + "uuid": "2147d599-9cc6-c0dc-92ab-4064b5446e9b" + }, + "b_info": { + "max_vcpus": 4, + "avail_vcpus": [ + 0, + 1, + 2, + 3 + ], + "max_memkb": 1048576, + "target_memkb": 1048576, + "video_memkb": 8192, + "shadow_memkb": 12288, + "max_grant_frames": 64, + "device_model_version": "qemu_xen", + "device_model": "/bin/true", + "sched_params": { + + }, + "type.hvm": { + "pae": "True", + "apic": "True", + "acpi": "True", + "vga": { + "kind": "cirrus" + }, + "vnc": { + "enable": "True", + "listen": "0.0.0.0", + "findunused": "False" + }, + "sdl": { + "enable": "False" + }, + "spice": { + + }, + "boot": "c", + "rdm": { + + } + }, + "arch_arm": { + + } + }, + "disks": [ + { + "pdev_path": "/var/lib/xen/images/test-hvm.img", + "vdev": "hda", + "backend": "qdisk", + "format": "raw", + "removable": 1, + "readwrite": 1 + } + ], + "nics": [ + { + "devid": 0, + "mac": "00:16:3e:66:12:b4", + "bridge": "br0", + "script": "/etc/xen/scripts/vif-bridge", + "nictype": "vif_ioemu" + } + ], + "vfbs": [ + { + "devid": -1, + "vnc": { + "enable": "True", + "listen": "0.0.0.0", + "findunused": "False" + }, + "sdl": { + "enable": "False" + } + } + ], + "vkbs": [ + { + "devid": -1 + } + ], + "on_reboot": "restart" +} diff --git a/tests/libxlxml2domconfigdata/max-gntframes-hvm.xml b/tests/lib= xlxml2domconfigdata/max-gntframes-hvm.xml new file mode 100644 index 0000000000..910bbda10b --- /dev/null +++ b/tests/libxlxml2domconfigdata/max-gntframes-hvm.xml @@ -0,0 +1,37 @@ + + test-hvm + None + 2147d599-9cc6-c0dc-92ab-4064b5446e9b + 1048576 + 1048576 + 4 + destroy + restart + destroy + + + hvm + /usr/lib/xen/boot/hvmloader + + + + + + + + + /bin/true + + + + + + + + + +