kvm/apic: use QOM style

Change apic and kvm/apic to use QOM interface.

Includes:
1. APICCommonState now use QOM realizefn
2. Remove DO_UPCAST() for APICCommonState
3. Use type constant
4. Change DeviceState pointers from 'd' to 'dev', sounds better?

Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>
ioapic use QOM style

Change intc/ioapic kvm/ioapic to use QOM' realizefn.
To achive this, I move variable 'ioapic_no' from static to global.
Then, ioapic_realize and kvm_ioapic_realize can drop the 'instance_no' argument.  Instead of parent, child increase ioapic_no now.

Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>