[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 4/6] xen_pvdev: Do not assume Dom0 when creating a directory


  • To: "qemu-devel@xxxxxxxxxx" <qemu-devel@xxxxxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Tue, 21 Nov 2023 22:10:28 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8+d1SEM81t/9S27BacM21vX5GsG+JjE3MpWm4AA9xKg=; b=oZ8DOJx3Vvp8MG46/jrzRmCBKzeq8v5YxpsPsGpG6v4ygrz4GhviapdO/fuvfVTg+pBE2C9JpQf+hYCnYdf+raJ+rjkic+Cvj+YKu5K7yHFLGpqNp2uW1KvWSdw5lbvPRVHRcjP+qr4ZNIHxB/XROA7LVRJ9MVJ629R1NV8Hz1lIpU86P3m0VStqQRa308i8nbJkkfBCWeROJzqHNFovzHJ1naVdHRLcGe6DoTOxPwgT2cVYw56WWec5Vzemu4/BNSbrjfc7h2ZFib7r4742b6QN56JQErIqH4/xw3jtin4sczBfTYMiLSBGmwkP4aArDOiblYVIbM1QPTxjCtCblw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e/nCgCGfDFB+pyl2Msj2sfxyVSL0n32Dm8DxFyF2p0ObjzcPj8Lg6v5aWlUuyq5VT8fVd4UswncalgIrzw92R/7uUs4lcZpFmYcds+uppvGqW/KWmUWg8CJqV6ecCm4+WQhlSbLMU05AabCV/ztQjxcYk6xHr90XV7JJks+zHsTC4ptspemH2CFx5DAD4WvyZ8lPVbeYAn+WL3UXUv5sIWTX9cGCeqEgs98dxeYf0GPazrvuzzU5XnxP61oyiSb8DbhDG9tXzMVfOj1xj63bboAc9WydcqRRy/j5bqO4eoFP38Gme2fHiVOk87qrRwbddW5YNYi+lw0NnBbO3Swp4g==
  • Cc: David Woodhouse <dwmw@xxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, "open list:X86 Xen CPUs" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 21 Nov 2023 22:10:45 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHaHMeIsCU+MAEGAkSnPoa9ThBNzw==
  • Thread-topic: [PATCH v2 4/6] xen_pvdev: Do not assume Dom0 when creating a directory

From: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>

Instead of forcing the owner to domid 0, use XS_PRESERVE_OWNER to
inherit the owner of the directory.

Note that for other than Dom0 domain (non toolstack domain) the
"driver_domain" property should be set in domain config file for the
toolstack to create required directories in advance.

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>
---
 hw/xen/xen_pvdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
index c5ad71e8dc..42bdd4f6c8 100644
--- a/hw/xen/xen_pvdev.c
+++ b/hw/xen/xen_pvdev.c
@@ -60,7 +60,8 @@ void xen_config_cleanup(void)
 
 int xenstore_mkdir(char *path, int p)
 {
-    if (!qemu_xen_xs_create(xenstore, 0, 0, xen_domid, p, path)) {
+    if (!qemu_xen_xs_create(xenstore, 0, XS_PRESERVE_OWNER,
+                            xen_domid, p, path)) {
         xen_pv_printf(NULL, 0, "xs_mkdir %s: failed\n", path);
         return -1;
     }
-- 
2.42.0



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.