From nobody Tue Apr 16 15:36:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1558112841; cv=none; d=zoho.com; s=zohoarc; b=hUzGNkHKzKN3p9b31WFMcpAbUE3Hyd8uovrtGrprJQTOoNmrMTTvpSkXgqezkt0f/I7mW6FY4rrNGAmGXO0CMuiwfcTqYKZu68hJ8JNdgqKYdhdrp+wthKnte4CES2jb8COSgnqowIJ6Sn5ybYxuD3CDJsJJK1+FC+Xct/jLvFk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558112841; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=GK0mTkdnR7ec412ECYeRzPck+y6BTx8j4WVLkWnq4Pw=; b=S78d/30aUxtdMGogGIrBq35q5tLlqrrqRaKgGAHE5Em5W3az1jQwX1iUN1k8DGtA6kHKaJmRZO3mE9ldmrY+nLTpL4QeH6W4mYLPpKIBU6wcxMV0mU9PmrmH2S1LCrIobZeqSOS97ALRoB/eLjX+KFlsP9v0rQUfGQDCvkPyBVo= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 155811284174452.76433812117011; Fri, 17 May 2019 10:07:21 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hRgIz-00078a-9n; Fri, 17 May 2019 17:06:01 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hRgIx-00078V-S4 for xen-devel@lists.xenproject.org; Fri, 17 May 2019 17:05:59 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 0a03959f-78c6-11e9-8980-bc764e045a96; Fri, 17 May 2019 17:05:58 +0000 (UTC) X-Inumbo-ID: 0a03959f-78c6-11e9-8980-bc764e045a96 Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=wei.liu2@citrix.com; spf=SoftFail smtp.mailfrom=wei.liu2@citrix.com; spf=None smtp.helo=postmaster@MIAPEX02MSOL01.citrite.net Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of wei.liu2@citrix.com) identity=pra; client-ip=23.29.105.83; receiver=esa1.hc3370-68.iphmx.com; envelope-from="wei.liu2@citrix.com"; x-sender="wei.liu2@citrix.com"; x-conformance=sidf_compatible Received-SPF: SoftFail (esa1.hc3370-68.iphmx.com: domain of wei.liu2@citrix.com is inclined to not designate 23.29.105.83 as permitted sender) identity=mailfrom; client-ip=23.29.105.83; receiver=esa1.hc3370-68.iphmx.com; envelope-from="wei.liu2@citrix.com"; x-sender="wei.liu2@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 include:spf.citrix.com include:spf2.citrix.com include:ironport.citrix.com exists:%{i}._spf.mta.salesforce.com ~all" Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@MIAPEX02MSOL01.citrite.net) identity=helo; client-ip=23.29.105.83; receiver=esa1.hc3370-68.iphmx.com; envelope-from="wei.liu2@citrix.com"; x-sender="postmaster@MIAPEX02MSOL01.citrite.net"; x-conformance=sidf_compatible IronPort-SDR: TER6KUlPmSRG6jjY3rcWCT3l8v+WLx8xCYm/2dElmh20QkwzKX4/l/Etp7qF0dbL7ah57aJHAR kA1kvkrSlbdIMnKJa1IYQm5DTDSboj8hffo9ur8IHNiE/f1Q9xb6DrWBikiFOypPBAtY6zGk0P txjfnu2pkUCaRl/NQpwOj1YIn0z8whcy2Vauvm6n9MoDs/ALLBrszgLf0N98rA5CJxqHF4HRG3 JzSgDcZxqxRKo0jZXi5mVj3tXxkqODs3BBVlX7sF66DC2gH5M8btvS3eNb5yjQG62n5JP9LLJi PuY= X-SBRS: 2.7 X-MesageID: 581591 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 23.29.105.83 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.60,480,1549947600"; d="scan'208";a="581591" From: Wei Liu To: Xen-devel Date: Fri, 17 May 2019 18:05:55 +0100 Message-ID: <20190517170555.17423-1-wei.liu2@citrix.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] libxl: fix libxl_domain_need_memory after 899433f149d X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Ian Jackson , Olaf Hering , Wei Liu , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" After 899433f149d libxl needs to know the content of d_config to determine which QEMU is used. The code is changed such that libxl__domain_set_device_model needs to be called before libxl__domain_build_info_setdefault. This is fine for libxl code, but it is problematic for libxl_domain_need_memory, which is the only public API that takes a build_info. To avoid break its users, provide a compatibility setting inside that function. Signed-off-by: Wei Liu Acked-by: Ian Jackson Reviewed-by: Roger Pau Monn=C3=A9 --- Cc: Ian Jackson Cc: Olaf Hering Cc: Roger Pau Monn=C3=A9 Cc: Juergen Gross Please test. --- tools/libxl/libxl_mem.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tools/libxl/libxl_mem.c b/tools/libxl/libxl_mem.c index 448a2af8fd..fe1f9c2ff8 100644 --- a/tools/libxl/libxl_mem.c +++ b/tools/libxl/libxl_mem.c @@ -457,6 +457,24 @@ int libxl_domain_need_memory(libxl_ctx *ctx, libxl_domain_build_info_init(b_info); libxl_domain_build_info_copy(ctx, b_info, b_info_in); =20 + /* + * It has become a requirement that to figure out which QEMU to + * use, libxl will need to peek d_config's content. The code has + * been changed such that one will need to call + * libxl__domain_set_device_model before calling + * libxl__domain_build_info_setdefault inside libxl. + * + * This (problematic) public API is the only one which takes a + * b_info, imposing the same requirement on the users of this + * public API will break them. + * + * Provide a compatibility setting for this function. The + * calculation doesn't really care which QEMU is set here, so we + * go with the upstream default. + */ + if (!b_info->device_model_version) + b_info->device_model_version =3D LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN; + rc =3D libxl__domain_build_info_setdefault(gc, b_info); if (rc) goto out; =20 --=20 2.20.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel