From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFc4G-00011E-6t for qemu-devel@nongnu.org; Sat, 22 Sep 2012 22:37:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TFc4E-0005FE-R1 for qemu-devel@nongnu.org; Sat, 22 Sep 2012 22:37:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18823) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFc4E-0005FA-IH for qemu-devel@nongnu.org; Sat, 22 Sep 2012 22:37:10 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q8N2b8U8014303 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 22 Sep 2012 22:37:08 -0400 Date: Sun, 23 Sep 2012 10:37:09 +0800 From: Dave Young Message-ID: <20120923023709.GA2742@darkstar.nay.redhat.com> References: <20120921133031.GA1682@darkstar.nay.redhat.com> <505C768A.5070801@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <505C768A.5070801@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: Eric Blake Cc: qemu-devel@nongnu.org On Fri, Sep 21, 2012 at 08:15:38AM -0600, Eric Blake wrote: > On 09/21/2012 07:30 AM, Dave Young wrote: > > > > For virtio block device, if user does not specify the serial attribute, > > There will be no serial availabe, this is not convenient for identifying > > the disk. > > > > Doing something similar to ide disks, add a "VD0000?" default serial > > number if user does not specify it. > > > > [v1->v2 address comments from Eric Blake]: > > fix spell errors in patch description > > decrease drive_serial in virtio_blk_exit as well > > Typically, patch changelogs belong... > > > > > Signed-off-by: Dave Young > > --- > > ...after the --- line, so that 'git am' doesn't make them part of git > history. Also, I'm not sure that decreasing the serial number is > correct - you've now made it much easier to get duplicate serial numbers > compared to my original complaint of 100000 hotplug cycles. Now all I > have to do is: > > create a guest with two disks > hot unplug disk one > hot plug a new disk > > and voila, both disks will now have serial number 2. Thanks for comment. Add changelogs to git history is not bad IMO, this can reflect the changes between diffrent version of the patches, it's quite normal. 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. > > > @@ -632,6 +638,7 @@ VirtIODevice *virtio_blk_init(DeviceStat > > sizeof(struct virtio_blk_config), > > sizeof(VirtIOBlock)); > > > > + s->drive_serial = drive_serial++; > > s->vdev.get_config = virtio_blk_update_config; > > s->vdev.set_config = virtio_blk_set_config; > > s->vdev.get_features = virtio_blk_get_features; > > @@ -664,4 +671,5 @@ void virtio_blk_exit(VirtIODevice *vdev) > > unregister_savevm(s->qdev, "virtio-blk", s); > > blockdev_mark_auto_del(s->bs); > > virtio_cleanup(vdev); > > + drive_serial--; > > } > > > > > > -- > Eric Blake eblake@redhat.com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org >