From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TME41-0007kC-6a for qemu-devel@nongnu.org; Thu, 11 Oct 2012 04:24:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TME3z-0008ST-Pv for qemu-devel@nongnu.org; Thu, 11 Oct 2012 04:24:17 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:43655) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TME3z-0008SH-JX for qemu-devel@nongnu.org; Thu, 11 Oct 2012 04:24:15 -0400 Received: by mail-wi0-f181.google.com with SMTP id hq12so1432672wib.10 for ; Thu, 11 Oct 2012 01:24:14 -0700 (PDT) Date: Thu, 11 Oct 2012 10:24:09 +0200 From: Stefan Hajnoczi Message-ID: <20121011082409.GA10947@stefanha-thinkpad.redhat.com> References: <20120921133031.GA1682@darkstar.nay.redhat.com> <505C768A.5070801@redhat.com> <20120923023709.GA2742@darkstar.nay.redhat.com> <20121005081458.GC1399@stefanha-thinkpad.redhat.com> <50738B8E.1080303@redhat.com> <20121009083120.GA13775@stefanha-thinkpad.redhat.com> <5074D845.8050303@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5074D845.8050303@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2] virtio-blk: add default serial id List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dave Young Cc: qemu-devel@nongnu.org On Wed, Oct 10, 2012 at 10:07:01AM +0800, Dave Young wrote: > On 10/09/2012 04:31 PM, Stefan Hajnoczi wrote: > > > On Tue, Oct 09, 2012 at 10:27:26AM +0800, Dave Young wrote: > >> On 10/05/2012 04:14 PM, Stefan Hajnoczi wrote: > >> > >>> On Sun, Sep 23, 2012 at 10:37:09AM +0800, Dave Young wrote: > >>>> For the serial number decreasing issue, I think there's only these two ways to > >>>> select, there's no ideal way to resolve this issue. > >>>> My use case for this is for the kdump kernel to find proper disks, > >>>> after 1st kernel crashing 2nd kernel need find right disk to dump vmcore. > >>>> In this case v1 and v2 aproaches are both find to me. > >>>> > >>>> From my point of view, patch v1 is better though, I think unpluging 100000 is > >>>> not a sane use case. It's not likely to happen. > >>> > >>> I'm not sure auto-assigning serial numbers is a good idea. The guest can use > >>> the serial number in /etc/fstab or other places where it expects the serial > >>> number to be persistent. > >>> > >>> Your patch does not provide persistent serial numbers, so a change to the QEMU > >>> invocation could result in different serial numbers. The guest will get > >>> confused or perhaps refuse to boot. > >> > >> > >> Yes, it introduce confusion, but in this way at least the serial number > >> can be persistent across guest reboot. Traditionally ide disks use this > >> way as well, such as QEMU_HARDISK_00001, I think guest should not use > >> this in /etc/fstab. > > > > If you don't want to set a persistent serial number, use another mechanism to > > identify the disk. For example, Linux has /dev/disk/by-path/ which identifies > > virtio-blk PCI adapters, IDE, SCSI disks, etc. > > > > > > Does this work for your use case? > > > I have tried this before, but after rebooting (kexec/kdump) the by-path > link was not created. It might be udev bug anyway, I'm not sure though. Yes, it's udev. Check /lib/udev/rules.d/60-persistent-storage.rules. Stefan