From nobody Mon Mar 23 21:28:28 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass header.i=thierry.escande@vates.tech; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=vates.tech ARC-Seal: i=1; a=rsa-sha256; t=1773419875; cv=none; d=zohomail.com; s=zohoarc; b=nVa4BdLn2ahTAe96e6v1Pebt+D5WamAu2OoIdeFaTHLqRHq0fXn47LNaFKT3SNwztuh7aqyhzL3ZY0PdKBDjj2QRjcXf9gUDSlcsQf6h4SsCnjUohRgLpIT/FZxRHHyb95NSFz3Eex6aQDwECT4Pm9FJKzSD/2ICzNCZgXyK26Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773419875; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=R5584u5biB3YH5gAUKEPnNqwevOZ2xVZukEW5ifg0cU=; b=UhYR+ymMGD6ppcbzrS5t7ldOH7BPBOdRM8lYnmZXOV+gcCuVX6VwaJao9ETO6Q/ytxZhdLuNmHknLb+ycRI5U2GKYeOrQczcsLNJclOrivZ/iDUN57QmZnXy2t7cN9f1niAf731xn0b7PGL8YqWPTv3sPdFTt3fwlY/+FBNCRJU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=thierry.escande@vates.tech; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1773419874992529.0411909588372; Fri, 13 Mar 2026 09:37:54 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1254052.1550063 (Exim 4.92) (envelope-from ) id 1w15W4-0000Nt-Gn; Fri, 13 Mar 2026 16:37:36 +0000 Received: by outflank-mailman (output) from mailman id 1254052.1550063; Fri, 13 Mar 2026 16:37:36 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1w15W4-0000Nj-CS; Fri, 13 Mar 2026 16:37:36 +0000 Received: by outflank-mailman (input) for mailman id 1254052; Fri, 13 Mar 2026 16:37:35 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1w15Tn-0006Ek-Nt for xen-devel@lists.xenproject.org; Fri, 13 Mar 2026 16:35:15 +0000 Received: from mail134-15.atl141.mandrillapp.com (mail134-15.atl141.mandrillapp.com [198.2.134.15]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 9952ad39-1efa-11f1-9ccf-f158ae23cfc8; Fri, 13 Mar 2026 17:35:08 +0100 (CET) Received: from pmta10.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1]) by mail134-15.atl141.mandrillapp.com (Mailchimp) with ESMTP id 4fXVT42VDCzPm0V3t for ; Fri, 13 Mar 2026 16:35:04 +0000 (GMT) Received: from [37.26.189.201] by mandrillapp.com id fdb286a6cc10436981f303e25614d07d; Fri, 13 Mar 2026 16:35:04 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 9952ad39-1efa-11f1-9ccf-f158ae23cfc8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; s=mte1; t=1773419704; x=1773689704; bh=R5584u5biB3YH5gAUKEPnNqwevOZ2xVZukEW5ifg0cU=; h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID: Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date: Subject:From; b=K8fmtxl4tV4VUw1ecE5JmTIfKzMctA4yaJpZEuc1zolpDAYI7O5Rh8nnqVu6/xuoA Mxa9pKq6ieNdc0UnkXW6SBSZP+6O0kFSspQr8P7afj+tAgZIGgWjUt1u019whoLcLx 5vmN8WGf2+nkd+C9xFYZKUeQ4NgrqWsl3C9QornuBENSbfe6nfLDEa3jLE9madLfFK SX4lx5l7vjQHKpRaXOkuiPVTv+UAfbpA3SDpNwsLW8iszld2OsHi+av65+yqqFE12L lQKmnsfj/3uVXk3cs6oWY+7rj/jLuw5RzVeGJGK+MUH6rjIp55NvxJSJvboYkNxv53 mY06geEHGf4Nw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1; t=1773419704; x=1773680204; i=thierry.escande@vates.tech; bh=R5584u5biB3YH5gAUKEPnNqwevOZ2xVZukEW5ifg0cU=; h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID: Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date: Subject:From; b=wzVwF4Kn0wqWWPxDk4RbPZB5FJ9YfNjPsIDIxv8xSXqqtOhv8STPnZes+IhMa0W3p I4baaUD7usvgCeooAE90QKR5luoUiZVHRPOjUaLTyGiKTV/GJVJErBIxg2fEiU5qCN VTmlr1KFvJIS+xLMAA632t09nYEsFPg0OpdR1PpjQNnBlD3PdkNhQLyXBcQbXDcrYr kcfeuGmrHxgmI06gVePzooylPkxuNfX3bQMYbKHUp5bxbEC53AuTyHX5bvc12w62Qv kAtKGsK1MeQXx0VtUUAaXDlAEnMrWyR7a2ek+wYkNXEF8UwWu5O7aK88VwB7WtNX8A gUTVu/DULUS5A== From: "Thierry Escande" Subject: =?utf-8?Q?[PATCH=2012/17]=20libxl:=20Q35=20support=20(new=20option=20device=5Fmodel=5Fmachine)?= X-Mailer: git-send-email 2.51.0 X-Bm-Disclaimer: Yes X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1773419703641 To: xen-devel@lists.xenproject.org Cc: "Thierry Escande" , "Anthony PERARD" , "Juergen Gross" , "Alexey Gerasimenko" Message-Id: <20260313163455.790692-13-thierry.escande@vates.tech> In-Reply-To: <20260313163455.790692-1-thierry.escande@vates.tech> References: <20260313163455.790692-1-thierry.escande@vates.tech> X-Native-Encoded: 1 X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.fdb286a6cc10436981f303e25614d07d?= X-Mandrill-User: md_30504962 Feedback-ID: 30504962:30504962.20260313:md Date: Fri, 13 Mar 2026 16:35:04 +0000 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @mandrillapp.com) (identity thierry.escande@vates.tech) X-ZM-MESSAGEID: 1773419876919158501 Content-Type: text/plain; charset="utf-8" Provide a new domain config option to select the emulated machine type, device_model_machine. It has following possible values: - "i440" - i440 emulation (default) - "q35" - emulate a Q35 machine. By default, the storage interface is AHCI. Note that omitting device_model_machine parameter means i440 system by default, so the default behavior doesn't change for existing domain config files. Setting device_model_machine to "q35" sends '-machine q35,accel=3Dxen' argument to QEMU. Unlike i440, there is no separated machine type to enable/disable Xen platform device, it is controlled via a machine property only. See 'libxl: Add xen-platform device for Q35 machine' patch for a detailed description. Signed-off-by: Alexey Gerasimenko Signed-off-by: Thierry Escande --- tools/libs/light/libxl_dm.c | 16 ++++++++++------ tools/libs/light/libxl_types.idl | 7 +++++++ tools/xl/xl_parse.c | 14 ++++++++++++++ 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c index 511ec76a65..36f2813cde 100644 --- a/tools/libs/light/libxl_dm.c +++ b/tools/libs/light/libxl_dm.c @@ -1562,13 +1562,17 @@ static int libxl__build_device_model_args_new(libxl= __gc *gc, flexarray_append(dm_args, b_info->extra_pv[i]); break; case LIBXL_DOMAIN_TYPE_HVM: - if (!libxl_defbool_val(b_info->u.hvm.xen_platform_pci)) { - /* Switching here to the machine "pc" which does not add - * the xen-platform device instead of the default "xenfv" mach= ine. - */ - machinearg =3D libxl__strdup(gc, "pc,accel=3Dxen,suppress-vmde= sc=3Don"); + if (b_info->device_model_machine =3D=3D LIBXL_DEVICE_MODEL_MACHINE= _Q35) { + machinearg =3D libxl__sprintf(gc, "q35,accel=3Dxen"); } else { - machinearg =3D libxl__strdup(gc, "xenfv,suppress-vmdesc=3Don"); + if (!libxl_defbool_val(b_info->u.hvm.xen_platform_pci)) { + /* Switching here to the machine "pc" which does not add + * the xen-platform device instead of the default "xenfv" = machine. + */ + machinearg =3D libxl__strdup(gc, "pc,accel=3Dxen,suppress-= vmdesc=3Don"); + } else { + machinearg =3D libxl__strdup(gc, "xenfv,suppress-vmdesc=3D= on"); + } } if (b_info->u.hvm.mmio_hole_memkb) { uint64_t max_ram_below_4g =3D (1ULL << 32) - diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_type= s.idl index d64a573ff3..f9cd881b66 100644 --- a/tools/libs/light/libxl_types.idl +++ b/tools/libs/light/libxl_types.idl @@ -109,6 +109,12 @@ libxl_device_model_version =3D Enumeration("device_mod= el_version", [ (2, "QEMU_XEN"), # Upstream based qemu-xen device model ]) =20 +libxl_device_model_machine =3D Enumeration("device_model_machine", [ + (0, "UNKNOWN"), + (1, "I440"), + (2, "Q35"), + ]) + libxl_console_type =3D Enumeration("console_type", [ (0, "UNKNOWN"), (1, "SERIAL"), @@ -613,6 +619,7 @@ libxl_domain_build_info =3D Struct("domain_build_info",[ ("device_model_ssidref", uint32), ("device_model_ssid_label", string), ("device_model_user", string), + ("device_model_machine", libxl_device_model_machine), =20 # extra parameters pass directly to qemu, NULL terminated ("extra", libxl_string_list), diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c index 1a2ea8b5d5..a4346d1693 100644 --- a/tools/xl/xl_parse.c +++ b/tools/xl/xl_parse.c @@ -2813,6 +2813,20 @@ skip_usbdev: if (!xlu_cfg_get_long (config, "stubdomain_memory", &l, 0)) b_info->stubdomain_memkb =3D l * 1024; =20 + if (!xlu_cfg_get_string (config, "device_model_machine", &buf, 0)) { + if (!strcmp(buf, "i440")) { + b_info->device_model_machine =3D LIBXL_DEVICE_MODEL_MACHINE_I4= 40; + } else if (!strcmp(buf, "q35")) { + b_info->device_model_machine =3D LIBXL_DEVICE_MODEL_MACHINE_Q3= 5; + } else { + fprintf(stderr, + "Unknown device_model_machine \"%s\" specified\n", buf= ); + exit(1); + } + } else { + b_info->device_model_machine =3D LIBXL_DEVICE_MODEL_MACHINE_UNKNOW= N; + } + #define parse_extra_args(type) \ e =3D xlu_cfg_get_list_as_string_list(config, "device_model_args"#type= , \ &b_info->extra##type, 0); \ --=20 2.51.0 -- Thierry Escande | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech