pci: add romsize property
commit08b1df8ff463e72b0875538fb991d5393047606c
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 3 Feb 2021 13:18:28 +0000 (3 14:18 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 5 Feb 2021 13:52:58 +0000 (5 08:52 -0500)
treec9f9b9a66917481bd350eaa346bb51d29d252920
parent7c16b5bbb6c0f797945327d17e4be60f25a4427d
pci: add romsize property

This property can be useful for distros to set up known-good ROM sizes for
migration purposes.  The VM will fail to start if the ROM is too large,
and migration compatibility will not be broken if the ROM is too small.

Note that even though romsize is a uint32_t, it has to be between 1
(because empty ROM files are not accepted, and romsize must be greater
than the file) and 2^31 (because values above are not powers of two and
are rejected).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Message-Id: <20201218182736.1634344-1-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210203131828.156467-3-pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: David Edmondson <david.edmondson@oracle.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
hw/pci/pci.c
hw/xen/xen_pt_load_rom.c
include/hw/pci/pci.h