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

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]