From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JYzN7-0000xT-11 for qemu-devel@nongnu.org; Tue, 11 Mar 2008 03:58:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JYzN5-0000wx-Ib for qemu-devel@nongnu.org; Tue, 11 Mar 2008 03:58:04 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYzN5-0000wu-Dr for qemu-devel@nongnu.org; Tue, 11 Mar 2008 03:58:03 -0400 Received: from tapir.sajinet.com.pe ([66.139.79.212]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JYzN5-0002FW-0v for qemu-devel@nongnu.org; Tue, 11 Mar 2008 03:58:03 -0400 Date: Tue, 11 Mar 2008 03:12:52 -0500 From: Carlo Marcelo Arenas Belon Message-ID: <20080311081252.GA25527@tapir> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="envbJBWh7q8WU6mo" Content-Disposition: inline Subject: [Qemu-devel] [PATCH] restore rw support for vvfat Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --envbJBWh7q8WU6mo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --envbJBWh7q8WU6mo Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="qemu-vvfat-rw.patch" Index: block-qcow.c =================================================================== RCS file: /sources/qemu/qemu/block-qcow.c,v retrieving revision 1.15 diff -u -r1.15 block-qcow.c --- block-qcow.c 11 Nov 2007 02:51:16 -0000 1.15 +++ block-qcow.c 11 Mar 2008 07:29:00 -0000 @@ -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 */ --envbJBWh7q8WU6mo--