Skip to contentSkip to conversation

restore rw support for vvfat

PATCH In review Carlo Marcelo Arenas Belon 2 participants 2 messages Mar 11, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 restore rw support for vvfat

The attached patch, restores support for writable block devices using Virtual FAT disk images.

RW support using a generated qcow base image was modified after qemu 0.8.2 was released; while adding AIO support to block-qcow.c in release 1.8; and resulting in a broken qcow image based in an inexistent "fat:" base when "fat:rw" was requested.

Carlo

Index: block-qcow.c
===================================================================
RCS file: /sources/qemu/qemu/block-qcow.c,v
retrieving revision 1.15

block-qcow.c +9 -5
diff -u -r1.15 block-qcow.c
@@ -752,11 +752,15 @@
     header_size = sizeof(header);
     backing_filename_len = 0;
     if (backing_file) {
-        header.backing_file_offset = cpu_to_be64(header_size);
-        backing_filename_len = strlen(backing_file);
-        header.backing_file_size = cpu_to_be32(backing_filename_len);
-        header_size += backing_filename_len;
-        header.mtime = cpu_to_be32(0);
+        if (strcmp(backing_file, "fat:")) {
+            header.backing_file_offset = cpu_to_be64(header_size);
+            backing_filename_len = strlen(backing_file);
+            header.backing_file_size = cpu_to_be32(backing_filename_len);
+            header_size += backing_filename_len;
+        } else {
+            /* special backing file for vvfat */
+            backing_file = NULL;
+        }
         header.cluster_bits = 9; /* 512 byte cluster to avoid copying
                                     unmodifyed sectors */
         header.l2_bits = 12; /* 32 KB L2 tables */
Acked-by on v1 1/1
#1 lore raw

Hi,

Quoted 7 lines · Carlo Marcelo Arenas Belon

The attached patch, restores support for writable block devices using Virtual FAT disk images.

RW support using a generated qcow base image was modified after qemu 0.8.2 was released; while adding AIO support to block-qcow.c in release 1.8; and resulting in a broken qcow image based in an inexistent "fat:" base when "fat:rw" was requested.

Thanks,
Dscho