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] Added an option to set the VMDK adapter type
Date: Wed, 04 Aug 2010 12:30:04 +0200	[thread overview]
Message-ID: <4C59412C.3080707@redhat.com> (raw)
In-Reply-To: <AANLkTinLdLuTD02aAPezj=WgnDzm3yggg+1xz+=RxGb5@mail.gmail.com>

Hi Aaron,

Am 04.08.2010 01:46, schrieb Aaron Mason:
> Now that I have half a clue, please find attached a properly formatted
> patch for the above with a signed-off line.  Hopefully attaching it
> won't cause issues as I have winblows on this machine and can't get
> git send-email to work at this time.

Works for me, though it would be even better to attach it for applying
and inlining it additionally to make it easier to quote.

One more round of changes and I think we've got it:

> From 37bed87750573b7ac737c3f2a919b68a06a00513 Mon Sep 17 00:00:00 2001
> From: unknown <aaron.mason@.rlpb.org.au>

You should tell git your real name and mail address in its config file.
You can use git commit --amend --reset-author to update the existing commit.

> Date: Wed, 4 Aug 2010 08:41:38 +1000
> Subject: [PATCH] Added an option to set the VMDK adapter type
> 
> Signed-off-by: Aaron Mason <aaron.mason@thats-too-much.info>
> ---
>  block/vmdk.c |   20 +++++++++++++++++---
>  block_int.h  |    1 +
>  2 files changed, 18 insertions(+), 3 deletions(-)
> 
> diff --git a/block/vmdk.c b/block/vmdk.c
> index 2d4ba42..ef7733d 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, *adapterType = "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") || 

This line has trailing whitespace.

> +                    !strcmp(options->value.s, "buslogic") ||
> +                    !strcmp(options->value.s, "lsilogic")) {
> +                    adapterType = options->value.s;
> +                } else
> +                    return -1;

Please add braces even for single statements, see CODING_STYLE.

Also better return -EINVAL as the return value is used as a negative
errno to produce the error message.

Kevin

  parent reply	other threads:[~2010-08-04 10:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-03 23:46 [Qemu-devel] [PATCH] Added an option to set the VMDK adapter type Aaron Mason
2010-08-04  7:16 ` Natalia Portillo
2010-08-04 10:30 ` Kevin Wolf [this message]
2010-08-04 12:27   ` andrzej zaborowski
2010-08-04 12:29     ` Kevin Wolf
  -- strict thread matches above, loose matches on Subject: below --
2010-08-04 21:07 Aaron Mason
     [not found] <3621879199971178442@unknownmsgid>
2010-08-06 11:40 ` Aaron Mason

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=4C59412C.3080707@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).