[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL 078/103] memory: add error propagation to file-ba
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PULL 078/103] memory: add error propagation to file-based RAM allocation |
Date: |
Tue, 17 Jun 2014 14:49:38 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 |
On 06/17/2014 11:41 AM, Michael S. Tsirkin wrote:
> From: Paolo Bonzini <address@hidden>
>
> Right now, -mem-path will fall back to RAM-based allocation in some
> cases. This should never happen with "-object memory-file", prepare
> the code by adding correct error propagation.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> Signed-off-by: Hu Tao <address@hidden>
> Acked-by: Michael S. Tsirkin <address@hidden>
> ---
> @@ -1035,7 +1036,8 @@ static void *file_ram_alloc(RAMBlock *block,
> }
>
> if (kvm_enabled() && !kvm_has_sync_mmu()) {
> - fprintf(stderr, "host lacks kvm mmu notifiers, -mem-path
> unsupported\n");
> + error_setg(errp,
> + "host lacks kvm mmu notifiers, -mem-path unsupported\n");
Please drop the trailing \n in a followup patch.
> ram_addr_t qemu_ram_alloc_from_file(ram_addr_t size, MemoryRegion *mr,
> - const char *mem_path)
> + const char *mem_path,
> + Error **errp)
> {
> RAMBlock *new_block;
>
> if (xen_enabled()) {
> - fprintf(stderr, "-mem-path not supported with Xen\n");
> - exit(1);
> + error_setg(errp, "-mem-path not supported with Xen\n");
> + return -1;
> }
>
> if (phys_mem_alloc != qemu_anon_ram_alloc) {
> @@ -1280,16 +1286,22 @@ ram_addr_t qemu_ram_alloc_from_file(ram_addr_t size,
> MemoryRegion *mr,
> * phys_mem_alloc, but we haven't bothered to provide
> * a hook there.
> */
> - fprintf(stderr,
> - "-mem-path not supported with this accelerator\n");
> - exit(1);
> + error_setg(errp,
> + "-mem-path not supported with this accelerator\n");
Two more instances.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PULL 067/103] man: improve -numa doc, (continued)
- [Qemu-devel] [PULL 067/103] man: improve -numa doc, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 069/103] numa: introduce memory_region_allocate_system_memory, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 070/103] memory: reorganize file-based allocation, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 071/103] memory: move preallocation code out of exec.c, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 072/103] memory: move RAM_PREALLOC_MASK to exec.c, rename, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 073/103] configure: add Linux libnuma detection, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 074/103] Introduce signed range., Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 075/103] qom: introduce object_property_get_enum and object_property_get_uint16List, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 076/103] numa: add -numa node,memdev= option, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 078/103] memory: add error propagation to file-based RAM allocation, Michael S. Tsirkin, 2014/06/17
- Re: [Qemu-devel] [PULL 078/103] memory: add error propagation to file-based RAM allocation,
Eric Blake <=
- [Qemu-devel] [PULL 079/103] vl: redo -object parsing, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 080/103] pc: pass MachineState to pc_memory_init, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 081/103] backend:hostmem: replace hostmemory with host_memory, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 082/103] hostmem: separate allocation from UserCreatable complete method, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 083/103] hostmem: add file-based HostMemoryBackend, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 077/103] memory: move mem_path handling to memory_region_allocate_system_memory, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 084/103] hostmem: add merge and dump properties, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 085/103] hostmem: allow preallocation of any memory region, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 089/103] hmp: add info memdev, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 090/103] tests: fix memory leak in test of string input visitor, Michael S. Tsirkin, 2014/06/17