WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 4 of 7] libxl: only a CDROM type disk can be empty

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 4 of 7] libxl: only a CDROM type disk can be empty
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Thu, 07 Apr 2011 10:52:30 +0100
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Thu, 07 Apr 2011 02:57:10 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1302169946@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1302169946@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.6.4
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1302167211 -3600
# Node ID cbf6ec01faef6502845d8201a717edc9fa6fae52
# Parent  f5418873be3d097cbb374009898ce9c74255e047
libxl: only a CDROM type disk can be empty.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r f5418873be3d -r cbf6ec01faef tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Thu Apr 07 10:06:36 2011 +0100
+++ b/tools/libxl/libxl.c       Thu Apr 07 10:06:51 2011 +0100
@@ -908,8 +908,13 @@ static int validate_virtual_disk(libxl__
     struct stat stat_buf;
     char *delimiter;
 
-    if (disk->format == DISK_FORMAT_EMPTY)
-        return 0;
+    if (disk->format == DISK_FORMAT_EMPTY) {
+        if (disk->is_cdrom)
+            return 0;
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Empty disk %s is not a CDROM 
device\n",
+                   disk->vdev);
+        return ERROR_INVAL;
+    }
 
     if (disk->format == DISK_FORMAT_RAW) {
         delimiter = strchr(file_name, ':');

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel