From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1WV1DJ-0006yz-Ux for mharc-grub-devel@gnu.org; Tue, 01 Apr 2014 12:07:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WV1DC-0006sj-4Z for grub-devel@gnu.org; Tue, 01 Apr 2014 12:06:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WV1D6-0002mR-Dd for grub-devel@gnu.org; Tue, 01 Apr 2014 12:06:54 -0400 Received: from mail-la0-x236.google.com ([2a00:1450:4010:c03::236]:46252) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WV1D6-0002mL-0W for grub-devel@gnu.org; Tue, 01 Apr 2014 12:06:48 -0400 Received: by mail-la0-f54.google.com with SMTP id mc6so7226299lab.13 for ; Tue, 01 Apr 2014 09:06:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=BiDUc92PDu8L1RVl6MS7wYLTC97mRK5XOy7VYOn4ZRs=; b=rsoEVmX2gmbVSfQYD4dj5E4w8zASOrjQk3X6JOsK7gl5gETA7OwDcX2HSNEa9dCAya VFD7MeRQrM1rfd2HN7Ii6fSKmtsT9/JXqyw1kTX5dnZkDsYFNs5o1ZYx7DLasBBPdLLh hBqPamqYIdMRx5TCq3FbPAK4F+qCsBMshQO7F++brTxECsdvPw3Rtp3yhXLjdyG8uix5 kBSCNdpTQuzDtr+KAkUAbkJ2KhMc3znqZV0GAmOyYFvDvfsdc0PirnY4uzTrmU/SqRDg 0nIjMlm5H6fAZouqvf6AeVMantEmVaefxmx0nQRUH0ERKQVRhcZr0Jy2m9a85aMvhod9 pVfQ== X-Received: by 10.112.137.193 with SMTP id qk1mr852098lbb.53.1396368407043; Tue, 01 Apr 2014 09:06:47 -0700 (PDT) Received: from opensuse.site (ppp37-190-15-130.pppoe.spdop.ru. [37.190.15.130]) by mx.google.com with ESMTPSA id lm5sm17475709lac.13.2014.04.01.09.06.45 for (version=SSLv3 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Apr 2014 09:06:46 -0700 (PDT) Date: Tue, 1 Apr 2014 20:06:44 +0400 From: Andrey Borzenkov To: The development of GNU GRUB Subject: Re: pvgrub2 and old grub menu.lst Message-ID: <20140401200644.0fecf331@opensuse.site> In-Reply-To: <20140401074548.GB28903@linux-dsax.tai.apac.novell.com> References: <20140401074548.GB28903@linux-dsax.tai.apac.novell.com> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.22; x86_64-suse-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::236 Cc: mchang@suse.com X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 16:07:00 -0000 В Tue, 1 Apr 2014 15:46:22 +0800 Michael Chang пишет: > While trying to boot xen pv guest with old grub config (menu.lst), > the pvgrub2 loads it's menu successfully, but when you attemp to boot > the kernel it failed with the following message. > > error: couldn't load file /boot/vmlinuz-3.0.76-0.11-xen. > error: you need to load the kernel first. > > Press any key to continue..." > > The kernel is there and boots fine with pygrub. > > After some investigation, it boils down to the menu.lst has explicitly > set it's root device to (hd0,1) and therefore the root device is not > recognized by pvgrub2. > > title Xen -- SUSE Linux Enterprise Server 11 SP3 - 3.0.76-0.11 > root (hd0,1) > kernel /boot/vmlinuz-3.0.76-0.11-xen root=/dev/xvda2 resume=/dev/xvda1 > splash=silent showopts initrd /boot/initrd-3.0.76-0.11.xen > > I'd like to know whether old grub configuration is considered or planned > to work with pvgrub2 ? And is it a viable suggestion to have (hdX,Y) a > valid xen disk name because it's quite common in some existing configs ? > I believe this technically should work; but this needs someone who knows how Xen disks is mapped to hd number in legacy grub. It would be something like (completely untested) From: Andrey Borzenkov Subject: [PATCH] accept also hdX as alias to native Xen disk name This allows reusing legacy pvgrub menu.lst which is using hdX names. Suggested-By: Michael Chang --- grub-core/disk/xen/xendisk.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/grub-core/disk/xen/xendisk.c b/grub-core/disk/xen/xendisk.c index 2b11c2a..c6c8ecc 100644 --- a/grub-core/disk/xen/xendisk.c +++ b/grub-core/disk/xen/xendisk.c @@ -70,9 +70,20 @@ grub_virtdisk_open (const char *name, grub_disk_t disk) grub_uint32_t secsize; char fdir[200]; char *buf; + int num = -1; + if (name[0] == 'h' && name[1] == 'd') + { + num = grub_strtoul (hd+2, 0, 10); + if (grub_errno) + { + grub_errno = 0; + num = -1; + } + } for (i = 0; i < vdiskcnt; i++) - if (grub_strcmp (name, virtdisks[i].fullname) == 0) + if ((num != -1 && virtdisks[i].handle == num) || + grub_strcmp (name, virtdisks[i].fullname) == 0) break; if (i == vdiskcnt) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a virtdisk"); -- tg: (4afd010..) e/xen/hdX-compat (depends on: master)