Skip to contentSkip to conversation

New Bee : What is the canonical path.

Qemu-devel boddu pavan 2 participants 3 messages Dec 9, 2014 – Dec 11, 2014

lore
Share & tools
lore
#0 lore raw

Hi,
I am new to qemu, And i need help in understanding a part of code,  Can any one tell the use of Canonical paths of the Object. Thanks,Sai Pavan

#1 lore raw
Quoted 4 lines · boddu pavan

Hi,

I am new to qemu, And i need help in understanding a part of code, Can any one tell the use of Canonical paths of the Object.

The use is mostly internal. Every time you set a property, you go through a "Visitor" that represents the value. The representations allowed by visitors are numbers, strings, booleans, etc.

When you want to set a property to an object, you actually need to set a property to a string, because Visitors support string values. So you use a "path". Typically you'll use a canonical path (though you can also use a non-canonical path). Canonical paths are formed by following properties of type child<Something>. Non-canonical paths are formed by following properties of type child<Something> or link<Something> (where Something is the name of a class type).

Similarly, when you read a property that has an object type, the property's value will be a path, and the getter for that property will always use a canonical path.

Paolo

#2 lore raw

Thanks Poalo, This was helpful.
Regards,Sai Pavan

On Wednesday, December 10, 2014 6:27 PM, Paolo Bonzini <[email protected]> wrote:

Quoted 4 lines · boddu pavan

Hi,

I am new to qemu, And i need help in understanding a part of code,  Can any one tell the use of Canonical paths of the Object.

The use is mostly internal.  Every time you set a property, you go through a "Visitor" that represents the value.  The representations allowed by visitors are numbers, strings, booleans, etc.

When you want to set a property to an object, you actually need to set a property to a string, because Visitors support string values.  So you use a "path".  Typically you'll use a canonical path (though you can also use a non-canonical path).  Canonical paths are formed by following properties of type child<Something>.  Non-canonical paths are formed by following properties of type child<Something> or link<Something> (where Something is the name of a class type).

Similarly, when you read a property that has an object type, the property's value will be a path, and the getter for that property will always use a canonical path.

Paolo