[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 2/2] qxl: change rom size to 8192
From: |
Alon Levy |
Subject: |
[Qemu-devel] [PATCH v2 2/2] qxl: change rom size to 8192 |
Date: |
Wed, 16 Jan 2013 19:59:30 +0200 |
This is a simpler solution to 869981, where migration breaks since qxl's
rom bar size has changed. Instead of ignoring fields in QXLRom, which is what
has
actually changed, we remove some of the modes, a mechanism already
accounted for by the guest.
Added assert so that rom size will fit the future QXLRom increases via
spice-protocol changes.
Signed-off-by: Alon Levy <address@hidden>
---
hw/qxl.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/hw/qxl.c b/hw/qxl.c
index 0d81816..0cd854a 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -79,10 +79,7 @@
QXL_MODE(x_res, y_res, 32, orientation)
#define QXL_MODE_EX(x_res, y_res) \
- QXL_MODE_16_32(x_res, y_res, 0), \
- QXL_MODE_16_32(y_res, x_res, 1), \
- QXL_MODE_16_32(x_res, y_res, 2), \
- QXL_MODE_16_32(y_res, x_res, 3)
+ QXL_MODE_16_32(x_res, y_res, 0)
static QXLMode qxl_modes[] = {
QXL_MODE_EX(640, 480),
@@ -306,10 +303,13 @@ static inline uint32_t msb_mask(uint32_t val)
static ram_addr_t qxl_rom_size(void)
{
- uint32_t rom_size = sizeof(QXLRom) + sizeof(QXLModes) + sizeof(qxl_modes);
+ uint32_t required_rom_size = sizeof(QXLRom) + sizeof(QXLModes) +
+ sizeof(qxl_modes);
+ uint32_t rom_size = 8192; /* two pages */
- rom_size = MAX(rom_size, TARGET_PAGE_SIZE);
- rom_size = msb_mask(rom_size * 2 - 1);
+ required_rom_size = MAX(required_rom_size, TARGET_PAGE_SIZE);
+ required_rom_size = msb_mask(required_rom_size * 2 - 1);
+ assert(required_rom_size <= rom_size);
return rom_size;
}
--
1.8.0.1
- Re: [Qemu-devel] [PATCH 2/2] qxl: change rom so that 4096 < size < 8192, Alon Levy, 2013/01/15
- Re: [Qemu-devel] [PATCH 2/2] qxl: change rom so that 4096 < size < 8192, Gerd Hoffmann, 2013/01/15
- Re: [Qemu-devel] [PATCH v2 0/2] fix two revision related errors, Alon Levy, 2013/01/21
- [Qemu-devel] [PATCH v3 1/2] qxl: stop using non revision 4 rom fields for revision < 4, Alon Levy, 2013/01/21
- [Qemu-devel] [PATCH v3 2/2] qxl: change rom size to 8192, Alon Levy, 2013/01/21
- Re: [Qemu-devel] [PATCH v3 2/2] qxl: change rom size to 8192, Markus Armbruster, 2013/01/22
- Re: [Qemu-devel] [PATCH v3 1/2] qxl: stop using non revision 4 rom fields for revision < 4, Alon Levy, 2013/01/21