On 12/01/2013 11:11 PM, Hu Tao wrote:
This patch will add -device pvpanic to qemu command line if user
enables
pvpanic in domain xml and the qemu version supports pvpanic.
Signed-off-by: Hu Tao <hutao(a)cn.fujitsu.com>
---
src/qemu/qemu_capabilities.c | 3 +++
src/qemu/qemu_capabilities.h | 2 ++
src/qemu/qemu_command.c | 10 ++++++++++
3 files changed, 15 insertions(+)
In addition to Peter's comments,
+++ b/src/qemu/qemu_capabilities.h
@@ -199,6 +199,8 @@ enum virQEMUCapsFlags {
QEMU_CAPS_DEVICE_ICH9_INTEL_HDA = 158, /* -device ich9-intel-hda */
QEMU_CAPS_KVM_PIT_TICK_POLICY = 159, /* kvm-pit.lost_tick_policy */
+ QEMU_CAPS_DEVICE_PVPANIC = 160, /* -device pvpanic */
Alignment looks odd here.
+ if (def->pvpanic &&
+ virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_PVPANIC)) {
+ if (def->pvpanic->ioport > 0) {
Again, is port 0 a valid port (given that you initialized it to -1)?
I know we haven't been doing a good job of domxml-from-native, but in
this particular case, can we also fix the command line parser to turn
'-device pvpanic' into the appropriate pvpanic device allocation?
+ } else
Style. If you used {} for 'if', you must also use it for 'else' (I'm
still not sure how to enforce it by syntax-check, but it's on my list of
things that would be nice to have).
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org