libxl: create /local/domain/<domid>/error and make guest-writable
PATCH 1/1 libxl: create /local/domain/<domid>/error and make guest-writable
Frontends write error information to these paths which is currently blocked with an EACCES. Typical errors from a Linux 3.x look like:
$ sudo xenstore-ls /local/domain/11/error -p device = "" . . . . . . . . . . . . . . . . . . . . . . . . (n11) vbd = "" . . . . . . . . . . . . . . . . . . . . . . . . . (n11) 5632 = "" . . . . . . . . . . . . . . . . . . . . . . . . (n11) error = "19 xenbus_dev_probe on device/vbd/5632" . . . . (n11)
--- docs/misc/xenstore-paths.markdown | 20 ++++++++++++++++++++ tools/libxl/libxl_create.c | 3 +++ 2 files changed, 23 insertions(+)
docs/misc/xenstore-paths.markdown +20 -0
@@ -217,21 +217,37 @@ for the first PV console. A virtual block device frontend. Described by [xen/include/public/io/blkif.h][BLKIF] +#### ~/error/device/vbd/$DEVID/error = STRING [] + +An error message reported by the virtual block device frontend driver. + #### ~/device/vfb/$DEVID/* [] A virtual framebuffer frontend. Described by [xen/include/public/io/fbif.h][FBIF] +#### ~/error/device/vfb/$DEVID/error = STRING [] + +An error message reported by the virtual framebuffer frontend driver. + #### ~/device/vkbd/$DEVID/* [] A virtual keyboard device frontend. Described by [xen/include/public/io/kbdif.h][KBDIF] +#### ~/error/device/vkbd/$DEVID/error = STRING [] + +An error message reported by the virtual keyboard frontend driver. + #### ~/device/vif/$DEVID/* [] A virtual network device frontend. Described by [xen/include/public/io/netif.h][NETIF] +#### ~/error/device/vif/$DEVID/error = STRING [] + +An error message reported by the virtual network device frontend driver. + #### ~/console/* [] The primary PV console device. Described in [console.txt](console.txt)
@@ -240,6 +256,10 @@ The primary PV console device. Described in [console.txt](console.txt) A secondary PV console device. Described in [console.txt](console.txt) +#### ~/error/device/console/$DEVID/error = STRING [] + +An error message reported by the secondary console device frontend driver. + #### ~/device/serial/$DEVID/* [HVM] An emulated serial device. Described in [console.txt](console.txt)
tools/libxl/libxl_create.c +3 -0
@@ -600,6 +600,9 @@ retry_transaction:libxl__xs_mkdir (gc, t,libxl__sprintf (gc,"%s/data" , dom_path), rwperm,ARRAY_SIZE (rwperm)); +libxl__xs_mkdir (gc, t, +libxl__sprintf (gc,"%s/error" , dom_path), + rwperm,ARRAY_SIZE (rwperm));if (libxl_defbool_val (info->driver_domain)) {/*
Signature · 1 line
1.7.10.4
Quoted 8 lines · David Scott
Frontends write error information to these paths which is currently blocked with an EACCES. Typical errors from a Linux 3.x look like:
$ sudo xenstore-ls /local/domain/11/error -p device = "" . . . . . . . . . . . . . . . . . . . . . . . . (n11) vbd = "" . . . . . . . . . . . . . . . . . . . . . . . . . (n11) 5632 = "" . . . . . . . . . . . . . . . . . . . . . . . . (n11) error = "19 xenbus_dev_probe on device/vbd/5632" . . . . (n11)
I had no idea this existed!
Quoted 3 lines
Signed-off-by David Scott <[email protected]>--- docs/misc/xenstore-paths.markdown | 20 ++++++++++++++++++++
What do you think of a single more generic entry e.g.
#### ~/error/device/$DEVTYPE/$DEVID/error
An error message reported by the virtual device driver associated with ~/device/$DEVTYPE/$DEVID/* (see above)
tools/libxl/libxl_create.c retry_transaction: · line 605
Quoted 11 lines
tools/libxl/libxl_create.c +3
-0@@ -600,6 +600,9 @@ retry_transaction:libxl__xs_mkdir (gc, t,libxl__sprintf (gc,"%s/data" , dom_path), rwperm,ARRAY_SIZE (rwperm)); +libxl__xs_mkdir (gc, t, +libxl__sprintf (gc,"%s/error" , dom_path), + rwperm,ARRAY_SIZE (rwperm));
Looks to be trivially correct to me.
It's a shame to be opening up yet another area where the guest is free to do whatever, but I expect the patch to create each of the specific device paths as we add the device would be somewhat larger.
Ian.