Re: [PATCH] pci: add romsize property

2021-01-22 Thread Paolo Bonzini
On 19/01/21 18:20, Laszlo Ersek wrote: I only have superficial comments: - if we're talking uint32_t, I'd kind of prefer UINT32_MAX to (-1), style-wise -- but feel free to ignore - we should print a uint32_t with ("%" PRIu32), not "%d" (again, only pedantry, but PRIu32 is widely used in qemu, A

Re: [PATCH] pci: add romsize property

2021-01-22 Thread Michael S. Tsirkin
On Fri, Dec 18, 2020 at 01:27:36PM -0500, Paolo Bonzini wrote: > 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. > > Signed

Re: [PATCH] pci: add romsize property

2021-01-20 Thread David Edmondson
On Tuesday, 2021-01-19 at 17:51:32 +01, Philippe Mathieu-Daudé wrote: > +pflash > > On 12/18/20 7:27 PM, Paolo Bonzini wrote: >> 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 co

Re: [PATCH] pci: add romsize property

2021-01-19 Thread Laszlo Ersek
On 01/19/21 17:51, Philippe Mathieu-Daudé wrote: > +pflash > > On 12/18/20 7:27 PM, Paolo Bonzini wrote: >> 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

Re: [PATCH] pci: add romsize property

2021-01-19 Thread Philippe Mathieu-Daudé
On 1/19/21 6:10 PM, Paolo Bonzini wrote: > On 19/01/21 17:51, Philippe Mathieu-Daudé wrote: >>> +    if (pci_dev->romsize != -1 && !is_power_of_2(pci_dev->romsize)) { >>> +    error_setg(errp, "ROM size %d is not a power of two", >>> pci_dev->romsize); >>> +    return; >>> +    } >> Some cl

Re: [PATCH] pci: add romsize property

2021-01-19 Thread Paolo Bonzini
On 19/01/21 17:51, Philippe Mathieu-Daudé wrote: +if (pci_dev->romsize != -1 && !is_power_of_2(pci_dev->romsize)) { +error_setg(errp, "ROM size %d is not a power of two", pci_dev->romsize); +return; +} Some cloud providers already complained the pow2 check in the pflash

Re: [PATCH] pci: add romsize property

2021-01-19 Thread Philippe Mathieu-Daudé
+pflash On 12/18/20 7:27 PM, Paolo Bonzini wrote: > 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. > > Signed-off-by: Pao

Re: [PATCH] pci: add romsize property

2021-01-19 Thread Peter Xu
On Fri, Dec 18, 2020 at 06:54:57PM +, Dr. David Alan Gilbert wrote: > * Paolo Bonzini (pbonz...@redhat.com) wrote: > > 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 compati

Re: [PATCH] pci: add romsize property

2020-12-18 Thread Dr. David Alan Gilbert
* Paolo Bonzini (pbonz...@redhat.com) wrote: > 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. > > Signed-off-by: Paolo Bon

[PATCH] pci: add romsize property

2020-12-18 Thread Paolo Bonzini
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. Signed-off-by: Paolo Bonzini --- hw/pci/pci.c | 19 ++