qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Aaron Mason <aaron.mason@thats-too-much.info>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] PATCH: Adding options to generate SCSI based VMDK images
Date: Wed, 28 Jul 2010 15:10:39 +0200	[thread overview]
Message-ID: <4C502C4F.8070103@redhat.com> (raw)
In-Reply-To: <AANLkTim35MUJLkgc4BqEXguMWR3Q9Fsuohj+84SvJSsY@mail.gmail.com>

Hi Aaron,

Am 28.07.2010 04:01, schrieb Aaron Mason:
> I tried this once before using command-line parameters and it was
> knocked back.  Someone made the mention of using options so I had a
> look and saw that it was really simple to do.
> 
> The following is a patch from the latest Git snapshot.  I have also
> attached it (in case it gets broken by Gmail) and uploaded it to
> http://milo.thats-too-much.info/qemu-vmdk_gen_scsi.patch (in case the
> mailing list prohibits attachments).

Needs a Signed-off-by line. Also please use "[PATCH]" instead of
"PATCH:" in the subject line so that git am automatically removes it
when applying the patch. You get a correctly formatted mail with git
format-patch.

And yes, your mailer has broken the patch, so adding the attachment was
a good idea (using git send-email would be even better, though).

> diff --git a/block/vmdk.c b/block/vmdk.c
> index 2d4ba42..b60d86f 100644
> --- a/block/vmdk.c
> +++ b/block/vmdk.c
> @@ -686,9 +686,9 @@ 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;
> +    const char *real_filename, *temp_str, *adapter_type = "ide";
>      int64_t total_size = 0;
>      const char *backing_file = NULL;
>      int flags = 0;
> @@ -702,6 +702,15 @@ 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_ADAPTER)) {
> +        if (options->value.s != NULL) {
> +            if (!strcmp(options->value.s, "ide") || \
> +                   !strcmp(options->value.s, "buslogic") || \
> +            !strcmp(options->value.s, "lsilogic")) {
> +            adapter_type = options->value.s;
> +        } else
> +            return -1;
> +        }

qemu uses four spaces for indentation, tabs are not allowed. Also, a \
at the end of a line is not needed.

The logic of the patch looks okay, so please send a v2 with just these
formal things fixed.

Kevin

      reply	other threads:[~2010-07-28 13:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-28  2:01 [Qemu-devel] PATCH: Adding options to generate SCSI based VMDK images Aaron Mason
2010-07-28 13:10 ` Kevin Wolf [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C502C4F.8070103@redhat.com \
    --to=kwolf@redhat.com \
    --cc=aaron.mason@thats-too-much.info \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).