]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
libxl: create control/sysrq xenstore node
authorVitaly Kuznetsov <vkuznets@redhat.com>
Tue, 4 Sep 2018 11:39:29 +0000 (13:39 +0200)
committerWei Liu <wei.liu2@citrix.com>
Wed, 5 Sep 2018 10:21:25 +0000 (11:21 +0100)
'xl sysrq' command doesn't work with modern Linux guests with the following
message in guest's log:

 xen:manage: sysrq_handler: Error -13 writing sysrq in control/sysrq

xenstore trace confirms:

 IN 0x24bd9a0 20180904 04:36:32 WRITE (control/sysrq )
 OUT 0x24bd9a0 20180904 04:36:32 ERROR (EACCES )

The problem seems to be in the fact that we don't pre-create control/sysrq
xenstore node and libxl_send_sysrq() doing libxl__xs_printf() creates it as
read-only. As we want to allow guests to clean 'control/sysrq' after the
requested action is performed, we need to make this node writable.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libxl/libxl_create.c

index 60676304e9b524e0bd498a55757f710b1e6f6b1e..dcfde7787e2c39c66480978f95f4abb66971b6f8 100644 (file)
@@ -695,6 +695,9 @@ retry_transaction:
                         GCSPRINTF("%s/control/feature-s4", dom_path),
                         rwperm, ARRAY_SIZE(rwperm));
     }
+    libxl__xs_mknod(gc, t,
+                    GCSPRINTF("%s/control/sysrq", dom_path),
+                    rwperm, ARRAY_SIZE(rwperm));
     libxl__xs_mknod(gc, t,
                     GCSPRINTF("%s/device/suspend/event-channel", dom_path),
                     rwperm, ARRAY_SIZE(rwperm));