From mboxrd@z Thu Jan 1 00:00:00 1970 From: Amos Kong Subject: Re: [RFC PATCH] KVM-test: Add subtest: usb Date: Tue, 2 Aug 2011 07:10:10 -0400 (EDT) Message-ID: <490835323.10303.1312283409996.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> References: <4E3656E5.4070000@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: autotest@test.kernel.org, kvm@vger.kernel.org To: Gerd Hoffmann Return-path: In-Reply-To: <4E3656E5.4070000@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: autotest-bounces@test.kernel.org Errors-To: autotest-bounces@test.kernel.org List-Id: kvm.vger.kernel.org ----- Original Message ----- > On 07/29/11 06:53, Amos Kong wrote: > > This test adds a usb storage for the guest, and do some check from > > monitor and > > inside the guest. > > It's not very stable, could you help to review if something is > > wrong? > > "Not stable" means what exactly? I found you had added new cmdline support of usb(ahci,usb2) for autotest. But it's not supported right now. "12:42:16 INFO | (qemu) *** EHCI support is under development ***" So I plan to use old options, "-usbdevice disk:format=qcow2:/tmp/usbdevice.qcow2". guest can identify the new disk. > > + output = session.get_command_output("lsusb") > > + #no bus specified, default using "usb.0" for "usb-storage" > > + if "ID 0000:0000" not in output: > > + logging.debug(output) > > + raise error.TestFail("No 'ID 0000:0000' in the output of 'lsusb'") > > You can use "lsusb -v" here, then you get something better to match. > Also lsusb does some more usb requests then. Should also check for > errors in the lsusb output. Thanks for your comments, will send V2 later. > > + output = session.get_command_output("fdisk -l") > > + if params.get("fdisk_string") not in output: > > + logging.debug(output) > > + raise error.TestFail("Could not realise the usb device") > > + > > + error.context("Formating usb disk") > > + dev_list = session.get_command_output("ls /dev/sd[a-z]") > > + session.cmd("yes |mkfs %s" % dev_list.split()[-1], > > + timeout=int(params.get("format_timeout"))) > > You can look at /dev/disk/by-path/ to figure which /dev/sd the usb > flashdrive is. ok. > cheers, > Gerd