qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Janne Karhunen <janne.karhunen@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Allow users to specify the vmdk virtual hardware version.
Date: Tue, 3 May 2016 08:49:21 +0800	[thread overview]
Message-ID: <20160503004921.GR1421@ad.usersys.redhat.com> (raw)
In-Reply-To: <CAE=NcrZb4CC6Lny2hqUF9yvbkOCgKMSAFPXL-4Sr0rULnC1T-g@mail.gmail.com>

On Mon, 05/02 04:30, Janne Karhunen wrote:
> >>      if (qemu_opt_get_bool_del(opts, BLOCK_OPT_COMPAT6, false)) {
> >> -        flags |= BLOCK_FLAG_COMPAT6;
> >
> > Please remove BLOCK_FLAG_COMPAT6 from include/block/block_int.h| as well.
> 
> Wasn't it removed?
> 
> -#define BLOCK_FLAG_COMPAT6          4

Yes you are right, it's my oversight. :)

> 
> 
> >> +        if (strcmp(hw_version, "4")) {
> >
> > Doesn't compat6 mean hw_version is 6? I think you want s/4/6/ here.
> 
> Yes and that's the functionality here. So the logic is that if
> BLOCK_OPT_COMPAT6 was defined and hw_version had something other than
> "4" we fail saying can't do both.
> 
> Test case:
> qemu-img convert -f vmdk -O vmdk img.vmdk img.vmdk-output
> ddb.virtualHWVersion = "4" (default)

Yes.

> 
> qemu-img convert -f vmdk -O vmdk -o compat6=on img.vmdk img.vmdk-output
> ddb.virtualHWVersion = "6" (compat6 default)

Yes.

> 
> qemu-img convert -f vmdk -O vmdk -o hwversion=9 img.vmdk img.vmdk-output
> ddb.virtualHWVersion = "9" (the new feature)

Yes.

But you get:

1)
    $ qemu-img create -f vmdk -o compat6=on,hwversion=4 /tmp/a.vmdk 1G; grep -a
    virtualHWVersion /tmp/a.vmdk Formatting '/tmp/a.vmdk', fmt=vmdk size=1073741824 compat6=on hwversion=4
    ddb.virtualHWVersion = "6"

which is wrong.

2) IMO if the documentation says "the options are mutually exclusive" instead
of "specific value combinations are invalid", this:

    $ qemu-img create -f vmdk -o compat6=off,hwversion=9 /tmp/a.vmdk 1G; grep -a virtualHWVersion /tmp/a.vmdk
    Formatting '/tmp/a.vmdk', fmt=vmdk size=1073741824 compat6=off hwversion=9
    ddb.virtualHWVersion = "9"

should better be rejected:

    $ qemu-img create -f vmdk -o compat6=off,hwversion=9 /tmp/a.vmdk 1G; grep -a virtualHWVersion /tmp/a.vmdk
    Formatting '/tmp/a.vmdk', fmt=vmdk size=1073741824 compat6=off hwversion=9
    qemu-img: /tmp/a.vmdk: compat6 and hwversion are mutually exclusive

1) is a bug in your code, and 2) is a documenting problem.

Fam

  reply	other threads:[~2016-05-03  0:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-21 19:29 [Qemu-devel] [PATCH] Allow users to specify the vmdk virtual hardware version Janne Karhunen
2016-04-29  7:41 ` Fam Zheng
2016-05-02 11:30   ` Janne Karhunen
2016-05-03  0:49     ` Fam Zheng [this message]
2016-05-03  9:45       ` Janne Karhunen
  -- strict thread matches above, loose matches on Subject: below --
2016-05-03  9:43 Janne Karhunen
2016-05-06  5:15 ` Janne Karhunen
2016-05-06  9:07   ` Fam Zheng
2016-05-06  9:04 ` Fam Zheng
2016-05-06 11:05   ` Kevin Wolf
2016-05-06 17:53     ` Janne Karhunen
2016-04-20 22:27 Janne Karhunen
2016-04-21  2:22 ` Fam Zheng
2016-04-21  3:02   ` Janne Karhunen
2016-04-21  3:26     ` Fam Zheng
2016-04-21  3:30       ` Janne Karhunen
2016-04-21  3:22   ` Janne Karhunen
2016-04-21  4:44     ` Fam Zheng
2016-04-22 15:23       ` Janne Karhunen
2016-04-25  0:45         ` Fam Zheng

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=20160503004921.GR1421@ad.usersys.redhat.com \
    --to=famz@redhat.com \
    --cc=janne.karhunen@gmail.com \
    --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).