qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Block: Support creation of SCSI VMDK images in qemu-img.
@ 2010-08-03 12:17 Alexander Graf
  2010-08-03 12:47 ` [Qemu-devel] " Kevin Wolf
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Graf @ 2010-08-03 12:17 UTC (permalink / raw)
  To: qemu-devel List; +Cc: Kevin Wolf

While looking through patches we have not upstreamed yet, I stumbled over this
trivial patch that Kevin created back in the day. It allows to specify the
creation of scsi type vmdk images.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 block/vmdk.c |   12 ++++++++++--
 block_int.h  |    2 ++
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/block/vmdk.c b/block/vmdk.c
index 2d4ba42..64f1c88 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -686,7 +686,7 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options)
         "ddb.geometry.cylinders = \"%" PRId64 "\"\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;
     int64_t total_size = 0;
@@ -702,6 +702,8 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options)
             backing_file = options->value.s;
         } else if (!strcmp(options->name, BLOCK_OPT_COMPAT6)) {
             flags |= options->value.n ? BLOCK_FLAG_COMPAT6: 0;
+        } else if (!strcmp(options->name, BLOCK_OPT_SCSI)) {
+            flags |= options->value.n ? BLOCK_FLAG_SCSI: 0;
         }
         options++;
     }
@@ -799,7 +801,8 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options)
     snprintf(desc, sizeof(desc), desc_template, (unsigned int)time(NULL),
              total_size, real_filename,
              (flags & BLOCK_FLAG_COMPAT6 ? 6 : 4),
-             total_size / (int64_t)(63 * 16));
+             total_size / (int64_t)(63 * 16),
+             flags & BLOCK_FLAG_SCSI ? "lsilogic" : "ide");
 
     /* write the descriptor */
     lseek(fd, le64_to_cpu(header.desc_offset) << 9, SEEK_SET);
@@ -845,6 +848,11 @@ static QEMUOptionParameter vmdk_create_options[] = {
         .type = OPT_FLAG,
         .help = "VMDK version 6 image"
     },
+    {
+        .name = BLOCK_OPT_SCSI,
+        .type = OPT_FLAG,
+        .help = "SCSI image"
+    },
     { NULL }
 };
 
diff --git a/block_int.h b/block_int.h
index b863451..01ba00e 100644
--- a/block_int.h
+++ b/block_int.h
@@ -31,10 +31,12 @@
 #define BLOCK_FLAG_ENCRYPT	1
 #define BLOCK_FLAG_COMPRESS	2
 #define BLOCK_FLAG_COMPAT6	4
+#define BLOCK_FLAG_SCSI		8
 
 #define BLOCK_OPT_SIZE          "size"
 #define BLOCK_OPT_ENCRYPT       "encryption"
 #define BLOCK_OPT_COMPAT6       "compat6"
+#define BLOCK_OPT_SCSI          "scsi"
 #define BLOCK_OPT_BACKING_FILE  "backing_file"
 #define BLOCK_OPT_BACKING_FMT   "backing_fmt"
 #define BLOCK_OPT_CLUSTER_SIZE  "cluster_size"
-- 
1.6.0.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] Re: [PATCH] Block: Support creation of SCSI VMDK images in qemu-img.
  2010-08-03 12:17 [Qemu-devel] [PATCH] Block: Support creation of SCSI VMDK images in qemu-img Alexander Graf
@ 2010-08-03 12:47 ` Kevin Wolf
  2010-08-03 13:13   ` Alexander Graf
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Wolf @ 2010-08-03 12:47 UTC (permalink / raw)
  To: Alexander Graf; +Cc: Aaron Mason, qemu-devel List

Hi Alex,

Am 03.08.2010 14:17, schrieb Alexander Graf:
> While looking through patches we have not upstreamed yet, I stumbled over this
> trivial patch that Kevin created back in the day. It allows to specify the
> creation of scsi type vmdk images.
> 
> Signed-off-by: Alexander Graf <agraf@suse.de>

Aaron (CCed) sent a similar patch only a few days ago (subject
"[Qemu-devel] PATCH: Adding options to generate SCSI based VMDK
images"). The only difference I see is that his option went like
interface=[ide|lsilogic|buslogic] instead of hard-coding lsilogic. I
think this is a better interface.

Aaron, I asked you to fix some formal things (including tabs and SoB),
but you haven't resubmitted the patch yet. Are you going to send a fixed
version, or should I rather take Alex' patch?

Kevin

> ---
>  block/vmdk.c |   12 ++++++++++--
>  block_int.h  |    2 ++
>  2 files changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/block/vmdk.c b/block/vmdk.c
> index 2d4ba42..64f1c88 100644
> --- a/block/vmdk.c
> +++ b/block/vmdk.c
> @@ -686,7 +686,7 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options)
>          "ddb.geometry.cylinders = \"%" PRId64 "\"\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;
>      int64_t total_size = 0;
> @@ -702,6 +702,8 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options)
>              backing_file = options->value.s;
>          } else if (!strcmp(options->name, BLOCK_OPT_COMPAT6)) {
>              flags |= options->value.n ? BLOCK_FLAG_COMPAT6: 0;
> +        } else if (!strcmp(options->name, BLOCK_OPT_SCSI)) {
> +            flags |= options->value.n ? BLOCK_FLAG_SCSI: 0;
>          }
>          options++;
>      }
> @@ -799,7 +801,8 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options)
>      snprintf(desc, sizeof(desc), desc_template, (unsigned int)time(NULL),
>               total_size, real_filename,
>               (flags & BLOCK_FLAG_COMPAT6 ? 6 : 4),
> -             total_size / (int64_t)(63 * 16));
> +             total_size / (int64_t)(63 * 16),
> +             flags & BLOCK_FLAG_SCSI ? "lsilogic" : "ide");
>  
>      /* write the descriptor */
>      lseek(fd, le64_to_cpu(header.desc_offset) << 9, SEEK_SET);
> @@ -845,6 +848,11 @@ static QEMUOptionParameter vmdk_create_options[] = {
>          .type = OPT_FLAG,
>          .help = "VMDK version 6 image"
>      },
> +    {
> +        .name = BLOCK_OPT_SCSI,
> +        .type = OPT_FLAG,
> +        .help = "SCSI image"
> +    },
>      { NULL }
>  };
>  
> diff --git a/block_int.h b/block_int.h
> index b863451..01ba00e 100644
> --- a/block_int.h
> +++ b/block_int.h
> @@ -31,10 +31,12 @@
>  #define BLOCK_FLAG_ENCRYPT	1
>  #define BLOCK_FLAG_COMPRESS	2
>  #define BLOCK_FLAG_COMPAT6	4
> +#define BLOCK_FLAG_SCSI		8
>  
>  #define BLOCK_OPT_SIZE          "size"
>  #define BLOCK_OPT_ENCRYPT       "encryption"
>  #define BLOCK_OPT_COMPAT6       "compat6"
> +#define BLOCK_OPT_SCSI          "scsi"
>  #define BLOCK_OPT_BACKING_FILE  "backing_file"
>  #define BLOCK_OPT_BACKING_FMT   "backing_fmt"
>  #define BLOCK_OPT_CLUSTER_SIZE  "cluster_size"

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] Re: [PATCH] Block: Support creation of SCSI VMDK images in qemu-img.
  2010-08-03 12:47 ` [Qemu-devel] " Kevin Wolf
@ 2010-08-03 13:13   ` Alexander Graf
  0 siblings, 0 replies; 5+ messages in thread
From: Alexander Graf @ 2010-08-03 13:13 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: Aaron Mason, qemu-devel List


Am 03.08.2010 um 14:47 schrieb Kevin Wolf <kwolf@redhat.com>:

> Hi Alex,
>
> Am 03.08.2010 14:17, schrieb Alexander Graf:
>> While looking through patches we have not upstreamed yet, I  
>> stumbled over this
>> trivial patch that Kevin created back in the day. It allows to  
>> specify the
>> creation of scsi type vmdk images.
>>
>> Signed-off-by: Alexander Graf <agraf@suse.de>
>
> Aaron (CCed) sent a similar patch only a few days ago (subject
> "[Qemu-devel] PATCH: Adding options to generate SCSI based VMDK
> images"). The only difference I see is that his option went like
> interface=[ide|lsilogic|buslogic] instead of hard-coding lsilogic. I
> think this is a better interface.

Oh, I must have missed that patch :). I'm reasonably indifferent on  
which approach gets upstream, as long as there will be a choice at  
all ;). And yes, I would also consider an interface= parameter superior.


Alex

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] RE: [PATCH] Block: Support creation of SCSI VMDK images in qemu-img.
@ 2010-08-03 13:57 Aaron Mason
  2010-08-03 14:32 ` [Qemu-devel] " Kevin Wolf
  0 siblings, 1 reply; 5+ messages in thread
From: Aaron Mason @ 2010-08-03 13:57 UTC (permalink / raw)
  To: Kevin Wolf, Alexander Graf; +Cc: qemu-devel List

Hi Kevin,

Yep, I'll be resubmitting that patch in the coming days.  I thought I'd nuked all of the tabs but neglected to check if I was editing the file in the git repo and not the 0.12.5 stable branch...

Also, I'm new to using git so I'm picking this up as I go along.  Expect a patch from me in the coming days.

Cheers

sent from my Telstra NEXTG™ handset

-----Original Message-----
From: Kevin Wolf <kwolf@redhat.com>
Sent: Tuesday, 3 August 2010 10:47 PM
To: Alexander Graf <agraf@suse.de>
Cc: qemu-devel List <qemu-devel@nongnu.org>; Aaron Mason <aaron.mason@thats-too-much.info>
Subject: Re: [PATCH] Block: Support creation of SCSI VMDK images in qemu-img.

Hi Alex,

Am 03.08.2010 14:17, schrieb Alexander Graf:
> While looking through patches we have not upstreamed yet, I stumbled over this
> trivial patch that Kevin created back in the day. It allows to specify the
> creation of scsi type vmdk images.
> 
> Signed-off-by: Alexander Graf <agraf@suse.de>

Aaron (CCed) sent a similar patch only a few days ago (subject
"[Qemu-devel] PATCH: Adding options to generate SCSI based VMDK
images"). The only difference I see is that his option went like
interface=[ide|lsilogic|buslogic] instead of hard-coding lsilogic. I
think this is a better interface.

Aaron, I asked you to fix some formal things (including tabs and SoB),
but you haven't resubmitted the patch yet. Are you going to send a fixed
version, or should I rather take Alex' patch?

Kevin

> ---
>  block/vmdk.c |   12 ++++++++++--
>  block_int.h  |    2 ++
>  2 files changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/block/vmdk.c b/block/vmdk.c
> index 2d4ba42..64f1c88 100644
> --- a/block/vmdk.c
> +++ b/block/vmdk.c
> @@ -686,7 +686,7 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options)
>          "ddb.geometry.cylinders = \"%" PRId64 "\"\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;
>      int64_t total_size = 0;
> @@ -702,6 +702,8 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options)
>              backing_file = options->value.s;
>          } else if (!strcmp(options->name, BLOCK_OPT_COMPAT6)) {
>              flags |= options->value.n ? BLOCK_FLAG_COMPAT6: 0;
> +        } else if (!strcmp(options->name, BLOCK_OPT_SCSI)) {
> +            flags |= options->value.n ? BLOCK_FLAG_SCSI: 0;
>          }
>          options++;
>      }
> @@ -799,7 +801,8 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *op

[The entire original message is not included]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] Re: [PATCH] Block: Support creation of SCSI VMDK images in qemu-img.
  2010-08-03 13:57 [Qemu-devel] " Aaron Mason
@ 2010-08-03 14:32 ` Kevin Wolf
  0 siblings, 0 replies; 5+ messages in thread
From: Kevin Wolf @ 2010-08-03 14:32 UTC (permalink / raw)
  To: Aaron Mason; +Cc: Alexander Graf, qemu-devel List

Hi Aaron,

Am 03.08.2010 15:57, schrieb Aaron Mason:
> Yep, I'll be resubmitting that patch in the coming days.  I thought I'd nuked all of the tabs but neglected to check if I was editing the file in the git repo and not the 0.12.5 stable branch...
> 
> Also, I'm new to using git so I'm picking this up as I go along.  Expect a patch from me in the coming days.

Alright, I'll wait for your patch then. Just wanted to make sure that we
don't end up applying no patch at all because people forget about it.

Kevin

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-08-03 14:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-03 12:17 [Qemu-devel] [PATCH] Block: Support creation of SCSI VMDK images in qemu-img Alexander Graf
2010-08-03 12:47 ` [Qemu-devel] " Kevin Wolf
2010-08-03 13:13   ` Alexander Graf
  -- strict thread matches above, loose matches on Subject: below --
2010-08-03 13:57 [Qemu-devel] " Aaron Mason
2010-08-03 14:32 ` [Qemu-devel] " Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).