Re: [PATCH v5 09/11] nvdimm: qemu command-line generating for pmem property

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

 



$SUBJ:

qemu: Add command-line to generate the nvdimm pmem property


On 12/20/18 4:14 AM, Luyao Zhong wrote:
> According to the result parsing from xml, add pmem property
> into QEMU command line:
> 
> -object memory-backend-file,...[,pmem=on/off]

"pmem=on"

(off is never added).

> 
> Signed-off-by: Luyao Zhong <luyao.zhong@xxxxxxxxx>
> ---
>  src/qemu/qemu_command.c                            | 14 +++++++++
>  .../memory-hotplug-nvdimm-pmem.x86_64-latest.args  | 36 ++++++++++++++++++++++
>  tests/qemuxml2argvtest.c                           |  1 +
>  3 files changed, 51 insertions(+)
>  create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args
> 
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index eeb49de..6a06161 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -3412,6 +3412,20 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backendProps,
>              goto cleanup;
>      }
>  
> +    if (mem->nvdimmPmem) {
> +        if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE_PMEM)) {
> +            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> +                           _("pmem property is not available "

nvdimm pmem ...

> +                             "with this QEMU binary"));
> +            goto cleanup;
> +        }
> +        if (virJSONValueObjectAdd(props,
> +                                  "s:pmem",
> +                                  mem->nvdimmPmem ? "on" : "off",

Since when nvdimmPmem is false, we wouldn't get here, let's go with:

        if (virJSONValueObjectAdd(props, "s:pmem", "on", NULL) < 0)

I can adjust for you,

Reviewed-by: John Ferlan <jferlan@xxxxxxxxxx>

John

[...]

--
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]

  Powered by Linux