From patchwork Mon Oct 29 06:16:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: migrate: error message for ram_load size Date: Sun, 28 Oct 2012 20:16:19 -0000 From: Doug Goldstein X-Patchwork-Id: 194836 Message-Id: <1351491379-20590-1-git-send-email-cardoe@cardoe.com> To: qemu-devel@nongnu.org Cc: Doug Goldstein , kvm@vger.kernel.org Report an error when ramblock's sizes mismatch with a suggestion to the user as to what went wrong. --- libvirt uses migration to save the state, however when performing a distro upgrade you might get an error starting your VMs up again without much detail. This patch attempts to remedy that with extra error messages. Without patch: $ virsh start expo error: Failed to start domain expo error: internal error Process exited while reading console log output: char device redirected to /dev/pts/16 qemu: warning: error while loading state for instance 0x0 of device 'ram' load of migration failed With patch: $ virsh start expo error: Failed to start domain expo error: internal error Process exited while reading console log output: char device redirected to /dev/pts/16 qemu: warning: error ramblock '0000:00:02.0/qxl.vrom' length 16384 != 8192. Did you change the ROM/BIOS or RAM size between restarts? qemu: warning: error while loading state for instance 0x0 of device 'ram' load of migration failed --- arch_init.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/arch_init.c b/arch_init.c index 8c3bb0d..33f783b 100644 --- a/arch_init.c +++ b/arch_init.c @@ -810,6 +810,11 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id) QLIST_FOREACH(block, &ram_list.blocks, next) { if (!strncmp(id, block->idstr, sizeof(id))) { if (block->length != length) { + fprintf(stderr, "qemu: warning: error ramblock " + "'%s' length %ld != %ld. Did you " + "change the ROM/BIOS or RAM size " + "between restarts?\n", id, + block->length, length); ret = -EINVAL; goto done; }