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

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

 



$SUBJ:

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

On 12/20/18 4:14 AM, Luyao Zhong wrote:
> According to the result parsing from xml, add align property
> into QEMU command line:
> 
> -object memory-backend-file,...[,align=xxx]
> 
> Signed-off-by: Luyao Zhong <luyao.zhong@xxxxxxxxx>
> ---
>  src/qemu/qemu_command.c                            | 14 +++++++++
>  .../memory-hotplug-nvdimm-align.x86_64-latest.args | 36 ++++++++++++++++++++++
>  tests/qemuxml2argvtest.c                           |  1 +
>  3 files changed, 51 insertions(+)
>  create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-latest.args
> 
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index 66a4a35..eeb49de 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -3398,6 +3398,20 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backendProps,
>      if (virJSONValueObjectAdd(props, "U:size", mem->size * 1024, NULL) < 0)
>          goto cleanup;
>  
> +    if (mem->alignsize) {
> +        if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE_ALIGN)) {
> +            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> +                           _("align property is not available "

nvdimm align

> +                             "with this QEMU binary"));
> +            goto cleanup;
> +        }
> +        if (virJSONValueObjectAdd(props,
> +                                  "U:align",
> +                                  mem->alignsize * 1024,
> +                                  NULL) < 0)

Since we'd be only going a little beyond 80 chars and this helper
already does it, let's just go with one line here:

        if (virJSONValueObjectAdd(props, "U:align", mem->alignsize *
1024, 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