Re: [PATCH v2 2/2] qemu: add support for -device pvpanic

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

 



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@xxxxxxxxxxxxxx>
> ---
>  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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]