From patchwork Mon Oct 29 06:16:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Goldstein X-Patchwork-Id: 194836 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4180C2C0097 for ; Mon, 29 Oct 2012 17:35:22 +1100 (EST) Received: from localhost ([::1]:57377 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TSiwS-0000Yz-Eh for incoming@patchwork.ozlabs.org; Mon, 29 Oct 2012 02:35:20 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46011) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TSieA-0003Mn-6M for qemu-devel@nongnu.org; Mon, 29 Oct 2012 02:16:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TSie9-000560-5D for qemu-devel@nongnu.org; Mon, 29 Oct 2012 02:16:26 -0400 Received: from mail-yh0-f45.google.com ([209.85.213.45]:45730) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TSie9-00055t-0l for qemu-devel@nongnu.org; Mon, 29 Oct 2012 02:16:25 -0400 Received: by mail-yh0-f45.google.com with SMTP id p34so883992yhp.4 for ; Sun, 28 Oct 2012 23:16:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=tp7kO9qO/arx8E9wd6e9O8SUegVWb4XQjyBxWxrviYs=; b=EncfnDN6h99B4ZfEZilHq/qsIs51cDy08A0kT02D/v9CoxWxKsFD7a2GBk0ZT0aqfl QNOPKDe09tmiccXpl3WY9trZ4iIpEAQa4+7sUKFL8B3xpSa+QPPzEc+gk0pLJZMzkIzF Yif9JoeWv1pwq2QrTUpM4Nbl6+DjWyA3k+nW4Y0ttneealAlf30UvFGwN/CVxONT/GHB vMDCZTWTe0vPZ2K4i0wfmbh2WpYuzfnaNFccYpc8B3fv/IUW1X0CtiDhYoV/rtwihQUJ FnF1l3ebdZ0Y8FCQwrElnHNLdKlz8wvMmUcC8dYAXsDBobD2XgMA0scs885Ytw8gExx7 kyiA== Received: by 10.236.85.201 with SMTP id u49mr29066766yhe.6.1351491384117; Sun, 28 Oct 2012 23:16:24 -0700 (PDT) Received: from localhost.localdomain (c-71-228-185-44.hsd1.al.comcast.net. [71.228.185.44]) by mx.google.com with ESMTPS id y10sm7821935ang.15.2012.10.28.23.16.23 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 28 Oct 2012 23:16:23 -0700 (PDT) From: Doug Goldstein To: qemu-devel@nongnu.org Date: Mon, 29 Oct 2012 01:16:19 -0500 Message-Id: <1351491379-20590-1-git-send-email-cardoe@cardoe.com> X-Mailer: git-send-email 1.7.8.6 X-Gm-Message-State: ALoCoQm3WSHh9nC29nOK1dRTGtNVVQsSJVYB7KrVxcYQ3GQbH0DnsJL3GhHWicLkF0ZkKRRYveSp X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.213.45 X-Mailman-Approved-At: Mon, 29 Oct 2012 02:35:11 -0400 Cc: Doug Goldstein , kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH] migrate: error message for ram_load size X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.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; }