]> git.proxmox.com Git - qemu-server.git/blobdiff - vmtar.c
bump version to 2.0-72
[qemu-server.git] / vmtar.c
diff --git a/vmtar.c b/vmtar.c
index b1d84841a201103b6c4f7a60f3d6675e90804c8b..29160b8208dd0b14eec828853fe0e85e405fa774 100644 (file)
--- a/vmtar.c
+++ b/vmtar.c
@@ -402,7 +402,7 @@ dump_sparse_file (int fd, struct writebuffer *wbuf, struct sp_array *ma)
 
     while (bytes_left > 0) {
       size_t bufsize = (bytes_left > BLOCKSIZE) ? BLOCKSIZE : bytes_left;
-      size_t bytes_read;
+      ssize_t bytes_read;
 
       char *blkbuf = buffer_block (wbuf);
       if ((bytes_read = full_read (fd, blkbuf, bufsize)) < 0) {
@@ -530,7 +530,7 @@ main (int argc, char **argv)
     time_t ctime = fs.st_mtime;
 
     struct sp_array *ma = sparray_new();
-    if (sparse) {
+    if (sparse && !S_ISBLK(fs.st_mode)) {
       if (!scan_sparse_file (fd, ma)) {
        fprintf (stderr, "scanning '%s' failed\n", source); 
        exit (-1);