From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Hajnoczi Subject: Re: How to get the real device in guest os after attached a disk? Date: Tue, 17 Jul 2012 12:56:15 +0100 Message-ID: References: <1936723074.42171.1342496460585.JavaMail.hzwangpan@corp.netease.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Cc: kvm , Ryan Harper , libvir-list@redhat.com To: Wangpan Return-path: Received: from mail-lb0-f174.google.com ([209.85.217.174]:38525 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752116Ab2GQL4R (ORCPT ); Tue, 17 Jul 2012 07:56:17 -0400 Received: by lbbgm6 with SMTP id gm6so524930lbb.19 for ; Tue, 17 Jul 2012 04:56:16 -0700 (PDT) In-Reply-To: <1936723074.42171.1342496460585.JavaMail.hzwangpan@corp.netease.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Jul 17, 2012 at 4:40 AM, Wangpan wrote: > I have a question as the subject above, the reason I want to know this is that, if I attach some disks on the guest, > for example, I specified /dev/vdc&/dev/vdd(target device) at the cmd line by using 'virsh attach-disk', but they may be /dev/vdb&/dev/vdc in the guest os, > so if the guest user want to detach the /dev/vdb(guest device), he\she will be confused with the two target devices /dev/vdb&/dev/vdc, > because he\she doesn't know the corresponding relation of the guest device and target device, > he\she may detach an error device /dev/vdd(target device) which corresponding to /dev/vdc(guest device). > > Could anyone give me some idea? You can use the virtio-blk serial or file system/volume labels to distinguish them. For libvirt disk information, see the Domain XML documentation: http://libvirt.org/formatdomain.html#elementsDisks Stefan