qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH 02/10] Fix errors and warnings while compili


From: Tomoki Sekiyama
Subject: Re: [Qemu-devel] [RFC PATCH 02/10] Fix errors and warnings while compiling with c++ compilier
Date: Fri, 15 Feb 2013 12:56:37 +0900
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130107 Thunderbird/17.0.2

On 2013/02/14 21:27, Luiz Capitulino wrote:
> On Thu, 14 Feb 2013 15:10:36 +0900
> Tomoki Sekiyama <address@hidden> wrote:
> 
>> Rename 'class' member in class_info of PciDeviceInfo to 'dev_class', and
>> add some casts to avoid errors from c++ compiler.
> 
> [...]
> 
>>  #
>>  # @class_info.desc: #optional a string description of the device's class
>>  #
>> -# @class_info.class: the class code of the device
>> +# @class_info.dev_class: the class code of the device
>>  #
>>  # @id.device: the PCI device id
>>  #
>> @@ -1171,7 +1171,7 @@
>>  ##
>>  { 'type': 'PciDeviceInfo',
>>    'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
>> -           'class_info': {'*desc': 'str', 'class': 'int'},
>> +           'class_info': {'*desc': 'str', 'dev_class': 'int'},
>>             'id': {'device': 'int', 'vendor': 'int'},
>>             '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
>>             'regions': ['PciMemoryRegion']} }
> 
> The right way of doing this is to add 'class' to the set of reserved
> words in scripts/qapi.py:c_var(). Then you'll have to adapt the code to
> use the 'q_' prefix.

Thank you for the information, I will try that.

> Now, is using C++ required? Why can't you use plain C?

It is because Windows COM+ framework (which VSS uses) is designed based
on C++ objective programming interface. Implementing this with plain C
is theoretically possible, but that will require parsing C++ objects'
vtables manually so the code would be much complex.
(However, It might be possible to push Windows-specific C++ stuff into
 a DLL to and avoid involving qemu related headers.)

Thanks,
-- 
Tomoki Sekiyama




reply via email to

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