apic: convert to qdev