qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 06/16] net: Convert qdev_prop_vlan to peer with


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 06/16] net: Convert qdev_prop_vlan to peer with hub
Date: Tue, 24 Jul 2012 11:49:21 +0100

On Mon, Jul 23, 2012 at 9:07 PM, Laszlo Ersek <address@hidden> 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

[Prev in Thread] Current Thread [Next in Thread]