From nobody Mon Feb 9 06:48:37 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1586376859; cv=none; d=zohomail.com; s=zohoarc; b=i2oieF3AYrsyrqhRf4csVOd7k1AGB8ijYslFT45j4eY8kqbv1U2pVDY2r9iHnVdCUR/FaZDm0LLXZzyx0/+ynJwF4SkIiB2osjPY1WroLfHpMaz0C+7YgS+gLggD52kWpMyjnrXuU9r+M4Y+7NkZBGRPPfTAD1Q/qH0ihlBUc2s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586376859; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=meAO4ouljaVAesMmyySKkmNJRUU+A5v26iKFCB+m/D4=; b=kddjmEQkgCVpBdjFHcLYyNCA7w2Zqwe7RMm1E3nNe4TE1BR3I/RptZ3SczZDfPXAEOtSP2rhmLWi7qbmnjZuPGgTn0UBHCMi4yGf1DI8WsyLcBRekeuTJ01SxiDSyc5VwZvV2yO+rx1wbLhAxxQVMpE6a5+O/Dzox4fKh9pm8sE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1586376859186562.5136511985082; Wed, 8 Apr 2020 13:14:19 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-301-XSKbYWC9OmW-bYigFxvlwA-1; Wed, 08 Apr 2020 16:14:15 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5EB9713FE; Wed, 8 Apr 2020 20:14:07 +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 2FCE29B905; Wed, 8 Apr 2020 20:14:07 +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 CD98893060; Wed, 8 Apr 2020 20:14:06 +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 038KDwT9002101 for ; Wed, 8 Apr 2020 16:13:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8658F2026D66; Wed, 8 Apr 2020 20:13:58 +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 820892028DCB for ; Wed, 8 Apr 2020 20:13:56 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3885C8F7A15 for ; Wed, 8 Apr 2020 20:13:56 +0000 (UTC) Received: from m4a0073g.houston.softwaregrp.com (m4a0073g.houston.softwaregrp.com [15.124.2.131]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-281-CCCCjvqNO_OQ1z21DfVITw-1; Wed, 08 Apr 2020 16:13:52 -0400 Received: FROM m4a0073g.houston.softwaregrp.com (15.120.17.147) BY m4a0073g.houston.softwaregrp.com WITH ESMTP FOR libvir-list@redhat.com; Wed, 8 Apr 2020 20:11:42 +0000 Received: from M4W0335.microfocus.com (2002:f78:1193::f78:1193) by M4W0335.microfocus.com (2002:f78:1193::f78:1193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Wed, 8 Apr 2020 20:09:23 +0000 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (15.124.8.10) by M4W0335.microfocus.com (15.120.17.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Wed, 8 Apr 2020 20:09:23 +0000 Received: from BY5PR18MB3315.namprd18.prod.outlook.com (2603:10b6:a03:196::12) by BY5PR18MB3121.namprd18.prod.outlook.com (2603:10b6:a03:1a5::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.20; Wed, 8 Apr 2020 20:09:22 +0000 Received: from BY5PR18MB3315.namprd18.prod.outlook.com ([fe80::6157:7c41:b13d:23f5]) by BY5PR18MB3315.namprd18.prod.outlook.com ([fe80::6157:7c41:b13d:23f5%3]) with mapi id 15.20.2878.021; Wed, 8 Apr 2020 20:09:22 +0000 Received: from linux-tbji.provo.novell.com (75.169.23.17) by DM3PR12CA0095.namprd12.prod.outlook.com (2603:10b6:0:55::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.15 via Frontend Transport; Wed, 8 Apr 2020 20:09:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586376857; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=meAO4ouljaVAesMmyySKkmNJRUU+A5v26iKFCB+m/D4=; b=fbEt3I7qVm0lPEvxBkMbJcAcGoQR+MafIPybQF8OX9cX/8iQOa621lMyXSOb1a0tUt21q6 7Hb34meMjepgwNo9VZYfD7w4derSijRUei/SsZU6mICOh2azxtZepVxJmjv+B0nQ9BWtSg I3vMTJI6wItvq0lrOw2rSNV+06GaloU= X-MC-Unique: XSKbYWC9OmW-bYigFxvlwA-1 X-MC-Unique: CCCCjvqNO_OQ1z21DfVITw-1 From: Jim Fehlig To: Subject: [PATCH 2/3] libxl: Add support for max_event_channels Date: Wed, 8 Apr 2020 14:08:54 -0600 Message-ID: <20200408200855.19806-3-jfehlig@suse.com> In-Reply-To: <20200408200855.19806-1-jfehlig@suse.com> References: <20200408200855.19806-1-jfehlig@suse.com> X-ClientProxiedBy: DM3PR12CA0095.namprd12.prod.outlook.com (2603:10b6:0:55::15) To BY5PR18MB3315.namprd18.prod.outlook.com (2603:10b6:a03:196::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Originating-IP: [75.169.23.17] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9afb87c1-0c74-40b8-c068-08d7dbf8b9a7 X-MS-TrafficTypeDiagnostic: BY5PR18MB3121: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1091; X-Forefront-PRVS: 0367A50BB1 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR18MB3315.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10019020)(4636009)(396003)(366004)(136003)(39850400004)(346002)(376002)(6666004)(5660300002)(8936002)(26005)(2906002)(186003)(6506007)(2616005)(16526019)(956004)(1076003)(6916009)(107886003)(66476007)(86362001)(66556008)(36756003)(66946007)(6512007)(81166007)(316002)(6486002)(81156014)(52116002)(4326008)(478600001)(8676002); DIR:OUT; SFP:1102; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XL8RFcRqJJ5BjWL2aFGj8GBE9uA4P92Vmqs3fTrVTEfaWNifGsyqvUFZH0ie/rmkmSVO5KcyjgAohGkiY+wCwms4klNxV1keN4edChCngiqCwbR/ENcxXvFhh3uY7lc6jvEUwGzjYKPWUp1E9hXESHyUJxA99S8SgQQjwu5ms8CCbOCs9ZQ9PlKyK/JYDDxm9bBuqsiNzqPt0WOOsdCmfDb2Fl6gC4t8HB86mYmWac1DEnl1TBjHVVslXjifqoFVnZ7FqoPfU3Siy67U9+YkPVB/awK0HzQZiTt66CYiWy4eoaiPVp4pdoAqkI4I92KRRGETj5DH6GUFHCn+aPrLMX9RlzSX1u3MHui2dsQry1L4a1PWDp2VxHnUbSmcVK08bsCU0D8GGJ9FZd5kh0pggDM6gvh6mxIKVXmBDxjWdp/mH3rhqNpbDk0s0KaWeRR6 X-MS-Exchange-AntiSpam-MessageData: B/I0rkudpCCCKZPFFKzNRuWaMFlohX3qCBYQIzRi1p0CuyyqMELT35Y3q+WY/rkVowVuuYvAnWPKF3kj1A5w9zvddSSQAZmk1dFwGK3yBLFSlGuRIaNEvmQGuHxp3mvg8+YYy2IWeAdA3m4epHuMKw== X-MS-Exchange-CrossTenant-Network-Message-Id: 9afb87c1-0c74-40b8-c068-08d7dbf8b9a7 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2020 20:09:21.2663 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: NVlZYB1L/wM4383R/3HRQQBhRZs3vXCGwvLD8PkF+iVl3yJUqzhXIwzqV3NozSvb3sNiPWrqUjUBPojKX2ID6g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR18MB3121 X-OriginatorOrg: suse.com X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 038KDwT9002101 X-loop: libvir-list@redhat.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.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Add support for setting event_channels 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 | 14 +-- .../max-eventchannels-hvm.json | 90 +++++++++++++++++++ .../max-eventchannels-hvm.xml | 37 ++++++++ tests/libxlxml2domconfigtest.c | 2 + 4 files changed, 138 insertions(+), 5 deletions(-) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index be5fc505fe..b3f67f817a 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -380,13 +380,17 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, b_info->max_memkb =3D virDomainDefGetMemoryInitial(def); b_info->target_memkb =3D def->mem.cur_balloon; =20 -#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; - } + if (def->controllers[i]->type =3D=3D VIR_DOMAIN_CONTROLLER_TYPE_XE= NBUS) { + if (def->controllers[i]->opts.xenbusopts.maxEventChannels > 0) + b_info->event_channels =3D def->controllers[i]->opts.xenbu= sopts.maxEventChannels; + +#ifdef LIBXL_HAVE_BUILDINFO_GRANT_LIMITS + if (def->controllers[i]->opts.xenbusopts.maxGrantFrames > 0) + b_info->max_grant_frames =3D def->controllers[i]->opts.xen= busopts.maxGrantFrames; #endif + } + } =20 if (hvm || pvh) { if (caps && diff --git a/tests/libxlxml2domconfigdata/max-eventchannels-hvm.json b/test= s/libxlxml2domconfigdata/max-eventchannels-hvm.json new file mode 100644 index 0000000000..d5b351beb5 --- /dev/null +++ b/tests/libxlxml2domconfigdata/max-eventchannels-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, + "event_channels": 2047, + "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-eventchannels-hvm.xml b/tests= /libxlxml2domconfigdata/max-eventchannels-hvm.xml new file mode 100644 index 0000000000..97b1440a5e --- /dev/null +++ b/tests/libxlxml2domconfigdata/max-eventchannels-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 + + + + + + + + + +