mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
memory: remove qemu_get_ram_fd, qemu_set_ram_fd, qemu_ram_block_host_ptr
Remove direct uses of ram_addr_t and optimize memory_region_{get,set}_fd now that a MemoryRegion knows its RAMBlock directly. Reviewed-by: Marc-André Lureau <marcandre.lureau@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
063143d5b1
commit
4ff87573df
6 changed files with 37 additions and 52 deletions
|
@ -33,7 +33,6 @@
|
|||
#include "sysemu/hostmem.h"
|
||||
#include "sysemu/qtest.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "exec/ram_addr.h"
|
||||
|
||||
#include "hw/misc/ivshmem.h"
|
||||
|
||||
|
@ -533,7 +532,7 @@ static void process_msg_shmem(IVShmemState *s, int fd, Error **errp)
|
|||
}
|
||||
memory_region_init_ram_ptr(&s->server_bar2, OBJECT(s),
|
||||
"ivshmem.bar2", size, ptr);
|
||||
qemu_set_ram_fd(memory_region_get_ram_addr(&s->server_bar2), fd);
|
||||
memory_region_set_fd(&s->server_bar2, fd);
|
||||
s->ivshmem_bar2 = &s->server_bar2;
|
||||
}
|
||||
|
||||
|
@ -940,7 +939,7 @@ static void ivshmem_exit(PCIDevice *dev)
|
|||
strerror(errno));
|
||||
}
|
||||
|
||||
fd = qemu_get_ram_fd(memory_region_get_ram_addr(s->ivshmem_bar2));
|
||||
fd = memory_region_get_fd(s->ivshmem_bar2);
|
||||
close(fd);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue