From: Ian Campbell Subject: Re: [PATCH] xl: support empty CDROM devices Date: Wed, 25 Jul 2012 17:00:58 +0100 Message-ID: <1343232058.18971.131.camel@zakaz.uk.xensource.com> References: <576aeedaca777236db87.1343211308@cosworth.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <576aeedaca777236db87.1343211308@cosworth.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "xen-devel@lists.xen.org" Cc: Ian Jackson List-Id: xen-devel@lists.xenproject.org On Wed, 2012-07-25 at 11:15 +0100, Ian Campbell wrote: > # HG changeset patch > # User Ian Campbell > # Date 1343211245 -3600 > # Node ID 576aeedaca777236db8760ac5ca17b30f1c5354d > # Parent f0249f4b34e3ca3a770a09c688f9c1d1c523f5e7 > xl: support empty CDROM devices It seems like I forgot to qrefresh before sending this. I supect that given your updates these differences are now irrelevant but FTR the incremental bit which was omitted because of this was: diff -r 097bf63027e0 docs/misc/xl-disk-configuration.txt --- a/docs/misc/xl-disk-configuration.txt Wed Jul 25 11:21:55 2012 +0100 +++ b/docs/misc/xl-disk-configuration.txt Wed Jul 25 17:00:00 2012 +0100 @@ -91,8 +91,9 @@ Supported values: raw, qcow, qcow2, Deprecated values: None Default value: raw -Format cannot be specified as a positional parameter when target is -not provided (the empty CDROM case) +When "target" has been provided as a positional parameter and is empty +(the empty CDROM case referred to above) then this field is implicitly +"empty" and must not be specified as a positional parameter. vdev ---- diff -r 097bf63027e0 tools/libxl/check-xl-disk-parse --- a/tools/libxl/check-xl-disk-parse Wed Jul 25 11:21:55 2012 +0100 +++ b/tools/libxl/check-xl-disk-parse Wed Jul 25 17:00:00 2012 +0100 @@ -125,6 +125,10 @@ one 0 ,hdc:cdrom,r one 0 vdev=hdc,access=r,devtype=cdrom,target= expected <readwrite = 0; if (!disk->pdev_path || !strcmp(disk->pdev_path, "")) disk->format = LIBXL_DISK_FORMAT_EMPTY; + } else if (disk->format == LIBXL_DISK_FORMAT_EMPTY) { + disk->format = LIBXL_DISK_FORMAT_RAW; } if (!disk->vdev) { diff -r 097bf63027e0 tools/libxl/libxlu_disk_l.c --- a/tools/libxl/libxlu_disk_l.c Wed Jul 25 11:21:55 2012 +0100 +++ b/tools/libxl/libxlu_disk_l.c Wed Jul 25 17:00:00 2012 +0100 @@ -1379,8 +1379,8 @@ YY_RULE_SETUP /* previous errors may just lead to subsequent ones */ } else if (!DPC->disk->pdev_path) { SAVESTRING("target", pdev_path, yytext); - if (!strcmp(DPC->disk->pdev_path, "")) - DPC->disk->format = LIBXL_DISK_FORMAT_EMPTY; + if (!strcmp(DPC->disk->pdev_path, "")) + DPC->disk->format = LIBXL_DISK_FORMAT_EMPTY; } else if (!DPC->had_depr_prefix && DPC->disk->format == LIBXL_DISK_FORMAT_UNKNOWN) { setformat(DPC,yytext); diff -r 097bf63027e0 tools/libxl/libxlu_disk_l.l --- a/tools/libxl/libxlu_disk_l.l Wed Jul 25 11:21:55 2012 +0100 +++ b/tools/libxl/libxlu_disk_l.l Wed Jul 25 17:00:00 2012 +0100 @@ -192,8 +192,8 @@ phy:/.* { DPC->had_depr_prefix=1; DEPRE /* previous errors may just lead to subsequent ones */ } else if (!DPC->disk->pdev_path) { SAVESTRING("target", pdev_path, yytext); - if (!strcmp(DPC->disk->pdev_path, "")) - DPC->disk->format = LIBXL_DISK_FORMAT_EMPTY; + if (!strcmp(DPC->disk->pdev_path, "")) + DPC->disk->format = LIBXL_DISK_FORMAT_EMPTY; } else if (!DPC->had_depr_prefix && DPC->disk->format == LIBXL_DISK_FORMAT_UNKNOWN) { setformat(DPC,yytext);