On Wed, Jun 17, 2015 at 05:04:37PM +0200, Igor Mammedov wrote: > On Wed, 17 Jun 2015 10:14:00 +0200 > Paolo Bonzini <pbonz...@redhat.com> wrote: > > > > > > > On 09/06/2015 12:08, Igor Mammedov wrote: > > > > > > 3. until #2 is done we can't allow to map another memory region in > > > current flatview at the same range, hence need to keep list of > > > still active HVA ranges so we could check at > > > memory_region_add_subregion() > > > time that new mapping is allowed. => adding "Error **errp" > > > to memory_region_add_subregion() for reporting fail. > > > > No, we cannot do that. memory_region_add_subregion cannot fail. The > > RCU mechanism is transparent. > So what are the options? > > Actually memory_region_add_subregion(cannot fail) will continue to casue > problems > in case one of the listeners fails and has no way to propagate error up the > stack. > It could be that vhost_set_memory() or kvm_set_memslots() aren't able to > allocate > memory for replacement table in low memory conditions and without > way to report back QEMU is left with option to die.
mmap reserving memory just adds it to a data structure somewhere within glibc, doesn't it? Looks like it's highly unlikely to fail, so maybe killing QEMU if it does isn't a big deal. > > > > Paolo