From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46641) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxW4i-0006NM-Om for qemu-devel@nongnu.org; Fri, 21 Oct 2016 05:25:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bxW4e-0003N0-QU for qemu-devel@nongnu.org; Fri, 21 Oct 2016 05:25:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46976) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bxW4e-0003Ma-Ij for qemu-devel@nongnu.org; Fri, 21 Oct 2016 05:25:12 -0400 From: Markus Armbruster References: <20160928082609.GA4196@stefanha-x1.localdomain> Date: Fri, 21 Oct 2016 11:25:08 +0200 In-Reply-To: (Kumar Girish's message of "Fri, 21 Oct 2016 05:47:05 +0000") Message-ID: <87twc6kqa3.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] external usb flash drive support on qemu virtualization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kumar Girish Cc: Stefan Hajnoczi , "qemu-devel@nongnu.org" Kumar Girish writes: > Thank you for info. May I know how to goto qemu monitor from command line. Please don't top-post. usb_add/usb_del are legacy; best stick to device_add/device_del. Try something like (qemu) device_add usb-host,id=my-stick,hostbus=BUS,hostaddr=ADDR,vendorid=VID,productid=PRID hostbus, hostaddr, vendorid and productid are optional, and match anything when omitted. The command line version of device_add is -device. To unplug, try (qemu) device_del my-stick > Regard, > Girish > > -----Original Message----- > From: Stefan Hajnoczi [mailto:stefanha@gmail.com] > Sent: Thursday, October 20, 2016 9:22 PM > To: Kumar Girish > Cc: qemu-devel@nongnu.org > Subject: Re: [Qemu-devel] external usb flash drive support on qemu virtualization > > On Thu, Oct 20, 2016 at 4:07 PM, Kumar Girish wrote: >> I have analysed my code and added the usb configuration while spawning the guest CMM. Unfortunately still the usb is not visible. >> Could you please help me on this. >> I added this config "-usb -usbdevice host:090c:1000 " . you can see in the last but one line >> Following is my config >> >> /bin/qemu-system-x86_64 -aos cmm -smp 2 -m 3072 -aosimage /flash/working/Mos.img -device virtio-prestera --enable-kvm -machine accel=kvm -qmp tcp:127.0.0.1:11364,server,nowait -netdev type=tap,id=eth0,ifname=tun0cmm,script=no,downscript=no -device virtio-net-pci,netdev=eth0,mac=2c:fa:a2:0a:29:46 -netdev type=tap,id=eth1,ifname=tun1cmm,script=no,downscript=no -device virtio-net-pci,netdev=eth1,mac=00:0a:1e:11:11:f8 -netdev type=tap,id=eth2,ifname=tun2cmm,script=no,downscript=no -device virtio-net-pci,netdev=eth2 -netdev type=tap,id=eth3,ifname=tun3cmm,script=no,downscript=no -device virtio-net-pci,netdev=eth3,mac=00:0a:1e:11:11:f8 -netdev type=tap,id=eth4,ifname=tun4cmm,script=no,downscript=no -device virtio-net-pci,netdev=eth4 -nographic -pidfile /CMMGuestPid -append -usb -usbdevice host:090c:1000 "console=ttyS0 empipaddr=172.17.2.189 empnetmask=255.255.255.0 empgateway=172.17.2.254 medora_early.ALU_VMSlotNum=0 medora_early.ALU_VMPrimaryA=1 medora_early.ALU_VMIsC! mm=1" >> >> Have few questions please clarify. >> >> 1. Is it possible to add usb configuration once the guest is UP. That >> is dynamically adding the usb configuration > > Yes. The usb_add/usb_del monitor commands or device_add/device_del can be used. I don't know the exact syntax, sorry. > >> 2. Once the configuration is done, should I unplug and plug the usb >> flash stick (pendrive) > > I believe the physical USB device must be plugged into the host before you tell QEMU to add the device. > >> 3. does lsusb show usb devices at guest also > > Yes. > > Stefan