From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIDpY-0001B6-1a for qemu-devel@nongnu.org; Wed, 20 Mar 2013 03:53:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIDpV-0006Xh-LO for qemu-devel@nongnu.org; Wed, 20 Mar 2013 03:53:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3466) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIDpV-0006XP-DU for qemu-devel@nongnu.org; Wed, 20 Mar 2013 03:53:01 -0400 Date: Wed, 20 Mar 2013 08:52:57 +0100 From: Stefan Hajnoczi Message-ID: <20130320075257.GA5913@stefanha-thinkpad.muc.redhat.com> References: <1363758968-28549-1-git-send-email-asias@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1363758968-28549-1-git-send-email-asias@redhat.com> Subject: Re: [Qemu-devel] [PATCH] virtio-blk: Set default serial id List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Asias He Cc: Paolo Bonzini , qemu-devel@nongnu.org, kvm@vger.kernel.org On Wed, Mar 20, 2013 at 01:56:08PM +0800, Asias He wrote: > If user does not specify a serial id, e.g. > > -device virtio-blk-pci,serial="serial_id" > or > -drive serial="serial_id" > > no serial id will be assigned. > > Add a default serial id in this case to help identifying > the disk in guest. > > Signed-off-by: Asias He > --- > hw/virtio-blk.c | 7 +++++++ > 1 file changed, 7 insertions(+) Autogenerated IDs have been proposed (for other devices?) before and I think we should avoid them. The serial in this patch depends on the internal counter we use for savevm. It is not a well-defined value that guests can depend on remaining the same. It can change between QEMU invocations - due to internal changes in QEMU or because the management tool reordered -device options. Users will be confused and their guests may stop working if they depend on an ID like this. The solution is to do persistent naming either by really passing -device virtio-blk-pci,serial= or with udev inside the guest using the bus address (PCI devfn) like the new persistent network interface naming for Linux. Stefan