[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
signature.asc
Description: OpenPGP digital signature
[Qemu-devel] [PATCH v3 04/34] vl.c: daemonize before guest memory allocation, Igor Mammedov, 2014/05/27
[Qemu-devel] [PATCH v3 06/34] vl.c: extend -m option to support options for memory hotplug, Igor Mammedov, 2014/05/27
[Qemu-devel] [PATCH v3 01/34] machine: Conversion of QEMUMachineInitArgs to MachineState, Igor Mammedov, 2014/05/27
[Qemu-devel] [PATCH v3 07/34] pc: create custom generic PC machine type, Igor Mammedov, 2014/05/27
[Qemu-devel] [PATCH v3 09/34] qdev: expose DeviceState.hotplugged field as a property, Igor Mammedov, 2014/05/27