OSDN Git Service

memory-device: Drop size alignment check
authorDavid Hildenbrand <david@redhat.com>
Thu, 22 Jun 2023 10:49:19 +0000 (12:49 +0200)
committerMaciej S. Szmigiero <maciej.szmigiero@oracle.com>
Mon, 6 Nov 2023 12:54:57 +0000 (13:54 +0100)
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

index db702cc..e0704b8 100644 (file)
@@ -236,12 +236,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