qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] migrate: error message for ram_load size


From: Doug Goldstein
Subject: [Qemu-devel] [PATCH] migrate: error message for ram_load size
Date: Mon, 29 Oct 2012 01:16:19 -0500

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;
                             }
-- 
1.7.8.6




reply via email to

[Prev in Thread] Current Thread [Next in Thread]