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-changelog

[Xen-changelog] [xen-unstable] libxl: only check size of regular files w

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxl: only check size of regular files when validating a virtual disk
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Sat, 29 Jan 2011 15:05:32 -0800
Delivery-date: Sat, 29 Jan 2011 15:10:08 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1296042472 0
# Node ID 00e1fd80e1f7a9c14f86020ed24fcbc35c772606
# Parent  16c863cb99f253bcc404a381920b46e9389484bd
libxl: only check size of regular files when validating a virtual disk

st_size is only valid for regular files and not block devices.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/libxl/libxl.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -r 16c863cb99f2 -r 00e1fd80e1f7 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Wed Jan 26 08:56:44 2011 +0000
+++ b/tools/libxl/libxl.c       Wed Jan 26 11:47:52 2011 +0000
@@ -850,7 +850,7 @@ static int validate_virtual_disk(libxl_c
                 file_name);
             return ERROR_INVAL;
         }
-    } else if ( stat_buf.st_size == 0 ) {
+    } else if ( S_ISREG(stat_buf.st_mode) && stat_buf.st_size == 0 ) {
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Virtual disk %s size is 0!\n", 
file_name);
         return ERROR_INVAL;
     }

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] libxl: only check size of regular files when validating a virtual disk, Xen patchbot-unstable <=