SCSI support for vmdk images
PATCH 1/1 SCSI support for vmdk images
I just noticed this patch, I've had lying around for a while, but forgot to send here.
Signature · 3 lines
Soren Hansen Ubuntu Server Team http://www.ubuntu.com/
=== modified file 'block-vmdk.c'
block-vmdk.c +2 -2
@@ -717,7 +717,7 @@"ddb.geometry.cylinders = \"%lu\"\n" "ddb.geometry.heads = \"16\"\n" "ddb.geometry.sectors = \"63\"\n" -"ddb.adapterType = \"ide\"\n" ; +"ddb.adapterType = \"%s\"\n" ;char desc[1024 ];const char *real_filename, *temp_str;
@@ -790,7 +790,7 @@if ((temp_str =strrchr (real_filename,':' )) !=NULL ) real_filename = temp_str +1 ;sprintf (desc, desc_template,time (NULL ), (unsigned long )total_size, - real_filename, (flags &BLOCK_FLAG_COMPAT6 ?6 :4 ), total_size / (63 *16 )); + real_filename, (flags &BLOCK_FLAG_COMPAT6 ?6 :4 ), total_size / (63 *16 ), (flags &BLOCK_FLAG_SCSI ?"lsilogic" :"ide" ));/* write the descriptor */ lseek (fd,le64_to_cpu (header.desc_offset) <<9 ,SEEK_SET );
=== modified file 'block_int.h'
block_int.h +1 -0
@@ -29,6 +29,7 @@#define BLOCK_FLAG_ENCRYPT 1#define BLOCK_FLAG_COMPRESS 2#define BLOCK_FLAG_COMPAT6 4 +#define BLOCK_FLAG_SCSI 8struct BlockDriver {const char *format_name;
=== modified file 'qemu-img.c'
qemu-img.c +10 -2
@@ -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 [size]\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 format 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 |=BLOCK_FLAG_COMPAT6 ;break ; +case 's' : + flags |=BLOCK_FLAG_SCSI ; +break ; } }if (optind >= argc)
@@ -297,6 +301,8 @@printf (", encrypted" );if (flags &BLOCK_FLAG_COMPAT6 )printf (", compatibility level=6" ); +if (flags &BLOCK_FLAG_SCSI ) +printf (", type=scsi" );if (base_filename) {printf (", backing_file=%s" , base_filename);
@@ -473,6 +479,8 @@error ("Encryption not supported for this file format" );if (flags &BLOCK_FLAG_COMPAT6 && drv != &bdrv_vmdk)error ("Alternative compatibility level not supported for this file format" ); +if (flags &BLOCK_FLAG_SCSI && drv != &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" );
Quoted 2 lines · On Sunday 06 January 2008 16:13:26 Soren Hansen wrote:
I just noticed this patch, I've had lying around for a while, but forgot to send here.
What does this do that the patch back in september didn't?
Rob
Signature · 2 lines
"One of my most productive days was throwing away 1000 lines of code." - Ken Thompson.