[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] The issue about parameters(uint64) of a device are trea
From: |
Eric Blake |
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 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
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
signature.asc
Description: OpenPGP digital signature