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

[Xen-devel] [PATCH RFC/for-4.2?] libxl: Support backend domain ID for disks



Allow specification of backend domains for disks, either in the config
file or via xl block-attach.

A version of this patch was submitted in October 2011 but was not
suitable at the time because libxl did not support the "script=" option
for disks in libxl. Now that this option exists, it is possible to
specify a backend domain without needing to duplicate the device tree of
domain providing the disk in the domain using libxl; just specify
script=/bin/true (or any more useful script) to prevent the block script
from running in the domain using libxl.

In order to support named backend domains like network-attach, the
prototype of xlu_disk_parse in libxlutil.h needs a libxl_ctx. Without
this parameter, it would only be only possible to support numeric domain
IDs in the block device specification.

Signed-off-by: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>

---

This patch does not include the changes to tools/libxl/libxlu_disk_l.c
and tools/libxl/libxlu_disk_l.h because the diffs contain unrelated
changes due to different generator versions.

 tools/libxl/libxlu_disk.c   |   3 +-
 tools/libxl/libxlu_disk_i.h |   3 +-
 tools/libxl/libxlu_disk_l.c | 581 ++++++++++++++++++++++----------------------
 tools/libxl/libxlu_disk_l.h |  24 +-
 tools/libxl/libxlu_disk_l.l |   8 +
 tools/libxl/libxlutil.h     |   2 +-
 tools/libxl/xl_cmdimpl.c    |   6 +-
 7 files changed, 319 insertions(+), 308 deletions(-)

diff --git a/tools/libxl/libxlu_disk.c b/tools/libxl/libxlu_disk.c
index 18fe386..1e6caca 100644
--- a/tools/libxl/libxlu_disk.c
+++ b/tools/libxl/libxlu_disk.c
@@ -48,7 +48,7 @@ static void dpc_dispose(DiskParseContext *dpc) {
 
 int xlu_disk_parse(XLU_Config *cfg,
                    int nspecs, const char *const *specs,
-                   libxl_device_disk *disk) {
+                   libxl_device_disk *disk, libxl_ctx *ctx) {
     DiskParseContext dpc;
     int i, e;
 
@@ -56,6 +56,7 @@ int xlu_disk_parse(XLU_Config *cfg,
     dpc.cfg = cfg;
     dpc.scanner = 0;
     dpc.disk = disk;
+    dpc.ctx = ctx;
 
     disk->readwrite = 1;
 
diff --git a/tools/libxl/libxlu_disk_i.h b/tools/libxl/libxlu_disk_i.h
index 4fccd4a..c220bcf 100644
--- a/tools/libxl/libxlu_disk_i.h
+++ b/tools/libxl/libxlu_disk_i.h
@@ -2,7 +2,7 @@
 #define LIBXLU_DISK_I_H
 
 #include "libxlu_internal.h"
-
+#include "libxl_utils.h"
 
 typedef struct {
     XLU_Config *cfg;
@@ -12,6 +12,7 @@ typedef struct {
     libxl_device_disk *disk;
     int access_set, had_depr_prefix;
     const char *spec;
+    libxl_ctx *ctx;
 } DiskParseContext;
 
 void xlu__disk_err(DiskParseContext *dpc, const char *erroneous,
diff --git a/tools/libxl/libxlu_disk_l.c b/tools/libxl/libxlu_disk_l.c
index 4c68034..4e17f7c 100644
--- a/tools/libxl/libxlu_disk_l.c
+++ b/tools/libxl/libxlu_disk_l.c
@@ -58,6 +58,7 @@ typedef int flex_int32_t;
 typedef unsigned char flex_uint8_t; 
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
 
 /* Limits of integral types. */
 #ifndef INT8_MIN
@@ -88,8 +89,6 @@ typedef unsigned int flex_uint32_t;
 #define UINT32_MAX             (4294967295U)
 #endif
 
-#endif /* ! C99 */
-
 #endif /* ! FLEXINT_H */
 
 #ifdef __cplusplus
@@ -163,15 +162,7 @@ typedef void* yyscan_t;
 
 /* Size of default input buffer. */
 #ifndef YY_BUF_SIZE
-#ifdef __ia64__
-/* On IA-64, the buffer size is 16k, not 8k.
- * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
- * Ditto for the __ia64__ case accordingly.
- */
-#define YY_BUF_SIZE 32768
-#else
 #define YY_BUF_SIZE 16384
-#endif /* __ia64__ */
 #endif
 
 /* The state buf must be large enough to hold one state per character in the 
main buffer.
@@ -361,8 +352,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t 
yyscanner );
        *yy_cp = '\0'; \
        yyg->yy_c_buf_p = yy_cp;
 
-#define YY_NUM_RULES 25
-#define YY_END_OF_BUFFER 26
+#define YY_NUM_RULES 26
+#define YY_END_OF_BUFFER 27
 /* This struct is not used in this scanner,
    but its presence is necessary. */
 struct yy_trans_info
@@ -370,60 +361,61 @@ struct yy_trans_info
        flex_int32_t yy_verify;
        flex_int32_t yy_nxt;
        };
-static yyconst flex_int16_t yy_acclist[447] =
+static yyconst flex_int16_t yy_acclist[460] =
     {   0,
-       24,   24,   26,   22,   23,   25, 8193,   22,   23,   25,
-    16385, 8193,   22,   25,16385,   22,   23,   25,   23,   25,
-       22,   23,   25,   22,   23,   25,   22,   23,   25,   22,
-       23,   25,   22,   23,   25,   22,   23,   25,   22,   23,
-       25,   22,   23,   25,   22,   23,   25,   22,   23,   25,
-       22,   23,   25,   22,   23,   25,   22,   23,   25,   22,
-       23,   25,   22,   23,   25,   24,   25,   25,   22,   22,
-     8193,   22, 8193,   22,16385, 8193,   22, 8193,   22,   22,
-     8213,   22,16405,   22,   22,   22,   22,   22,   22,   22,
-       22,   22,   22,   22,   22,   22,   22,   22,   22,   22,
-
-       22,   22,   24, 8193,   22, 8193,   22, 8193, 8213,   22,
-     8213,   22, 8213,   12,   22,   22,   22,   22,   22,   22,
-       22,   22,   22,   22,   22,   22,   22,   22,   22,   22,
-       22,   22, 8213,   22, 8213,   22, 8213,   12,   22,   17,
-     8213,   22,16405,   22,   22,   22,   22,   22,   22,   22,
-     8206, 8213,   22,16398,16405,   20, 8213,   22,16405,   22,
-     8205, 8213,   22,16397,16405,   22,   22, 8208, 8213,   22,
-    16400,16405,   22,   22,   22,   22,   17, 8213,   22,   17,
-     8213,   22,   17,   22,   17, 8213,   22,    3,   22,   22,
-       19, 8213,   22,16405,   22,   22, 8206, 8213,   22, 8206,
-
-     8213,   22, 8206,   22, 8206, 8213,   20, 8213,   22,   20,
-     8213,   22,   20,   22,   20, 8213, 8205, 8213,   22, 8205,
-     8213,   22, 8205,   22, 8205, 8213,   22, 8208, 8213,   22,
-     8208, 8213,   22, 8208,   22, 8208, 8213,   22,   22,    9,
-       22,   17, 8213,   22,   17, 8213,   22,   17, 8213,   17,
-       22,   17,   22,    3,   22,   22,   19, 8213,   22,   19,
-     8213,   22,   19,   22,   19, 8213,   22,   18, 8213,   22,
-    16405, 8206, 8213,   22, 8206, 8213,   22, 8206, 8213, 8206,
-       22, 8206,   20, 8213,   22,   20, 8213,   22,   20, 8213,
-       20,   22,   20, 8205, 8213,   22, 8205, 8213,   22, 8205,
-
-     8213, 8205,   22, 8205,   22, 8208, 8213,   22, 8208, 8213,
-       22, 8208, 8213, 8208,   22, 8208,   22,   22,    9,   12,
-        9,    7,   22,   22,   19, 8213,   22,   19, 8213,   22,
-       19, 8213,   19,   22,   19,    2,   18, 8213,   22,   18,
-     8213,   22,   18,   22,   18, 8213,   10,   22,   11,    9,
-        9,   12,    7,   12,    7,   22,    6,    2,   12,    2,
-       18, 8213,   22,   18, 8213,   22,   18, 8213,   18,   22,
-       18,   10,   12,   10,   15, 8213,   22,16405,   11,   12,
-       11,    7,    7,   12,   22,    6,   12,    6,    6,   12,
-        6,   12,    2,    2,   12,   10,   10,   12,   15, 8213,
-
-       22,   15, 8213,   22,   15,   22,   15, 8213,   11,   12,
-       22,    6,    6,   12,    6,    6,   15, 8213,   22,   15,
-     8213,   22,   15, 8213,   15,   22,   15,   22,    6,    6,
-        8,    6,    5,    6,    8,   12,    8,    4,    6,    5,
-        6,    8,    8,   12,    4,    6
+       25,   25,   27,   23,   24,   26, 8193,   23,   24,   26,
+    16385, 8193,   23,   26,16385,   23,   24,   26,   24,   26,
+       23,   24,   26,   23,   24,   26,   23,   24,   26,   23,
+       24,   26,   23,   24,   26,   23,   24,   26,   23,   24,
+       26,   23,   24,   26,   23,   24,   26,   23,   24,   26,
+       23,   24,   26,   23,   24,   26,   23,   24,   26,   23,
+       24,   26,   23,   24,   26,   25,   26,   26,   23,   23,
+     8193,   23, 8193,   23,16385, 8193,   23, 8193,   23,   23,
+     8214,   23,16406,   23,   23,   23,   23,   23,   23,   23,
+       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
+
+       23,   23,   25, 8193,   23, 8193,   23, 8193, 8214,   23,
+     8214,   23, 8214,   13,   23,   23,   23,   23,   23,   23,
+       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
+       23,   23, 8214,   23, 8214,   23, 8214,   13,   23,   18,
+     8214,   23,16406,   23,   23,   23,   23,   23,   23,   23,
+     8207, 8214,   23,16399,16406,   21, 8214,   23,16406,   23,
+     8206, 8214,   23,16398,16406,   23,   23, 8209, 8214,   23,
+    16401,16406,   23,   23,   23,   23,   18, 8214,   23,   18,
+     8214,   23,   18,   23,   18, 8214,   23,    3,   23,   23,
+       20, 8214,   23,16406,   23,   23, 8207, 8214,   23, 8207,
+
+     8214,   23, 8207,   23, 8207, 8214,   21, 8214,   23,   21,
+     8214,   23,   21,   23,   21, 8214, 8206, 8214,   23, 8206,
+     8214,   23, 8206,   23, 8206, 8214,   23, 8209, 8214,   23,
+     8209, 8214,   23, 8209,   23, 8209, 8214,   23,   23,   10,
+       23,   18, 8214,   23,   18, 8214,   23,   18, 8214,   18,
+       23,   18,   23,    3,   23,   23,   20, 8214,   23,   20,
+     8214,   23,   20,   23,   20, 8214,   23,   19, 8214,   23,
+    16406, 8207, 8214,   23, 8207, 8214,   23, 8207, 8214, 8207,
+       23, 8207,   21, 8214,   23,   21, 8214,   23,   21, 8214,
+       21,   23,   21, 8206, 8214,   23, 8206, 8214,   23, 8206,
+
+     8214, 8206,   23, 8206,   23, 8209, 8214,   23, 8209, 8214,
+       23, 8209, 8214, 8209,   23, 8209,   23,   23,   10,   13,
+       10,    7,   23,   23,   20, 8214,   23,   20, 8214,   23,
+       20, 8214,   20,   23,   20,    2,   19, 8214,   23,   19,
+     8214,   23,   19,   23,   19, 8214,   11,   23,   12,   10,
+       10,   13,    7,   13,    7,   23,   23,    6,    2,   13,
+        2,   19, 8214,   23,   19, 8214,   23,   19, 8214,   19,
+       23,   19,   11,   13,   11,   16, 8214,   23,16406,   12,
+       13,   12,    7,    7,   13,   23,   23,    6,   13,    6,
+        6,   13,    6,   13,    2,    2,   13,   11,   11,   13,
+
+       16, 8214,   23,   16, 8214,   23,   16,   23,   16, 8214,
+       12,   13,   23,   23,    6,    6,   13,    6,    6,   16,
+     8214,   23,   16, 8214,   23,   16, 8214,   16,   23,   16,
+       23,   23,    6,    6,   23,    8,    6,    5,    6,   23,
+        8,   13,    8,    4,    6,    5,    6,    9,    8,    8,
+       13,    4,    6,    9,   13,    9,    9,    9,   13
     } ;
 
-static yyconst flex_int16_t yy_accept[252] =
+static yyconst flex_int16_t yy_accept[263] =
     {   0,
         1,    1,    1,    2,    3,    4,    7,   12,   16,   19,
        21,   24,   27,   30,   33,   36,   39,   42,   45,   48,
@@ -445,14 +437,15 @@ static yyconst flex_int16_t yy_accept[252] =
       293,  294,  297,  300,  302,  304,  305,  306,  309,  312,
       314,  316,  317,  318,  319,  321,  322,  323,  324,  325,
       328,  331,  333,  335,  336,  337,  340,  343,  345,  347,
-      348,  349,  350,  351,  353,  355,  356,  357,  358,  360,
-
-      361,  364,  367,  369,  371,  372,  374,  375,  379,  381,
-      382,  383,  385,  386,  388,  389,  391,  393,  394,  396,
-      397,  399,  402,  405,  407,  409,  411,  412,  413,  415,
-      416,  417,  420,  423,  425,  427,  428,  429,  430,  431,
-      432,  433,  435,  437,  438,  440,  442,  443,  445,  447,
-      447
+      348,  349,  350,  351,  353,  355,  356,  357,  358,  359,
+
+      361,  362,  365,  368,  370,  372,  373,  375,  376,  380,
+      382,  383,  384,  386,  387,  388,  390,  391,  393,  395,
+      396,  398,  399,  401,  404,  407,  409,  411,  413,  414,
+      415,  416,  418,  419,  420,  423,  426,  428,  430,  431,
+      432,  433,  434,  435,  436,  437,  438,  440,  441,  443,
+      444,  446,  448,  449,  450,  452,  454,  456,  457,  458,
+      460,  460
     } ;
 
 static yyconst flex_int32_t yy_ec[256] =
@@ -495,83 +488,85 @@ static yyconst flex_int32_t yy_meta[34] =
         1,    1,    1
     } ;
 
-static yyconst flex_int16_t yy_base[308] =
+static yyconst flex_int16_t yy_base[321] =
     {   0,
-        0,    0,  546,  538,  533,  521,   32,   35,  656,  656,
-       44,   62,   30,   41,   50,   51,  507,   64,   47,   66,
-       67,  499,   68,  487,   72,    0,  656,  465,  656,   87,
-       91,    0,    0,  100,  452,  109,    0,   74,   95,   87,
+        0,    0,  644,  632,  623,  595,   32,   35,  670,  670,
+       44,   62,   30,   41,   50,   51,  577,   64,   47,   66,
+       67,  565,   68,  561,   72,    0,  670,  563,  670,   87,
+       91,    0,    0,  100,  553,  109,    0,   74,   95,   87,
        32,   96,  105,  110,   77,   97,   40,  113,  116,  112,
       118,  120,  121,  122,  123,  125,    0,  137,    0,    0,
-      147,    0,    0,  449,  129,  126,  134,  143,  145,  147,
+      147,    0,    0,  551,  129,  126,  134,  143,  145,  147,
       148,  149,  151,  153,  156,  160,  155,  167,  162,  175,
-      168,  159,  188,    0,    0,  656,  166,  197,  179,  185,
-      176,  200,  435,  186,  193,  216,  225,  205,  234,  221,
+      168,  159,  188,    0,    0,  670,  166,  197,  179,  185,
+      176,  200,  537,  186,  193,  216,  225,  205,  234,  221,
 
       237,  247,  204,  230,  244,  213,  254,    0,  256,    0,
       251,  258,  254,  279,  256,  259,  267,    0,  269,    0,
       286,    0,  288,    0,  290,    0,  297,    0,  267,  299,
-        0,  301,    0,  288,  297,  421,  302,  310,    0,    0,
-        0,    0,  305,  656,  307,  319,    0,  321,    0,  322,
+        0,  301,    0,  288,  297,  535,  302,  310,    0,    0,
+        0,    0,  305,  670,  307,  319,    0,  321,    0,  322,
       332,  335,    0,    0,    0,    0,  339,    0,    0,    0,
         0,  342,    0,    0,    0,    0,  340,  349,    0,    0,
-        0,    0,  337,  345,  420,  656,  419,  346,  350,  358,
-        0,    0,    0,    0,  418,  360,    0,  362,    0,  417,
-      319,  369,  416,  656,  415,  656,  276,  364,  414,  656,
-
-      375,    0,    0,    0,    0,  413,  656,  384,  412,    0,
-      410,  656,  370,  409,  656,  370,  378,  408,  656,  366,
-      656,  394,    0,  396,    0,    0,  380,  316,  656,  377,
-      387,  398,    0,    0,    0,    0,  399,  402,  407,  271,
-      406,  228,  200,  656,  175,  656,   77,  656,  656,  656,
-      428,  432,  435,  439,  443,  447,  451,  455,  459,  463,
-      467,  471,  475,  479,  483,  487,  491,  495,  499,  503,
-      507,  511,  515,  519,  523,  527,  531,  535,  539,  543,
-      547,  551,  555,  559,  563,  567,  571,  575,  579,  583,
-      587,  591,  595,  599,  603,  607,  611,  615,  619,  623,
-
-      627,  631,  635,  639,  643,  647,  651
+        0,    0,  337,  345,  527,  670,  519,  346,  351,  359,
+        0,    0,    0,    0,  511,  361,    0,  363,    0,  499,
+      319,  370,  471,  670,  464,  670,  359,  276,  367,  455,
+
+      670,  373,    0,    0,    0,    0,  447,  670,  383,  429,
+        0,  428,  670,  368,  371,  425,  670,  385,  389,  422,
+      670,  421,  670,  391,    0,  399,    0,    0,  414,  387,
+      419,  670,  395,  400,  402,    0,    0,    0,    0,  399,
+      403,  406,  411,  404,  417,  412,  416,  409,  316,  670,
+      271,  670,  228,  200,  670,  670,  175,  670,   77,  670,
+      670,  434,  438,  441,  445,  449,  453,  457,  461,  465,
+      469,  473,  477,  481,  485,  489,  493,  497,  501,  505,
+      509,  513,  517,  521,  525,  529,  533,  537,  541,  545,
+      549,  553,  557,  561,  565,  569,  573,  577,  581,  585,
+
+      589,  593,  597,  601,  605,  609,  613,  617,  621,  625,
+      629,  633,  637,  641,  645,  649,  653,  657,  661,  665
     } ;
 
-static yyconst flex_int16_t yy_def[308] =
+static yyconst flex_int16_t yy_def[321] =
     {   0,
-      250,    1,  251,  251,  250,  252,  253,  253,  250,  250,
-      254,  254,   12,   12,   12,   12,   12,   12,   12,   12,
-       12,   12,   12,   12,   12,  255,  250,  252,  250,  256,
-      253,  257,  257,  258,   12,  252,  259,   12,   12,   12,
+      261,    1,  262,  262,  261,  263,  264,  264,  261,  261,
+      265,  265,   12,   12,   12,   12,   12,   12,   12,   12,
+       12,   12,   12,   12,   12,  266,  261,  263,  261,  267,
+      264,  268,  268,  269,   12,  263,  270,   12,   12,   12,
        12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
-       12,   12,   12,   12,   12,   12,  255,  256,  257,  257,
-      260,  261,  261,  250,   12,   12,   12,   12,   12,   12,
+       12,   12,   12,   12,   12,   12,  266,  267,  268,  268,
+      271,  272,  272,  261,   12,   12,   12,   12,   12,   12,
        12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
-       12,   12,  260,  261,  261,  250,   12,  262,   12,   12,
-       12,   12,   12,   12,   12,  263,  264,   12,  265,   12,
-
-       12,  266,   12,   12,   12,   12,  267,  268,  262,  268,
-       12,   12,   12,  269,   12,   12,  270,  271,  263,  271,
-      272,  273,  264,  273,  274,  275,  265,  275,   12,  276,
-      277,  266,  277,   12,   12,  278,   12,  267,  268,  268,
-      279,  279,   12,  250,   12,  280,  281,  269,  281,   12,
-      282,  270,  271,  271,  283,  283,  272,  273,  273,  284,
-      284,  274,  275,  275,  285,  285,   12,  276,  277,  277,
-      286,  286,   12,   12,  287,  250,  288,   12,   12,  280,
-      281,  281,  289,  289,  290,  291,  292,  282,  292,  293,
-       12,  294,  287,  250,  295,  250,   12,  296,  297,  250,
-
-      291,  292,  292,  298,  298,  299,  250,  300,  301,  301,
-      295,  250,   12,  302,  250,  302,  302,  297,  250,  299,
-      250,  303,  304,  300,  304,  301,   12,  302,  250,  302,
-      302,  303,  304,  304,  305,  305,   12,  302,  302,  306,
-      302,  302,  307,  250,  302,  250,  307,  250,  250,    0,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-
-      250,  250,  250,  250,  250,  250,  250
+       12,   12,  271,  272,  272,  261,   12,  273,   12,   12,
+       12,   12,   12,   12,   12,  274,  275,   12,  276,   12,
+
+       12,  277,   12,   12,   12,   12,  278,  279,  273,  279,
+       12,   12,   12,  280,   12,   12,  281,  282,  274,  282,
+      283,  284,  275,  284,  285,  286,  276,  286,   12,  287,
+      288,  277,  288,   12,   12,  289,   12,  278,  279,  279,
+      290,  290,   12,  261,   12,  291,  292,  280,  292,   12,
+      293,  281,  282,  282,  294,  294,  283,  284,  284,  295,
+      295,  285,  286,  286,  296,  296,   12,  287,  288,  288,
+      297,  297,   12,   12,  298,  261,  299,   12,   12,  291,
+      292,  292,  300,  300,  301,  302,  303,  293,  303,  304,
+       12,  305,  298,  261,  306,  261,   12,   12,  307,  308,
+
+      261,  302,  303,  303,  309,  309,  310,  261,  311,  312,
+      312,  306,  261,   12,   12,  313,  261,  313,  313,  308,
+      261,  310,  261,  314,  315,  311,  315,  312,   12,   12,
+      313,  261,  313,  313,  314,  315,  315,  316,  316,   12,
+       12,  313,  313,   12,  317,  313,  313,   12,  318,  261,
+      313,  261,  319,  318,  261,  261,  320,  261,  320,  261,
+        0,  261,  261,  261,  261,  261,  261,  261,  261,  261,
+      261,  261,  261,  261,  261,  261,  261,  261,  261,  261,
+      261,  261,  261,  261,  261,  261,  261,  261,  261,  261,
+      261,  261,  261,  261,  261,  261,  261,  261,  261,  261,
+
+      261,  261,  261,  261,  261,  261,  261,  261,  261,  261,
+      261,  261,  261,  261,  261,  261,  261,  261,  261,  261
     } ;
 
-static yyconst flex_int16_t yy_nxt[690] =
+static yyconst flex_int16_t yy_nxt[704] =
     {   0,
         6,    7,    8,    9,    6,    6,    6,    6,   10,   11,
        12,   13,   14,   15,   16,   17,   17,   18,   17,   17,
@@ -581,7 +576,7 @@ static yyconst flex_int16_t yy_nxt[690] =
        35,   36,   37,   73,   42,   38,   35,   49,   68,   35,
        35,   39,   28,   28,   28,   29,   34,   43,   45,   36,
        37,   40,   44,   35,   46,   35,   35,   35,   51,   53,
-      244,   35,   50,   35,   55,   65,   35,   47,   56,   28,
+      258,   35,   50,   35,   55,   65,   35,   47,   56,   28,
        59,   48,   31,   31,   32,   60,   35,   71,   67,   33,
 
        28,   28,   28,   29,   35,   35,   35,   28,   37,   61,
@@ -591,66 +586,69 @@ static yyconst flex_int16_t yy_nxt[690] =
        59,   77,   87,   35,   76,   60,   80,   79,   81,   28,
        84,   78,   35,   89,   35,   85,   35,   35,   35,   75,
        35,   92,   35,   96,   35,   35,   90,   97,   35,   35,
-       93,   35,   94,   91,   99,   35,   35,   35,  249,  100,
+       93,   35,   94,   91,   99,   35,   35,   35,  260,  100,
        95,  101,  102,  104,   35,   35,   98,  103,   35,  105,
        28,   84,  111,  106,   35,   35,   85,  107,  107,   61,
 
-      108,  107,   35,  248,  107,  110,  112,  114,  113,   35,
+      108,  107,   35,  250,  107,  110,  112,  114,  113,   35,
        75,   78,   99,   35,   35,  116,  117,  117,   61,  118,
       117,  134,   35,  117,  120,  121,  121,   61,  122,  121,
-       35,  246,  121,  124,  125,  125,   61,  126,  125,   35,
+       35,  258,  121,  124,  125,  125,   61,  126,  125,   35,
       137,  125,  128,  135,  102,  129,   35,  130,  130,   61,
       131,  130,  136,   35,  130,  133,   28,  139,   28,  141,
        35,  144,  140,   35,  142,   35,  151,   35,   35,   28,
-      153,   28,  155,  143,  244,  154,   35,  156,  145,  146,
+      153,   28,  155,  143,  256,  154,   35,  156,  145,  146,
       146,   61,  147,  146,  150,   35,  146,  149,   28,  158,
        28,  160,   28,  163,  159,  167,  161,   35,  164,   28,
 
-      165,   28,  169,   28,  171,  166,   35,  170,  213,  172,
-      177,   35,   28,  139,   35,  173,   35,  178,  140,  215,
-      179,   28,  181,   28,  183,  174,  208,  182,   35,  184,
+      165,   28,  169,   28,  171,  166,   35,  170,  215,  172,
+      177,   35,   28,  139,   35,  173,   35,  178,  140,  255,
+      179,   28,  181,   28,  183,  174,  209,  182,   35,  184,
       185,   35,  186,  186,   61,  187,  186,   28,  153,  186,
       189,   28,  158,  154,   28,  163,   35,  159,  190,   35,
-      164,   28,  169,  192,   35,   35,  191,  170,  198,   35,
-       28,  181,   28,  202,   28,  204,  182,  215,  203,  207,
-      205,   64,  210,  229,  197,  216,  217,   28,  202,   35,
-      215,  229,  230,  203,  222,  222,   61,  223,  222,   35,
-      215,  222,  225,  237,  227,  231,   28,  233,   28,  235,
-
-       28,  233,  234,  238,  236,  215,  234,  240,   35,  215,
-      215,  200,  229,  196,  239,  226,  221,  219,  212,  176,
-      207,  200,  196,  194,  176,  241,  242,  245,   26,   26,
-       26,   26,   28,   28,   28,   30,   30,   30,   30,   35,
-       35,   35,   35,   57,  115,   57,   57,   58,   58,   58,
-       58,   60,   86,   60,   60,   34,   34,   34,   34,   64,
-       64,   35,   64,   83,   83,   83,   83,   85,   29,   85,
-       85,  109,  109,  109,  109,  119,  119,  119,  119,  123,
-      123,  123,  123,  127,  127,  127,  127,  132,  132,  132,
-      132,  138,  138,  138,  138,  140,   54,  140,  140,  148,
-
-      148,  148,  148,  152,  152,  152,  152,  154,   52,  154,
-      154,  157,  157,  157,  157,  159,   35,  159,  159,  162,
-      162,  162,  162,  164,   29,  164,  164,  168,  168,  168,
-      168,  170,  250,  170,  170,  175,  175,  175,  175,  142,
-       27,  142,  142,  180,  180,  180,  180,  182,   27,  182,
-      182,  188,  188,  188,  188,  156,  250,  156,  156,  161,
-      250,  161,  161,  166,  250,  166,  166,  172,  250,  172,
-      172,  193,  193,  193,  193,  195,  195,  195,  195,  184,
-      250,  184,  184,  199,  199,  199,  199,  201,  201,  201,
-      201,  203,  250,  203,  203,  206,  206,  206,  206,  209,
-
-      209,  209,  209,  211,  211,  211,  211,  214,  214,  214,
-      214,  218,  218,  218,  218,  205,  250,  205,  205,  220,
-      220,  220,  220,  224,  224,  224,  224,  210,  250,  210,
-      210,  228,  228,  228,  228,  232,  232,  232,  232,  234,
-      250,  234,  234,  236,  250,  236,  236,  243,  243,  243,
-      243,  247,  247,  247,  247,    5,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250
+      164,   28,  169,  192,   35,   35,  191,  170,  197,  199,
+       35,   28,  181,   28,  203,   28,  205,  182,   35,  204,
+      217,  206,   64,  211,  198,   28,  203,   35,  218,  219,
+       35,  204,  214,  224,  224,   61,  225,  224,  232,  229,
+      224,  227,  232,   28,  236,  230,   35,  233,  217,  237,
+
+      241,   28,  238,  217,   28,  236,  234,  239,   35,  217,
+      237,  245,   35,   35,  217,  217,  244,  253,   35,  252,
+      250,  242,  217,  240,  208,  201,  248,  243,  232,  246,
+      247,  196,  228,  251,   26,   26,   26,   26,   28,   28,
+       28,   30,   30,   30,   30,   35,   35,   35,   35,   57,
+      223,   57,   57,   58,   58,   58,   58,   60,  221,   60,
+       60,   34,   34,   34,   34,   64,   64,  213,   64,   83,
+       83,   83,   83,   85,  176,   85,   85,  109,  109,  109,
+      109,  119,  119,  119,  119,  123,  123,  123,  123,  127,
+      127,  127,  127,  132,  132,  132,  132,  138,  138,  138,
+
+      138,  140,  208,  140,  140,  148,  148,  148,  148,  152,
+      152,  152,  152,  154,  201,  154,  154,  157,  157,  157,
+      157,  159,  196,  159,  159,  162,  162,  162,  162,  164,
+      194,  164,  164,  168,  168,  168,  168,  170,  176,  170,
+      170,  175,  175,  175,  175,  142,  115,  142,  142,  180,
+      180,  180,  180,  182,   86,  182,  182,  188,  188,  188,
+      188,  156,   35,  156,  156,  161,   29,  161,  161,  166,
+       54,  166,  166,  172,   52,  172,  172,  193,  193,  193,
+      193,  195,  195,  195,  195,  184,   35,  184,  184,  200,
+      200,  200,  200,  202,  202,  202,  202,  204,   29,  204,
+
+      204,  207,  207,  207,  207,  210,  210,  210,  210,  212,
+      212,  212,  212,  216,  216,  216,  216,  220,  220,  220,
+      220,  206,  261,  206,  206,  222,  222,  222,  222,  226,
+      226,  226,  226,  211,   27,  211,  211,  231,  231,  231,
+      231,  235,  235,  235,  235,  237,   27,  237,  237,  239,
+      261,  239,  239,  249,  249,  249,  249,  254,  254,  254,
+      254,  257,  257,  257,  257,  259,  259,  259,  259,    5,
+      261,  261,  261,  261,  261,  261,  261,  261,  261,  261,
+      261,  261,  261,  261,  261,  261,  261,  261,  261,  261,
+      261,  261,  261,  261,  261,  261,  261,  261,  261,  261,
+
+      261,  261,  261
     } ;
 
-static yyconst flex_int16_t yy_chk[690] =
+static yyconst flex_int16_t yy_chk[704] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
@@ -660,7 +658,7 @@ static yyconst flex_int16_t yy_chk[690] =
        14,   11,   11,   47,   14,   11,   19,   19,   41,   15,
        16,   11,   12,   12,   12,   12,   12,   14,   16,   12,
        12,   12,   15,   18,   16,   20,   21,   23,   21,   23,
-      247,   25,   20,   38,   25,   38,   45,   18,   25,   30,
+      259,   25,   20,   38,   25,   38,   45,   18,   25,   30,
        30,   18,   31,   31,   31,   30,   40,   45,   40,   31,
 
        34,   34,   34,   34,   39,   42,   46,   34,   34,   36,
@@ -670,63 +668,66 @@ static yyconst flex_int16_t yy_chk[690] =
        58,   51,   65,   67,   50,   58,   54,   53,   54,   61,
        61,   52,   68,   67,   69,   61,   70,   71,   72,   70,
        73,   71,   74,   75,   77,   75,   68,   76,   82,   76,
-       72,   79,   73,   69,   78,   87,   78,   81,  245,   79,
+       72,   79,   73,   69,   78,   87,   78,   81,  257,   79,
        74,   80,   80,   81,   80,   91,   77,   80,   89,   82,
        83,   83,   89,   87,   90,   94,   83,   88,   88,   88,
 
-       88,   88,   95,  243,   88,   88,   90,   92,   91,   92,
+       88,   88,   95,  254,   88,   88,   90,   92,   91,   92,
        95,   98,   98,  103,   98,   94,   96,   96,   96,   96,
        96,  103,  106,   96,   96,   97,   97,   97,   97,   97,
-      100,  242,   97,   97,   99,   99,   99,   99,   99,  104,
+      100,  253,   97,   97,   99,   99,   99,   99,   99,  104,
       106,   99,   99,  104,  101,  100,  101,  102,  102,  102,
       102,  102,  105,  105,  102,  102,  107,  107,  109,  109,
       111,  112,  107,  113,  109,  115,  116,  112,  116,  117,
-      117,  119,  119,  111,  240,  117,  129,  119,  113,  114,
-      114,  114,  114,  114,  115,  197,  114,  114,  121,  121,
+      117,  119,  119,  111,  251,  117,  129,  119,  113,  114,
+      114,  114,  114,  114,  115,  198,  114,  114,  121,  121,
       123,  123,  125,  125,  121,  129,  123,  134,  125,  127,
 
-      127,  130,  130,  132,  132,  127,  135,  130,  197,  132,
-      137,  137,  138,  138,  143,  134,  145,  143,  138,  228,
+      127,  130,  130,  132,  132,  127,  135,  130,  198,  132,
+      137,  137,  138,  138,  143,  134,  145,  143,  138,  249,
       145,  146,  146,  148,  148,  135,  191,  146,  191,  148,
       150,  150,  151,  151,  151,  151,  151,  152,  152,  151,
       151,  157,  157,  152,  162,  162,  173,  157,  167,  167,
-      162,  168,  168,  174,  174,  178,  173,  168,  179,  179,
-      180,  180,  186,  186,  188,  188,  180,  198,  186,  220,
-      188,  192,  192,  216,  178,  198,  198,  201,  201,  213,
-      230,  217,  216,  201,  208,  208,  208,  208,  208,  227,
-      231,  208,  208,  227,  213,  217,  222,  222,  224,  224,
-
-      232,  232,  222,  230,  224,  238,  232,  237,  237,  241,
-      239,  218,  214,  211,  231,  209,  206,  199,  195,  193,
-      190,  185,  177,  175,  136,  238,  239,  241,  251,  251,
-      251,  251,  252,  252,  252,  253,  253,  253,  253,  254,
-      254,  254,  254,  255,   93,  255,  255,  256,  256,  256,
-      256,  257,   64,  257,  257,  258,  258,  258,  258,  259,
-      259,   35,  259,  260,  260,  260,  260,  261,   28,  261,
-      261,  262,  262,  262,  262,  263,  263,  263,  263,  264,
-      264,  264,  264,  265,  265,  265,  265,  266,  266,  266,
-      266,  267,  267,  267,  267,  268,   24,  268,  268,  269,
-
-      269,  269,  269,  270,  270,  270,  270,  271,   22,  271,
-      271,  272,  272,  272,  272,  273,   17,  273,  273,  274,
-      274,  274,  274,  275,    6,  275,  275,  276,  276,  276,
-      276,  277,    5,  277,  277,  278,  278,  278,  278,  279,
-        4,  279,  279,  280,  280,  280,  280,  281,    3,  281,
-      281,  282,  282,  282,  282,  283,    0,  283,  283,  284,
-        0,  284,  284,  285,    0,  285,  285,  286,    0,  286,
-      286,  287,  287,  287,  287,  288,  288,  288,  288,  289,
-        0,  289,  289,  290,  290,  290,  290,  291,  291,  291,
-      291,  292,    0,  292,  292,  293,  293,  293,  293,  294,
-
-      294,  294,  294,  295,  295,  295,  295,  296,  296,  296,
-      296,  297,  297,  297,  297,  298,    0,  298,  298,  299,
-      299,  299,  299,  300,  300,  300,  300,  301,    0,  301,
-      301,  302,  302,  302,  302,  303,  303,  303,  303,  304,
-        0,  304,  304,  305,    0,  305,  305,  306,  306,  306,
-      306,  307,  307,  307,  307,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250
+      162,  168,  168,  174,  174,  178,  173,  168,  178,  179,
+      179,  180,  180,  186,  186,  188,  188,  180,  197,  186,
+      199,  188,  192,  192,  178,  202,  202,  214,  199,  199,
+      215,  202,  197,  209,  209,  209,  209,  209,  218,  214,
+      209,  209,  219,  224,  224,  215,  230,  218,  233,  224,
+
+      230,  226,  226,  234,  235,  235,  219,  226,  240,  242,
+      235,  241,  241,  244,  243,  246,  240,  248,  248,  247,
+      245,  233,  231,  229,  222,  220,  244,  234,  216,  242,
+      243,  212,  210,  246,  262,  262,  262,  262,  263,  263,
+      263,  264,  264,  264,  264,  265,  265,  265,  265,  266,
+      207,  266,  266,  267,  267,  267,  267,  268,  200,  268,
+      268,  269,  269,  269,  269,  270,  270,  195,  270,  271,
+      271,  271,  271,  272,  193,  272,  272,  273,  273,  273,
+      273,  274,  274,  274,  274,  275,  275,  275,  275,  276,
+      276,  276,  276,  277,  277,  277,  277,  278,  278,  278,
+
+      278,  279,  190,  279,  279,  280,  280,  280,  280,  281,
+      281,  281,  281,  282,  185,  282,  282,  283,  283,  283,
+      283,  284,  177,  284,  284,  285,  285,  285,  285,  286,
+      175,  286,  286,  287,  287,  287,  287,  288,  136,  288,
+      288,  289,  289,  289,  289,  290,   93,  290,  290,  291,
+      291,  291,  291,  292,   64,  292,  292,  293,  293,  293,
+      293,  294,   35,  294,  294,  295,   28,  295,  295,  296,
+       24,  296,  296,  297,   22,  297,  297,  298,  298,  298,
+      298,  299,  299,  299,  299,  300,   17,  300,  300,  301,
+      301,  301,  301,  302,  302,  302,  302,  303,    6,  303,
+
+      303,  304,  304,  304,  304,  305,  305,  305,  305,  306,
+      306,  306,  306,  307,  307,  307,  307,  308,  308,  308,
+      308,  309,    5,  309,  309,  310,  310,  310,  310,  311,
+      311,  311,  311,  312,    4,  312,  312,  313,  313,  313,
+      313,  314,  314,  314,  314,  315,    3,  315,  315,  316,
+        0,  316,  316,  317,  317,  317,  317,  318,  318,  318,
+      318,  319,  319,  319,  319,  320,  320,  320,  320,  261,
+      261,  261,  261,  261,  261,  261,  261,  261,  261,  261,
+      261,  261,  261,  261,  261,  261,  261,  261,  261,  261,
+      261,  261,  261,  261,  261,  261,  261,  261,  261,  261,
+
+      261,  261,  261
     } ;
 
 #define YY_TRAILING_MASK 0x2000
@@ -856,6 +857,13 @@ static void setbackendtype(DiskParseContext *dpc, const 
char *str) {
     else xlu__disk_err(dpc,str,"unknown value for backendtype");
 }
 
+/* Sets ->backend_domid from the string. */
+static void setbackend(DiskParseContext *dpc, const char *str) {
+    if (libxl_name_to_domid(dpc->ctx, str, &dpc->disk->backend_domid)) {
+        xlu__disk_err(dpc,str,"unknown domain for backend");
+    }
+}
+
 #define DEPRECATE(usewhatinstead) /* not currently reported */
 
 /* Handles a vdev positional parameter which includes a devtype. */
@@ -883,7 +891,7 @@ static int vdev_and_devtype(DiskParseContext *dpc, char 
*str) {
 #define DPC ((DiskParseContext*)yyextra)
 
 
-#line 887 "libxlu_disk_l.c"
+#line 895 "libxlu_disk_l.c"
 
 #define INITIAL 0
 #define LEXERR 1
@@ -980,6 +988,10 @@ int xlu__disk_yyget_lineno (yyscan_t yyscanner );
 
 void xlu__disk_yyset_lineno (int line_number ,yyscan_t yyscanner );
 
+int xlu__disk_yyget_column  (yyscan_t yyscanner );
+
+void xlu__disk_yyset_column (int column_no ,yyscan_t yyscanner );
+
 /* Macros after this point can all be overridden by user definitions in
  * section 1.
  */
@@ -1012,12 +1024,7 @@ static int input (yyscan_t yyscanner );
 
 /* Amount of stuff to slurp up with each read. */
 #ifndef YY_READ_BUF_SIZE
-#ifdef __ia64__
-/* On IA-64, the buffer size is 16k, not 8k */
-#define YY_READ_BUF_SIZE 16384
-#else
 #define YY_READ_BUF_SIZE 8192
-#endif /* __ia64__ */
 #endif
 
 /* Copy whatever the last rule matched to the standard output. */
@@ -1036,7 +1043,7 @@ static int input (yyscan_t yyscanner );
        if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
                { \
                int c = '*'; \
-               size_t n; \
+               unsigned n; \
                for ( n = 0; n < max_size && \
                             (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
                        buf[n] = (char) c; \
@@ -1119,12 +1126,12 @@ YY_DECL
        register int yy_act;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-#line 155 "libxlu_disk_l.l"
+#line 162 "libxlu_disk_l.l"
 
 
  /*----- the scanner rules which do the parsing -----*/
 
-#line 1128 "libxlu_disk_l.c"
+#line 1135 "libxlu_disk_l.c"
 
        if ( !yyg->yy_init )
                {
@@ -1188,14 +1195,14 @@ yy_match:
                        while ( yy_chk[yy_base[yy_current_state] + yy_c] != 
yy_current_state )
                                {
                                yy_current_state = (int) 
yy_def[yy_current_state];
-                               if ( yy_current_state >= 251 )
+                               if ( yy_current_state >= 262 )
                                        yy_c = yy_meta[(unsigned int) yy_c];
                                }
                        yy_current_state = yy_nxt[yy_base[yy_current_state] + 
(unsigned int) yy_c];
                        *yyg->yy_state_ptr++ = yy_current_state;
                        ++yy_cp;
                        }
-               while ( yy_current_state != 250 );
+               while ( yy_current_state != 261 );
 
 yy_find_action:
                yy_current_state = *--yyg->yy_state_ptr;
@@ -1245,89 +1252,95 @@ do_action:      /* This label is used only to access 
EOF actions. */
 case 1:
 /* rule 1 can match eol */
 YY_RULE_SETUP
-#line 159 "libxlu_disk_l.l"
+#line 166 "libxlu_disk_l.l"
 { /* ignore whitespace before parameters */ }
        YY_BREAK
 /* ordinary parameters setting enums or strings */
 case 2:
 /* rule 2 can match eol */
 YY_RULE_SETUP
-#line 163 "libxlu_disk_l.l"
+#line 170 "libxlu_disk_l.l"
 { STRIP(','); setformat(DPC, FROMEQUALS); }
        YY_BREAK
 case 3:
 YY_RULE_SETUP
-#line 165 "libxlu_disk_l.l"
+#line 172 "libxlu_disk_l.l"
 { DPC->disk->is_cdrom = 1; }
        YY_BREAK
 case 4:
 YY_RULE_SETUP
-#line 166 "libxlu_disk_l.l"
+#line 173 "libxlu_disk_l.l"
 { DPC->disk->is_cdrom = 1; }
        YY_BREAK
 case 5:
 YY_RULE_SETUP
-#line 167 "libxlu_disk_l.l"
+#line 174 "libxlu_disk_l.l"
 { DPC->disk->is_cdrom = 0; }
        YY_BREAK
 case 6:
 /* rule 6 can match eol */
 YY_RULE_SETUP
-#line 168 "libxlu_disk_l.l"
+#line 175 "libxlu_disk_l.l"
 { xlu__disk_err(DPC,yytext,"unknown value for type"); }
        YY_BREAK
 case 7:
 /* rule 7 can match eol */
 YY_RULE_SETUP
-#line 170 "libxlu_disk_l.l"
+#line 177 "libxlu_disk_l.l"
 { STRIP(','); setaccess(DPC, FROMEQUALS); }
        YY_BREAK
 case 8:
 /* rule 8 can match eol */
 YY_RULE_SETUP
-#line 171 "libxlu_disk_l.l"
+#line 178 "libxlu_disk_l.l"
 { STRIP(','); setbackendtype(DPC,FROMEQUALS); }
        YY_BREAK
 case 9:
 /* rule 9 can match eol */
 YY_RULE_SETUP
-#line 173 "libxlu_disk_l.l"
-{ STRIP(','); SAVESTRING("vdev", vdev, FROMEQUALS); }
+#line 179 "libxlu_disk_l.l"
+{ STRIP(','); setbackend(DPC,FROMEQUALS); }
        YY_BREAK
 case 10:
 /* rule 10 can match eol */
 YY_RULE_SETUP
-#line 174 "libxlu_disk_l.l"
+#line 181 "libxlu_disk_l.l"
+{ STRIP(','); SAVESTRING("vdev", vdev, FROMEQUALS); }
+       YY_BREAK
+case 11:
+/* rule 11 can match eol */
+YY_RULE_SETUP
+#line 182 "libxlu_disk_l.l"
 { STRIP(','); SAVESTRING("script", script, FROMEQUALS); }
        YY_BREAK
 /* the target magic parameter, eats the rest of the string */
-case 11:
+case 12:
 YY_RULE_SETUP
-#line 178 "libxlu_disk_l.l"
+#line 186 "libxlu_disk_l.l"
 { STRIP(','); SAVESTRING("target", pdev_path, FROMEQUALS); }
        YY_BREAK
 /* unknown parameters */
-case 12:
-/* rule 12 can match eol */
+case 13:
+/* rule 13 can match eol */
 YY_RULE_SETUP
-#line 182 "libxlu_disk_l.l"
+#line 190 "libxlu_disk_l.l"
 { xlu__disk_err(DPC,yytext,"unknown parameter"); }
        YY_BREAK
 /* deprecated prefixes */
 /* the "/.*" in these patterns ensures that they count as if they
    * matched the whole string, so these patterns take precedence */
-case 13:
+case 14:
 YY_RULE_SETUP
-#line 189 "libxlu_disk_l.l"
+#line 197 "libxlu_disk_l.l"
 {
                     STRIP(':');
                     DPC->had_depr_prefix=1; DEPRECATE("use `[format=]...,'");
                     setformat(DPC, yytext);
                  }
        YY_BREAK
-case 14:
+case 15:
 YY_RULE_SETUP
-#line 195 "libxlu_disk_l.l"
+#line 203 "libxlu_disk_l.l"
 {
                     char *newscript;
                     STRIP(':');
@@ -1341,65 +1354,65 @@ YY_RULE_SETUP
                     free(newscript);
                 }
        YY_BREAK
-case 15:
+case 16:
 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
 yyg->yy_c_buf_p = yy_cp = yy_bp + 8;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
-#line 208 "libxlu_disk_l.l"
+#line 216 "libxlu_disk_l.l"
 { DPC->had_depr_prefix=1; DEPRECATE(0); }
        YY_BREAK
-case 16:
+case 17:
 YY_RULE_SETUP
-#line 209 "libxlu_disk_l.l"
+#line 217 "libxlu_disk_l.l"
 { DPC->had_depr_prefix=1; DEPRECATE(0); }
        YY_BREAK
-case 17:
+case 18:
 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
 yyg->yy_c_buf_p = yy_cp = yy_bp + 4;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
-#line 210 "libxlu_disk_l.l"
+#line 218 "libxlu_disk_l.l"
 { DPC->had_depr_prefix=1; DEPRECATE(0); }
        YY_BREAK
-case 18:
+case 19:
 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
 yyg->yy_c_buf_p = yy_cp = yy_bp + 6;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
-#line 211 "libxlu_disk_l.l"
+#line 219 "libxlu_disk_l.l"
 { DPC->had_depr_prefix=1; DEPRECATE(0); }
        YY_BREAK
-case 19:
+case 20:
 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
 yyg->yy_c_buf_p = yy_cp = yy_bp + 5;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
-#line 212 "libxlu_disk_l.l"
+#line 220 "libxlu_disk_l.l"
 { DPC->had_depr_prefix=1; DEPRECATE(0); }
        YY_BREAK
-case 20:
+case 21:
 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
 yyg->yy_c_buf_p = yy_cp = yy_bp + 4;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
-#line 213 "libxlu_disk_l.l"
+#line 221 "libxlu_disk_l.l"
 { DPC->had_depr_prefix=1; DEPRECATE(0); }
        YY_BREAK
-case 21:
-/* rule 21 can match eol */
+case 22:
+/* rule 22 can match eol */
 YY_RULE_SETUP
-#line 215 "libxlu_disk_l.l"
+#line 223 "libxlu_disk_l.l"
 {
                  xlu__disk_err(DPC,yytext,"unknown deprecated disk prefix");
                  return 0;
                }
        YY_BREAK
 /* positional parameters */
-case 22:
-/* rule 22 can match eol */
+case 23:
+/* rule 23 can match eol */
 YY_RULE_SETUP
-#line 222 "libxlu_disk_l.l"
+#line 230 "libxlu_disk_l.l"
 {
     STRIP(',');
 
@@ -1426,27 +1439,27 @@ YY_RULE_SETUP
     }
 }
        YY_BREAK
-case 23:
+case 24:
 YY_RULE_SETUP
-#line 248 "libxlu_disk_l.l"
+#line 256 "libxlu_disk_l.l"
 {
     BEGIN(LEXERR);
     yymore();
 }
        YY_BREAK
-case 24:
+case 25:
 YY_RULE_SETUP
-#line 252 "libxlu_disk_l.l"
+#line 260 "libxlu_disk_l.l"
 {
     xlu__disk_err(DPC,yytext,"bad disk syntax"); return 0;
 }
        YY_BREAK
-case 25:
+case 26:
 YY_RULE_SETUP
-#line 255 "libxlu_disk_l.l"
+#line 263 "libxlu_disk_l.l"
 YY_FATAL_ERROR( "flex scanner jammed" );
        YY_BREAK
-#line 1450 "libxlu_disk_l.c"
+#line 1463 "libxlu_disk_l.c"
                        case YY_STATE_EOF(INITIAL):
                        case YY_STATE_EOF(LEXERR):
                                yyterminate();
@@ -1710,7 +1723,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
                while ( yy_chk[yy_base[yy_current_state] + yy_c] != 
yy_current_state )
                        {
                        yy_current_state = (int) yy_def[yy_current_state];
-                       if ( yy_current_state >= 251 )
+                       if ( yy_current_state >= 262 )
                                yy_c = yy_meta[(unsigned int) yy_c];
                        }
                yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned 
int) yy_c];
@@ -1734,11 +1747,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
                {
                yy_current_state = (int) yy_def[yy_current_state];
-               if ( yy_current_state >= 251 )
+               if ( yy_current_state >= 262 )
                        yy_c = yy_meta[(unsigned int) yy_c];
                }
        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) 
yy_c];
-       yy_is_jam = (yy_current_state == 250);
+       yy_is_jam = (yy_current_state == 261);
        if ( ! yy_is_jam )
                *yyg->yy_state_ptr++ = yy_current_state;
 
@@ -2147,8 +2160,8 @@ YY_BUFFER_STATE xlu__disk_yy_scan_string (yyconst char * 
yystr , yyscan_t yyscan
 
 /** Setup the input buffer state to scan the given bytes. The next call to 
xlu__disk_yylex() will
  * scan from a @e copy of @a bytes.
- * @param yybytes the byte buffer to scan
- * @param _yybytes_len the number of bytes in the buffer pointed to by @a 
bytes.
+ * @param bytes the byte buffer to scan
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
  * @param yyscanner The scanner object.
  * @return the newly allocated buffer state object.
  */
@@ -2538,4 +2551,4 @@ void xlu__disk_yyfree (void * ptr , yyscan_t yyscanner)
 
 #define YYTABLES_NAME "yytables"
 
-#line 255 "libxlu_disk_l.l"
+#line 263 "libxlu_disk_l.l"
diff --git a/tools/libxl/libxlu_disk_l.h b/tools/libxl/libxlu_disk_l.h
index de03908..247a0d7 100644
--- a/tools/libxl/libxlu_disk_l.h
+++ b/tools/libxl/libxlu_disk_l.h
@@ -62,6 +62,7 @@ typedef int flex_int32_t;
 typedef unsigned char flex_uint8_t; 
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
 
 /* Limits of integral types. */
 #ifndef INT8_MIN
@@ -92,8 +93,6 @@ typedef unsigned int flex_uint32_t;
 #define UINT32_MAX             (4294967295U)
 #endif
 
-#endif /* ! C99 */
-
 #endif /* ! FLEXINT_H */
 
 #ifdef __cplusplus
@@ -136,15 +135,7 @@ typedef void* yyscan_t;
 
 /* Size of default input buffer. */
 #ifndef YY_BUF_SIZE
-#ifdef __ia64__
-/* On IA-64, the buffer size is 16k, not 8k.
- * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
- * Ditto for the __ia64__ case accordingly.
- */
-#define YY_BUF_SIZE 32768
-#else
 #define YY_BUF_SIZE 16384
-#endif /* __ia64__ */
 #endif
 
 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
@@ -280,6 +271,10 @@ int xlu__disk_yyget_lineno (yyscan_t yyscanner );
 
 void xlu__disk_yyset_lineno (int line_number ,yyscan_t yyscanner );
 
+int xlu__disk_yyget_column  (yyscan_t yyscanner );
+
+void xlu__disk_yyset_column (int column_no ,yyscan_t yyscanner );
+
 /* Macros after this point can all be overridden by user definitions in
  * section 1.
  */
@@ -306,12 +301,7 @@ static int yy_flex_strlen (yyconst char * ,yyscan_t 
yyscanner);
 
 /* Amount of stuff to slurp up with each read. */
 #ifndef YY_READ_BUF_SIZE
-#ifdef __ia64__
-/* On IA-64, the buffer size is 16k, not 8k */
-#define YY_READ_BUF_SIZE 16384
-#else
 #define YY_READ_BUF_SIZE 8192
-#endif /* __ia64__ */
 #endif
 
 /* Number of entries by which start-condition stack grows. */
@@ -344,8 +334,8 @@ extern int xlu__disk_yylex (yyscan_t yyscanner);
 #undef YY_DECL
 #endif
 
-#line 255 "libxlu_disk_l.l"
+#line 263 "libxlu_disk_l.l"
 
-#line 350 "libxlu_disk_l.h"
+#line 340 "libxlu_disk_l.h"
 #undef xlu__disk_yyIN_HEADER
 #endif /* xlu__disk_yyHEADER_H */
diff --git a/tools/libxl/libxlu_disk_l.l b/tools/libxl/libxlu_disk_l.l
index bee16a1..6bd48e8 100644
--- a/tools/libxl/libxlu_disk_l.l
+++ b/tools/libxl/libxlu_disk_l.l
@@ -113,6 +113,13 @@ static void setbackendtype(DiskParseContext *dpc, const 
char *str) {
     else xlu__disk_err(dpc,str,"unknown value for backendtype");
 }
 
+/* Sets ->backend_domid from the string. */
+static void setbackend(DiskParseContext *dpc, const char *str) {
+    if (libxl_name_to_domid(dpc->ctx, str, &dpc->disk->backend_domid)) {
+        xlu__disk_err(dpc,str,"unknown domain for backend");
+    }
+}
+
 #define DEPRECATE(usewhatinstead) /* not currently reported */
 
 /* Handles a vdev positional parameter which includes a devtype. */
@@ -169,6 +176,7 @@ devtype=[^,]*,?     { xlu__disk_err(DPC,yytext,"unknown 
value for type"); }
 
 access=[^,]*,? { STRIP(','); setaccess(DPC, FROMEQUALS); }
 backendtype=[^,]*,? { STRIP(','); setbackendtype(DPC,FROMEQUALS); }
+backenddomain=[^,]*,? { STRIP(','); setbackend(DPC,FROMEQUALS); }
 
 vdev=[^,]*,?   { STRIP(','); SAVESTRING("vdev", vdev, FROMEQUALS); }
 script=[^,]*,? { STRIP(','); SAVESTRING("script", script, FROMEQUALS); }
diff --git a/tools/libxl/libxlutil.h b/tools/libxl/libxlutil.h
index 0333e55..87eb399 100644
--- a/tools/libxl/libxlutil.h
+++ b/tools/libxl/libxlutil.h
@@ -72,7 +72,7 @@ const char *xlu_cfg_get_listitem(const XLU_ConfigList*, int 
entry);
  */
 
 int xlu_disk_parse(XLU_Config *cfg, int nspecs, const char *const *specs,
-                   libxl_device_disk *disk);
+                   libxl_device_disk *disk, libxl_ctx *ctx);
   /* disk must have been initialised.
    *
    * On error, returns errno value.  Bad strings cause EINVAL and
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 138cd72..fd00d61 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -420,7 +420,7 @@ static void parse_disk_config_multistring(XLU_Config 
**config,
         if (!*config) { perror("xlu_cfg_init"); exit(-1); }
     }
 
-    e = xlu_disk_parse(*config, nspecs, specs, disk);
+    e = xlu_disk_parse(*config, nspecs, specs, disk, ctx);
     if (e == EINVAL) exit(-1);
     if (e) {
         fprintf(stderr,"xlu_disk_parse failed: %s\n",strerror(errno));
@@ -5335,7 +5335,7 @@ int main_networkdetach(int argc, char **argv)
 int main_blockattach(int argc, char **argv)
 {
     int opt;
-    uint32_t fe_domid, be_domid = 0;
+    uint32_t fe_domid;
     libxl_device_disk disk = { 0 };
     XLU_Config *config = 0;
 
@@ -5351,8 +5351,6 @@ int main_blockattach(int argc, char **argv)
     parse_disk_config_multistring
         (&config, argc-optind, (const char* const*)argv + optind, &disk);
 
-    disk.backend_domid = be_domid;
-
     if (dryrun_only) {
         char *json = libxl_device_disk_to_json(ctx, &disk);
         printf("disk: %s\n", json);
-- 
1.7.11.2


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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