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

[Xen-changelog] [xen-unstable] xl: support xend empty cdrom device syntax


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Thu, 26 Jul 2012 20:55:19 +0000
  • Delivery-date: Thu, 26 Jul 2012 20:55:27 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
# Date 1343295336 -3600
# Node ID fab03d9ee1ba33e4dc73cfe32dff3f4c8e581396
# Parent  fa411577ef8b5a58acc054cdcdb57a70ce1cb7e9
xl: support xend empty cdrom device syntax

xend accepts `,hdc:cdrom,r' as an empty CDROM drive.  However this is
not consistent with the existing xl syntax in
docs/misc/xl-disk-configuration.txt which requires `,,hdc:cdrom,r'
(the additional positional paramter is the format).

We fix this by spotting the case specially: when the target is empty
and the format contains a colon, reinterpret the format as
<vdev>:<devtype>.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r fa411577ef8b -r fab03d9ee1ba docs/misc/xl-disk-configuration.txt
--- a/docs/misc/xl-disk-configuration.txt       Thu Jul 26 10:35:36 2012 +0100
+++ b/docs/misc/xl-disk-configuration.txt       Thu Jul 26 10:35:36 2012 +0100
@@ -221,3 +221,14 @@ to specify several of these, for example
   "tap:aio:/some/path..."
 
 All of these prefixes are now stripped and ignored.
+
+
+Missing format and empty target
+-------------------------------
+
+The following syntax is also supported:
+
+  ,<vdev>:<devtype>,<access>   (deprecated)
+
+This is soley for compatibility with xend's syntax for empty cdroms,
+which is (for example) ",hdc:cdrom,r".
diff -r fa411577ef8b -r fab03d9ee1ba tools/libxl/check-xl-disk-parse
--- a/tools/libxl/check-xl-disk-parse   Thu Jul 26 10:35:36 2012 +0100
+++ b/tools/libxl/check-xl-disk-parse   Thu Jul 26 10:35:36 2012 +0100
@@ -123,6 +123,7 @@ disk: {
 EOF
 one 0 devtype=cdrom,,,hdc
 one 0 ,,hdc:cdrom,r
+one 0 ,hdc:cdrom,r
 one 0 vdev=hdc,access=r,devtype=cdrom,target=
 one 0 ,empty,hdc:cdrom,r
 
diff -r fa411577ef8b -r fab03d9ee1ba tools/libxl/libxlu_disk_l.c
--- a/tools/libxl/libxlu_disk_l.c       Thu Jul 26 10:35:36 2012 +0100
+++ b/tools/libxl/libxlu_disk_l.c       Thu Jul 26 10:35:36 2012 +0100
@@ -1404,7 +1404,11 @@ YY_RULE_SETUP
         SAVESTRING("target", pdev_path, yytext);
     } else if (!DPC->had_depr_prefix &&
                DPC->disk->format == LIBXL_DISK_FORMAT_UNKNOWN) {
-        setformat(DPC,yytext);
+        if (!*DPC->disk->pdev_path && vdev_and_devtype(DPC,yytext)) {
+            DPC->disk->format = LIBXL_DISK_FORMAT_EMPTY;
+        } else {
+            setformat(DPC,yytext);
+        }
     } else if (!DPC->disk->vdev) {
         if (!vdev_and_devtype(DPC,yytext))
             SAVESTRING("vdev", vdev, yytext);
@@ -1419,7 +1423,7 @@ YY_RULE_SETUP
        YY_BREAK
 case 23:
 YY_RULE_SETUP
-#line 233 "libxlu_disk_l.l"
+#line 237 "libxlu_disk_l.l"
 {
     BEGIN(LEXERR);
     yymore();
@@ -1427,17 +1431,17 @@ YY_RULE_SETUP
        YY_BREAK
 case 24:
 YY_RULE_SETUP
-#line 237 "libxlu_disk_l.l"
+#line 241 "libxlu_disk_l.l"
 {
     xlu__disk_err(DPC,yytext,"bad disk syntax"); return 0;
 }
        YY_BREAK
 case 25:
 YY_RULE_SETUP
-#line 240 "libxlu_disk_l.l"
+#line 244 "libxlu_disk_l.l"
 YY_FATAL_ERROR( "flex scanner jammed" );
        YY_BREAK
-#line 1441 "libxlu_disk_l.c"
+#line 1445 "libxlu_disk_l.c"
                        case YY_STATE_EOF(INITIAL):
                        case YY_STATE_EOF(LEXERR):
                                yyterminate();
@@ -2529,4 +2533,4 @@ void xlu__disk_yyfree (void * ptr , yysc
 
 #define YYTABLES_NAME "yytables"
 
-#line 240 "libxlu_disk_l.l"
+#line 244 "libxlu_disk_l.l"
diff -r fa411577ef8b -r fab03d9ee1ba tools/libxl/libxlu_disk_l.h
--- a/tools/libxl/libxlu_disk_l.h       Thu Jul 26 10:35:36 2012 +0100
+++ b/tools/libxl/libxlu_disk_l.h       Thu Jul 26 10:35:36 2012 +0100
@@ -340,7 +340,7 @@ extern int xlu__disk_yylex (yyscan_t yys
 #undef YY_DECL
 #endif
 
-#line 240 "libxlu_disk_l.l"
+#line 244 "libxlu_disk_l.l"
 
 #line 346 "libxlu_disk_l.h"
 #undef xlu__disk_yyIN_HEADER
diff -r fa411577ef8b -r fab03d9ee1ba tools/libxl/libxlu_disk_l.l
--- a/tools/libxl/libxlu_disk_l.l       Thu Jul 26 10:35:36 2012 +0100
+++ b/tools/libxl/libxlu_disk_l.l       Thu Jul 26 10:35:36 2012 +0100
@@ -217,7 +217,11 @@ phy:/.*            { DPC->had_depr_prefix=1; DEPRE
         SAVESTRING("target", pdev_path, yytext);
     } else if (!DPC->had_depr_prefix &&
                DPC->disk->format == LIBXL_DISK_FORMAT_UNKNOWN) {
-        setformat(DPC,yytext);
+        if (!*DPC->disk->pdev_path && vdev_and_devtype(DPC,yytext)) {
+            DPC->disk->format = LIBXL_DISK_FORMAT_EMPTY;
+        } else {
+            setformat(DPC,yytext);
+        }
     } else if (!DPC->disk->vdev) {
         if (!vdev_and_devtype(DPC,yytext))
             SAVESTRING("vdev", vdev, yytext);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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