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

[PATCH v1 4/7] xen_pvdev: Do not assume Dom0 when creating a directrory


  • To: "qemu-devel@xxxxxxxxxx" <qemu-devel@xxxxxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Fri, 10 Nov 2023 20:42:23 +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=gvW436DHGoKHwxC73icUcWiaYr0+vXQ+sVSK+d7PBeg=; b=NrMHJiUYnSClmG816XDXYmI+1IUU4zufT0z6svvjtdu1QeBk62D1ii5RTukXffD2d71xf4fflD0v8oXrMHlv2yAPHt9uTlZa5K6NxrYUcJq0QUSk+cEw7SFkccb1og6dxPStbiZklI0Hay2jCX9/legUw4We41hUni8yUZ/ylAnS6dp8IlkAm+rMovF3xg5Wi3cY/NNAsONBpZAmqi2pQwTncLep+/+1Jo4nbYAcJ3OkUKFgPHNC3TRFKxB8jlrto2KQldF2rWR56hIYWIeBPN1lVhEC915R5J6S1u8Xo3tdo8+JLpQOBO6lNoVyYwgOcLCIWhIxcaDHMlNAimXsrg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PLzbX+PFHfdrpRDvIHh/f7PsfqIacoGaQkRrO8MspJ5r/z10EryU2zR+5nyrvcHJQCBsz0/r3gbmLGZUZ7yUq97zUChu/gqEbyZmHbOQAONo3RsEW7Gsd0EPgbQQH2eU7rGXyCN9zFge89C4yGwxKVUVRf7unl4j3e8xc1gEaLWWJ+UEJUNIAE5E5j5Yi/ddgbi0iVjudVo4cWDrpGpJ79wsw0f1ulc9QSbZSFOCKXhEOzNhrO3TPOW/QRaWzRbS0z1dzEW5J81lJy16206Lsv2LuKBzu3fm5nQjFpKsrkkPICvAi8cOfjB4omcw39tv2BawW/FqnSF8gtOqE3CtOw==
  • Cc: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, "open list:X86 Xen CPUs" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 10 Nov 2023 20:42:47 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHaFBZoMLHgqbm5ZUeTIEOOIKOHAA==
  • Thread-topic: [PATCH v1 4/7] xen_pvdev: Do not assume Dom0 when creating a directrory

From: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>

Instead of forcing the owner to domid 0, use XS_PRESERVE_OWNER to save
the previous 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®.