[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/53] hw/virtio/virtio-mem: Use qemu_ram_get_fd() helper
From: |
Michael S. Tsirkin |
Subject: |
[PULL 18/53] hw/virtio/virtio-mem: Use qemu_ram_get_fd() helper |
Date: |
Mon, 26 Jun 2023 08:28:43 -0400 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Avoid accessing RAMBlock internals, use the provided
qemu_ram_get_fd() getter to get the file descriptor.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230524093744.88442-7-philmd@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
---
hw/virtio/virtio-mem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c
index 538b695c29..74e63bd47a 100644
--- a/hw/virtio/virtio-mem.c
+++ b/hw/virtio/virtio-mem.c
@@ -135,7 +135,7 @@ static bool virtio_mem_has_shared_zeropage(RAMBlock *rb)
* anonymous RAM. In any other case, reading unplugged *can* populate a
* fresh page, consuming actual memory.
*/
- return !qemu_ram_is_shared(rb) && rb->fd < 0 &&
+ return !qemu_ram_is_shared(rb) && qemu_ram_get_fd(rb) < 0 &&
qemu_ram_pagesize(rb) == qemu_real_host_page_size();
}
#endif /* VIRTIO_MEM_HAS_LEGACY_GUESTS */
--
MST
- [PULL 05/53] hw/cxl/events: Add event status register, (continued)
- [PULL 05/53] hw/cxl/events: Add event status register, Michael S. Tsirkin, 2023/06/26
- [PULL 06/53] hw/cxl: Move CXLRetCode definition to cxl_device.h, Michael S. Tsirkin, 2023/06/26
- [PULL 07/53] hw/cxl/events: Wire up get/clear event mailbox commands, Michael S. Tsirkin, 2023/06/26
- [PULL 08/53] hw/cxl/events: Add event interrupt support, Michael S. Tsirkin, 2023/06/26
- [PULL 09/53] hw/cxl/events: Add injection of General Media Events, Michael S. Tsirkin, 2023/06/26
- [PULL 10/53] hw/cxl/events: Add injection of DRAM events, Michael S. Tsirkin, 2023/06/26
- [PULL 11/53] hw/cxl/events: Add injection of Memory Module Events, Michael S. Tsirkin, 2023/06/26
- [PULL 12/53] cryptodev-vhost-user: add asymmetric crypto support, Michael S. Tsirkin, 2023/06/26
- [PULL 13/53] softmmu: Introduce qemu_target_page_mask() helper, Michael S. Tsirkin, 2023/06/26
- [PULL 15/53] hw/scsi: Rearrange meson.build, Michael S. Tsirkin, 2023/06/26
- [PULL 18/53] hw/virtio/virtio-mem: Use qemu_ram_get_fd() helper,
Michael S. Tsirkin <=
- [PULL 14/53] hw/scsi: Introduce VHOST_SCSI_COMMON symbol in Kconfig, Michael S. Tsirkin, 2023/06/26
- [PULL 23/53] vhost: release memory_listener object in error path, Michael S. Tsirkin, 2023/06/26
- [PULL 24/53] vhost: release virtqueue objects in error path, Michael S. Tsirkin, 2023/06/26
- [PULL 25/53] pci: ROM preallocation for incoming migration, Michael S. Tsirkin, 2023/06/26
- [PULL 16/53] hw/scsi: Rename target-specific source set as 'specific_virtio_scsi_ss', Michael S. Tsirkin, 2023/06/26
- [PULL 27/53] vdpa: return errno in vhost_vdpa_get_vring_group error, Michael S. Tsirkin, 2023/06/26
- [PULL 30/53] hw/acpi: Fix PM control register access, Michael S. Tsirkin, 2023/06/26
- [PULL 38/53] vdpa: reuse virtio_vdev_has_feature(), Michael S. Tsirkin, 2023/06/26