[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/41] exec: check kvm mmu notifiers earlier
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 01/41] exec: check kvm mmu notifiers earlier |
Date: |
Thu, 15 Jun 2017 12:52:21 +0200 |
From: Marc-André Lureau <address@hidden>
Move kvm mmu notifiers check before calling file_ram_alloc(), with the
other xen precondition. (file_ram_alloc() will be reused in other cases
than -mem-path).
Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
exec.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/exec.c b/exec.c
index a93e209..a5be851 100644
--- a/exec.c
+++ b/exec.c
@@ -1495,12 +1495,6 @@ static void *file_ram_alloc(RAMBlock *block,
int fd = -1;
int64_t file_size;
- if (kvm_enabled() && !kvm_has_sync_mmu()) {
- error_setg(errp,
- "host lacks kvm mmu notifiers, -mem-path unsupported");
- return NULL;
- }
-
for (;;) {
fd = open(path, O_RDWR);
if (fd >= 0) {
@@ -1943,6 +1937,12 @@ RAMBlock *qemu_ram_alloc_from_file(ram_addr_t size,
MemoryRegion *mr,
return NULL;
}
+ if (kvm_enabled() && !kvm_has_sync_mmu()) {
+ error_setg(errp,
+ "host lacks kvm mmu notifiers, -mem-path unsupported");
+ return NULL;
+ }
+
if (phys_mem_alloc != qemu_anon_ram_alloc) {
/*
* file_ram_alloc() needs to allocate just like
--
1.8.3.1
- [Qemu-devel] [PULL 00/41] Misc patches for 2017-06-15, Paolo Bonzini, 2017/06/15
- [Qemu-devel] [PULL 01/41] exec: check kvm mmu notifiers earlier,
Paolo Bonzini <=
- [Qemu-devel] [PULL 03/41] exec: split qemu_ram_alloc_from_file(), Paolo Bonzini, 2017/06/15
- [Qemu-devel] [PULL 02/41] exec: split file_ram_alloc(), Paolo Bonzini, 2017/06/15
- [Qemu-devel] [PULL 04/41] Add memory_region_init_ram_from_fd(), Paolo Bonzini, 2017/06/15
- [Qemu-devel] [PULL 08/41] megasas: do not read sense length more than once from frame, Paolo Bonzini, 2017/06/15
- [Qemu-devel] [PULL 06/41] memory: remove memory_region_set_fd, Paolo Bonzini, 2017/06/15
- [Qemu-devel] [PULL 12/41] megasas: do not read SCSI req parameters more than once from frame, Paolo Bonzini, 2017/06/15
- [Qemu-devel] [PULL 16/41] kvm-all: make async_safe_run_on_cpu safe on kvm too, Paolo Bonzini, 2017/06/15
- [Qemu-devel] [PULL 09/41] megasas: do not read iovec count more than once from frame, Paolo Bonzini, 2017/06/15
- [Qemu-devel] [PULL 14/41] Makefile: Do not generate files if "configure" has not been run yet, Paolo Bonzini, 2017/06/15
- [Qemu-devel] [PULL 21/41] tcg: move tcg related files into accel/tcg/ subdirectory, Paolo Bonzini, 2017/06/15