Re: [PATCHv2 08/13] qemu: Extract code to setup memory backing objects

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

 



On Fri, Jan 30, 2015 at 11:34:31AM +0100, Peter Krempa wrote:
> Extract the memory backend device code into a separate function so that
> it can be later easily refactored and reused.
> 
> Few small changes for future reusability, namely:
> - new (currently unused) parameter for user specified page size
> - size of the memory is specified in kibibytes, divided up in the
> function
> - new (currently unused) parameter for user specifed source nodeset
> - option to enforce capability check
> ---
>  src/qemu/qemu_command.c | 382 +++++++++++++++++++++++++++++++-----------------
>  1 file changed, 250 insertions(+), 132 deletions(-)
> 

> +
> +    if (virBufferCheckError(&buf) < 0)
> +        goto cleanup;
> +
> +    *backendStr = virBufferContentAndReset(&buf);
> +
> +    if (!hugepage) {
> +        if ((nodemask || force) &&
> +            !virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_RAM)) {
> +            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> +                           _("this qemu doesn't support the "
> +                             "memory-backend-ram object"));
> +                goto cleanup;
> +        }

This check wasn't present in the old function. It would be nicer to do
code movement from new code.

Jan

Attachment: signature.asc
Description: 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]