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

Peter Krempa pkrempa at redhat.com
Mon Dec 2 10:15:17 UTC 2013


On 12/02/13 07:11, 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 at 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(+)
> 

...

> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index 763417f..6310bb2 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -9588,6 +9588,16 @@ qemuBuildCommandLine(virConnectPtr conn,
>          goto error;
>      }
>  
> +    if (def->pvpanic &&
> +        virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_PVPANIC)) {
> +        if (def->pvpanic->ioport > 0) {
> +            virCommandAddArg(cmd, "-device");
> +            virCommandAddArgFormat(cmd, "pvpanic,ioport=%d",
> +                                   def->pvpanic->ioport);
> +        } else
> +            virCommandAddArgList(cmd, "-device", "pvpanic", NULL);

If pvpanic is requested, but not available in qemu, libvirt should error
out instead of silently starting the VM without the device.

> +    }
> +
>      if (mlock) {
>          unsigned long long memKB;
>  
> 

Also as said in review of 1/2. You need to add tests for the new device.

Peter

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20131202/6e0bae69/attachment-0001.sig>


More information about the libvir-list mailing list