qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: lma@suse.com,
	"pbonzini@redhat.com >> Paolo Bonzini" <pbonzini@redhat.com>
Cc: "qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] The issue about parameters(uint64) of a device are treated as signed long int.
Date: Fri, 7 Aug 2015 06:09:06 -0600	[thread overview]
Message-ID: <55C49FE2.4030608@redhat.com> (raw)
In-Reply-To: <55C43A0D.9070000@suse.com>

[-- Attachment #1: Type: text/plain, Size: 942 bytes --]

On 08/06/2015 10:54 PM, Lin Ma wrote:
> Hi Paolo,
> 
> As mentioned in below email, The type of wwn is reported as uint64, But
> in qemu command line, The max valid value for wwn is
> 0x7fffffffffffffff. Obviously, it's treated as int64 there. I'd like to
> know that does the highest bit of  _world wide name_ have special
> meaning and must be zero? May I have your thoughts?

You can always pass a negative number to set the highest bit (that's
what libvirt does: when it is sending a uint64 value to qemu via command
line or QMP, it intentionally writes values larger than INT64_MAX by
first casting them to signed and writing the int64_t counterpart
instead). It's a shortcoming in our data parser, and not an actual
prohibition in values you can set.  And if you don't like the behavior,
patches are welcome.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

      reply	other threads:[~2015-08-07 12:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-31  8:28 [Qemu-devel] The issue about parameters(uint64) of a device are treated as signed long int Lin Ma
2015-08-07  4:54 ` Lin Ma
2015-08-07 12:09   ` Eric Blake [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=55C49FE2.4030608@redhat.com \
    --to=eblake@redhat.com \
    --cc=lma@suse.com \
    --cc=pbonzini@redhat.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).