From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JBdkH-0002Vu-Tw for qemu-devel@nongnu.org; Sun, 06 Jan 2008 17:13:29 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JBdkG-0002VK-8a for qemu-devel@nongnu.org; Sun, 06 Jan 2008 17:13:28 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JBdkG-0002V9-0O for qemu-devel@nongnu.org; Sun, 06 Jan 2008 17:13:28 -0500 Received: from atlas.linux2go.dk ([88.198.22.52]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JBdkF-0005Ir-Na for qemu-devel@nongnu.org; Sun, 06 Jan 2008 17:13:28 -0500 Date: Sun, 6 Jan 2008 23:13:26 +0100 From: Soren Hansen Message-ID: <20080106221326.GF1707@atlas.linux2go.dk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2ACoA+UkOTYEMozL" Content-Disposition: inline Subject: [Qemu-devel] [PATCH] SCSI support for vmdk images 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 --2ACoA+UkOTYEMozL Content-Type: multipart/mixed; boundary="Ee0603b/+xKyHz99" Content-Disposition: inline --Ee0603b/+xKyHz99 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I just noticed this patch, I've had lying around for a while, but forgot to send here. --=20 Soren Hansen Ubuntu Server Team http://www.ubuntu.com/ --Ee0603b/+xKyHz99 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="vmdk-scsi.diff" Content-Transfer-Encoding: quoted-printable =3D=3D=3D modified file 'block-vmdk.c' --- block-vmdk.c 2007-11-11 02:51:15 +0000 +++ block-vmdk.c 2008-01-06 21:18:57 +0000 @@ -717,7 +717,7 @@ "ddb.geometry.cylinders =3D \"%lu\"\n" "ddb.geometry.heads =3D \"16\"\n" "ddb.geometry.sectors =3D \"63\"\n" - "ddb.adapterType =3D \"ide\"\n"; + "ddb.adapterType =3D \"%s\"\n"; char desc[1024]; const char *real_filename, *temp_str; =20 @@ -790,7 +790,7 @@ if ((temp_str =3D strrchr(real_filename, ':')) !=3D NULL) real_filename =3D temp_str + 1; sprintf(desc, desc_template, time(NULL), (unsigned long)total_size, - real_filename, (flags & BLOCK_FLAG_COMPAT6 ? 6 : 4), total_siz= e / (63 * 16)); + real_filename, (flags & BLOCK_FLAG_COMPAT6 ? 6 : 4), total_siz= e / (63 * 16), (flags & BLOCK_FLAG_SCSI ? "lsilogic" : "ide")); =20 /* write the descriptor */ lseek(fd, le64_to_cpu(header.desc_offset) << 9, SEEK_SET); =3D=3D=3D modified file 'block_int.h' --- block_int.h 2007-12-24 16:10:43 +0000 +++ block_int.h 2008-01-06 21:18:57 +0000 @@ -29,6 +29,7 @@ #define BLOCK_FLAG_ENCRYPT 1 #define BLOCK_FLAG_COMPRESS 2 #define BLOCK_FLAG_COMPAT6 4 +#define BLOCK_FLAG_SCSI 8=20 =20 struct BlockDriver { const char *format_name; =3D=3D=3D modified file 'qemu-img.c' --- qemu-img.c 2008-01-06 17:21:48 +0000 +++ qemu-img.c 2008-01-06 22:04:55 +0000 @@ -88,9 +88,9 @@ "QEMU disk image utility\n" "\n" "Command syntax:\n" - " create [-e] [-6] [-b base_image] [-f fmt] filename [size]\n" + " create [-e] [-6] [-s] [-b base_image] [-f fmt] filename [siz= e]\n" " commit [-f fmt] filename\n" - " convert [-c] [-e] [-6] [-f fmt] filename [filename2 [...]] [= -O output_fmt] output_filename\n" + " convert [-c] [-e] [-6] [-s] [-f fmt] filename [-O output_fmt= ] output_filename\n" " info [-f fmt] filename\n" "\n" "Command parameters:\n" @@ -105,6 +105,7 @@ " '-c' indicates that target image must be compressed (qcow fo= rmat only)\n" " '-e' indicates that the target image must be encrypted (qcow= format only)\n" " '-6' indicates that the target image must use compatibility = level 6 (vmdk format only)\n" + " '-s' indicates that the target image must use of type SCSI (= vmdk format only)\n" ); printf("\nSupported format:"); bdrv_iterate_format(format_print, NULL); @@ -261,6 +262,9 @@ case '6': flags |=3D BLOCK_FLAG_COMPAT6; break; + case 's': + flags |=3D BLOCK_FLAG_SCSI; + break; } } if (optind >=3D argc) @@ -297,6 +301,8 @@ printf(", encrypted"); if (flags & BLOCK_FLAG_COMPAT6) printf(", compatibility level=3D6"); + if (flags & BLOCK_FLAG_SCSI) + printf(", type=3Dscsi"); if (base_filename) { printf(", backing_file=3D%s", base_filename); @@ -473,6 +479,8 @@ error("Encryption not supported for this file format"); if (flags & BLOCK_FLAG_COMPAT6 && drv !=3D &bdrv_vmdk) error("Alternative compatibility level not supported for this file= format"); + if (flags & BLOCK_FLAG_SCSI && drv !=3D &bdrv_vmdk) + error("SCSI disks are not supported for this file format"); if (flags & BLOCK_FLAG_ENCRYPT && flags & BLOCK_FLAG_COMPRESS) error("Compression and encryption not supported at the same time"); =20 --Ee0603b/+xKyHz99-- --2ACoA+UkOTYEMozL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFHgVKGonjfXui9pOMRAvpMAKCj9ObG/lBIZo/vYUHNqBpVTDGEiwCfbDmh xhfrFRNJE14EmOHqQIvf+sA= =Hlrb -----END PGP SIGNATURE----- --2ACoA+UkOTYEMozL--