From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C2257C61D97 for ; Fri, 24 Nov 2023 12:57:13 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.640671.999220 (Exim 4.92) (envelope-from ) id 1r6Vjo-00054r-Pt; Fri, 24 Nov 2023 12:56:52 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 640671.999220; Fri, 24 Nov 2023 12:56:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r6Vjo-00054k-NO; Fri, 24 Nov 2023 12:56:52 +0000 Received: by outflank-mailman (input) for mailman id 640671; Fri, 24 Nov 2023 12:56:51 +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 1r6Vjn-00054e-M8 for xen-devel@lists.xenproject.org; Fri, 24 Nov 2023 12:56:51 +0000 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [2a00:1450:4864:20::231]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id ee668cc5-8ac8-11ee-9b0e-b553b5be7939; Fri, 24 Nov 2023 13:56:49 +0100 (CET) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2c503dbe50dso22819211fa.1 for ; Fri, 24 Nov 2023 04:56:49 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id m18-20020a05600c3b1200b00405959469afsm5051474wms.3.2023.11.24.04.56.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 04:56:48 -0800 (PST) Received: from draig (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 11B775F7AA; Fri, 24 Nov 2023 12:56:48 +0000 (GMT) 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: ee668cc5-8ac8-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700830609; x=1701435409; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rYh9ttpZExkVPVkQ28/dpWEwBabZM3xCVfwqKkfGpoE=; b=l9MzqNug9v+DO7QGYZ0DjJ/HUmpNeotbH3vl+vtva3Gkkc667enZczhRLENKXPw1li U1nxBnWfOALNo25yOj98mBvom6pbUORTD63oKi6iICTsMmKihlmNoL1jlONAq1Cj3G13 yieojaBNRU9O/MAFgx5VIbLkGwK2QR21KExmU/fJrteRTLbSGuBjlf6uloWIXrvhKcZy 8e1oWB9keNVOM+guD9HdYWJ9mILyzofZsKnYeODcmAa6lJSgKeBl9rbLTO2S19y5Fpud 5AaI3Ri0rrUstr5wJctSBXaGDySdzWTQOc1g1lNPmOkV+FC0rJLGm6bF92En4scba3qU HGrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700830609; x=1701435409; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=rYh9ttpZExkVPVkQ28/dpWEwBabZM3xCVfwqKkfGpoE=; b=fJunPX5+8GtKuJdd4AkiO7Tf0qkMsCwf5NTDmMW5JsgbfNsBQQmWJMOq7zPwVNFZdB cxQj9vr+V1qQAAWXgh1drBJAE2wMDyKp+x/X684D/lJ62hBuCfLgXEGiomqKLbZ4NbWy HuS+7YxSv24/zOnI+LaT4vKNKhaq+O+xaFdk7Gapbzfx+ufRwmLD3VrBZDduD2staXzu oS/ZHmgiM20zGX9k1NdD+7mav1f2PWjnSt20NB7UMIAzymLLWqoEW7Rm8H2humi6guK3 U2WS16zYPA0VcPVettxAAl4J+x0ZRyGdzlrRNhrZ/T8cvke4aEzE2QI+xB2WXH+mGKxq 4npw== X-Gm-Message-State: AOJu0Yyn7vxRwIzA9CBBnVr0zipC7cEceSYO1lWjGRSKsVV69Z0KiAoT L1oRnqG88+/MEXUWgLBZGCPYsA== X-Google-Smtp-Source: AGHT+IEW4oaIEl4UKl/xCLKHHE+a9oAX7cxDG0m2YWIUUGXEoUOvuMm1aEI6exCQqWi9qOF1bBvvNg== X-Received: by 2002:a05:6512:3a85:b0:50b:a6c7:e8b0 with SMTP id q5-20020a0565123a8500b0050ba6c7e8b0mr212264lfu.26.1700830608786; Fri, 24 Nov 2023 04:56:48 -0800 (PST) From: =?utf-8?Q?Alex_Benn=C3=A9e?= To: Volodymyr Babchuk Cc: David Woodhouse , Stefano Stabellini , "paul@xen.org" , "qemu-devel@nongnu.org" , Julien Grall , Oleksandr Tyshchenko , Anthony Perard , "open list:X86 Xen CPUs" Subject: Re: [PATCH v2 4/6] xen_pvdev: Do not assume Dom0 when creating a directory In-Reply-To: <87cyw1z61i.fsf@epam.com> (Volodymyr Babchuk's message of "Thu, 23 Nov 2023 00:07:05 +0000") References: <20231121221023.419901-1-volodymyr_babchuk@epam.com> <20231121221023.419901-5-volodymyr_babchuk@epam.com> <87r0khz6zj.fsf@epam.com> <87cyw1z61i.fsf@epam.com> User-Agent: mu4e 1.11.25; emacs 29.1 Date: Fri, 24 Nov 2023 12:56:48 +0000 Message-ID: <87wmu7b97z.fsf@draig.linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Volodymyr Babchuk writes: > Hi, > > Volodymyr Babchuk writes: > >> Hi Stefano, >> >> Stefano Stabellini writes: >> >>> On Wed, 22 Nov 2023, David Woodhouse wrote: >>>> On Wed, 2023-11-22 at 15:09 -0800, Stefano Stabellini wrote: >>>> > On Wed, 22 Nov 2023, David Woodhouse wrote: >>>> > > On Wed, 2023-11-22 at 14:29 -0800, Stefano Stabellini wrote: >>>> > > > On Wed, 22 Nov 2023, Paul Durrant wrote: >>>> > > > > On 21/11/2023 22:10, Volodymyr Babchuk wrote: >>>> > > > > > From: Oleksandr Tyshchenko >>>> The -xen-domid argument on the QEMU command line today is the *guest* >>>> domain ID, not the domain ID in which QEMU itself is running. >>>>=20 >>>> Or were you thinking of something different? >>> >>> Ops, you are right and I understand your comment better now. The backend >>> domid is not on the command line but it should be discoverable (on >>> xenstore if I remember right). >> >> Yes, it is just "~/domid". I'll add a function that reads it. > > Just a quick question to QEMU folks: is it better to add a global > variable where we will store own Domain ID or it will be okay to read > domid from Xenstore every time we need it? > > If global variable variant is better, what is proffered place to define > this variable? system/globals.c ? Hmm maybe, I see Xen already has some but the comment: "Global variables that (mostly) should not exist" I think it to dissuade the file growing more than it should. I think generally the best pattern to use if a global can't be avoided is to have a "static global" in the main .c file for the module and then provide a helper access function for other files to read it. That also makes re-factoring easier if things like locking need to be added down the line. We still do have a few true global variables which need "extern" declarations in the headers but if we can avoid adding more that would be good. Of course ideally this sort of data would be wrapped up in QOM structures but I can see the argument for the host domain ID. --=20 Alex Benn=C3=A9e Virtualisation Tech Lead @ Linaro