qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 05/34] add memdev backend infrastructure


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v3 05/34] add memdev backend infrastructure
Date: Thu, 29 May 2014 10:41:32 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 05/27/2014 07:01 AM, Igor Mammedov wrote:
> Provides framework for splitting host RAM allocation/
> policies into a separate backend that could be used
> by devices.
> 
> Initially only legacy RAM backend is provided, which
> uses memory_region_init_ram() allocator and compatible
> with every CLI option that affects memory_region_init_ram().
> 
> Signed-off-by: Igor Mammedov <address@hidden>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> v4:
>  - don't use nonexisting anymore error_is_set()
> v3:
>  - fix path leak & use object_get_canonical_path_component()
>    for getting object name
> v2:
>  - reuse UserCreatable interface instead of custom callbacks
> ---

> +++ b/backends/hostmem-ram.c
> @@ -0,0 +1,54 @@
> +/*
> + * QEMU Host Memory Backend
> + *
> + * Copyright (C) 2013 Red Hat Inc

This patch has been in the queue for a while.  Is it worth listing
2013-2014 here and in other new files?


> +hostmemory_backend_set_size(Object *obj, Visitor *v, void *opaque,
> +                            const char *name, Error **errp)
> +{
> +    HostMemoryBackend *backend = MEMORY_BACKEND(obj);
> +    Error *local_err = NULL;
> +    uint64_t value;
> +
> +    if (memory_region_size(&backend->mr)) {
> +        error_setg(&local_err, "cannot change property value\n");

Error messages should not include trailing newline.

> +        goto out;
> +    }
> +
> +    visit_type_size(v, &value, name, errp);
> +    if (local_err) {

local_err is guaranteed NULL at this point.  Or did you mean to pass
&local_err instead of errp to visit_type_size?

> +        goto out;
> +    }
> +    if (!value) {
> +        error_setg(&local_err, "Property '%s.%s' doesn't take value '%"
> +                   PRIu64 "'", object_get_typename(obj), name , value);

No space before comma.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]