On 06/17/2014 11:41 AM, Michael S. Tsirkin wrote: > From: Paolo Bonzini <pbonz...@redhat.com> > > 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 <pbonz...@redhat.com> > Signed-off-by: Hu Tao <hu...@cn.fujitsu.com> > Acked-by: Michael S. Tsirkin <m...@redhat.com> > ---
> @@ -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