On Mon, Jul 23, 2012 at 9:07 PM, Laszlo Ersek <ler...@redhat.com> wrote:
> On 07/20/12 14:01, Stefan Hajnoczi wrote:
>
>> @@ -638,11 +642,17 @@ static void get_vlan(Object *obj, Visitor *v, void 
>> *opaque,
>>  {
>>      DeviceState *dev = DEVICE(obj);
>>      Property *prop = opaque;
>> -    VLANState **ptr = qdev_get_prop_ptr(dev, prop);
>> -    int64_t id;
>> +    VLANClientState **ptr = qdev_get_prop_ptr(dev, prop);
>> +    int64_t id = -1;
>>
>> -    id = *ptr ? (*ptr)->id : -1;
>> -    visit_type_int64(v, &id, name, errp);
>> +    if (*ptr) {
>> +        unsigned int hub_id;
>> +        if (!net_hub_id_for_client(*ptr, &hub_id)) {
>> +            id = (int64_t)hub_id;
>> +        }
>> +    }
>> +
>> +    visit_type_int(v, &id, name, errp);
>>  }
>
> Should we use uint32 here? (No particular reason, just for "cleanliness"
> or whatever.)

As part of the int64_t -> uint32_t type cleanup we can change this.  I
think it's a safe change to make since no reasonable command-line
would make use of the silent 32-bit truncation.

Stefan

Reply via email to