diff mbox series

[v7,2/7] memory-device: Drop size alignment check

Message ID ab78df4c073aa3a44e5bb2eb303c5c54593c3f4b.1693240836.git.maciej.szmigiero@oracle.com
State New
Headers show
Series Hyper-V Dynamic Memory Protocol driver (hv-balloon 🎈️) | expand

Commit Message

Maciej S. Szmigiero Aug. 28, 2023, 4:48 p.m. UTC
From: David Hildenbrand <david@redhat.com>

There is no strong requirement that the size has to be multiples of the
requested alignment, let's drop it. This is a preparation for hv-baloon.

Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
---
 hw/mem/memory-device.c | 6 ------
 1 file changed, 6 deletions(-)
diff mbox series

Patch

diff --git a/hw/mem/memory-device.c b/hw/mem/memory-device.c
index 8d0c166b3189..91b35836b7b5 100644
--- a/hw/mem/memory-device.c
+++ b/hw/mem/memory-device.c
@@ -232,12 +232,6 @@  static uint64_t memory_device_get_free_addr(MachineState *ms,
         return 0;
     }
 
-    if (!QEMU_IS_ALIGNED(size, align)) {
-        error_setg(errp, "backend memory size must be multiple of 0x%"
-                   PRIx64, align);
-        return 0;
-    }
-
     if (hint) {
         if (range_init(&new, *hint, size) || !range_contains_range(&as, &new)) {
             error_setg(errp, "can't add memory device [0x%" PRIx64 ":0x%" PRIx64