From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMweY-0004he-FY for qemu-devel@nongnu.org; Thu, 28 Aug 2014 06:10:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMweS-00010L-BR for qemu-devel@nongnu.org; Thu, 28 Aug 2014 06:10:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58221) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMweS-00010H-2k for qemu-devel@nongnu.org; Thu, 28 Aug 2014 06:09:56 -0400 Date: Thu, 28 Aug 2014 18:10:07 +0800 From: Fam Zheng Message-ID: <20140828101007.GB11352@T430.redhat.com> References: <1409198556-15996-1-git-send-email-famz@redhat.com> <877g1t3tx9.fsf@blackfin.pond.sub.org> <20140828093947.GA11352@T430.redhat.com> <874mwx2b60.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <874mwx2b60.fsf@blackfin.pond.sub.org> Subject: Re: [Qemu-devel] [PATCH v2] block: Introduce "null" driver List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Kevin Wolf , benoit.canet@irqsave.net, qemu-devel@nongnu.org, Stefan Hajnoczi On Thu, 08/28 11:52, Markus Armbruster wrote: > Fam Zheng writes: > > > On Thu, 08/28 10:22, Markus Armbruster wrote: > >> Fam Zheng writes: > >> > >> > This is an analogue to Linux null_blk. It can be used for testing block > >> > device emulation and general block layer functionalities such as > >> > coroutines and throttling, where disk IO is not necessary or wanted. > >> > > >> > Use null:// for AIO version, and null-co:// for coroutine version. > >> > > >> > Signed-off-by: Fam Zheng > >> > > >> > --- > >> > V2: Don't #ifdef code, add two drivers. (Benoit) > >> > Add to QAPI BlockdevOptions. (Eric) > >> > Add "file.size" option to override backend size. (What is a better > >> > way to associate /dev/vd{a,b,c} with command line devices, if sizes > >> > are the same?) > >> > >> Is this a request for advice? If yes, please explain the problem in > >> more detail, because I'm too dense to get it :) > >> > > > > Yes :) > > > > I have more than one virtio-blk: > > > > -drive file=/dev/ram0,id=d0,if=none -device > > virtio-blk-pci,drive=d0,x-datap-plane=on \ > > -drive file=/dev/ram1,id=d0,if=none -device virtio-blk-pci,drive=d1 > > > > Then I get /dev/vda and /dev/vdb in guest. They are in the same size. > > > > The question is how do I tell which is /dev/ram0 and which is /dev/ram1, > > without bothering peaking PCI addr, etc.? > > Set virtio-blk-pci's serial property to a suitable value. The serial > number is visible in a Linux guest as > /sys/bus/virtio/devices/virtio0/block/vda/serial or similar. > Great, then I get a readable symlink in /dev/disk/by-id/. Thanks, Fam