Adding multiple NVMe devices to QEMU - qemu

I am trying to add multiple NVMe devices to QEMU following this tutorial but I got a message drive with bus=0, unit=0 (index=0) exists
How can I add multiple virtual NVMe devices to QEMU ?

Related

What is the difference between qemu-sparc64 and qemu-system-sparc64?

I am trying to run some simple SPARC tests on bare metal QEMU. I am using qemu-sparc64 -g 1234 simple_example and seems to be working fine (I can connect gdb to localhost:1234, step through, etc) but was wondering what does qemu-system-sparc64 do ? I tried running it with the same cmd line switches but got some errors. Any help is appreciated, thank you.
For any QEMU architecture target, the qemu-system-foo binary runs a complete system emulation of the CPU and all other devices that make up a machine using that CPU type. It typically is used to run a guest OS kernel, like Linux; it can run other bare-metal guest code too.
The qemu-foo binary (sometimes also named qemu-foo-static if it has been statically linked) is QEMU's "user-mode" or "linux-user" emulation. This expects to run a single Linux userspace binary, and it translates all the system calls that process makes into direct host system calls.
If you're running qemu-sparc64 then you are not running your program in a bare-metal environment -- it's a proper Linux userspace process, even if you're not necessarily using all of the facilities that allows. If you want bare-metal then you need qemu-system-sparc64, but your program needs to actually be compiled to run correctly on the specific machine type that you tell QEMU to emulate (eg the Sun4u hardware, which is the default). Also, by default qemu-system-sparc64 will run the OpenBIOS firmware, so your bare-metal guest code needs to either run under that OpenBIOS environment, or else you need to tell QEMU not to run the BIOS (and then you get to deal with all the hardware setup that the BIOS would do for you).

Failed to claim interface: Operation not supported or unimplemented on this platform

I'm trying to use a USB Barcode Scanner on Windows 10 in Chrome v73.0.3683.86 via WebUSB.
The scanner is a Honeywell Voyager 1250g.
I can see the device via the device dialog - I can also open it and select a configuration.
However, when I try to claim interface(1) (There are 3 interfaces, but 1 is the bulk transfer) I get the error Failed to claim interface: Operation not supported or unimplemented on this platform in chrome://device-log/.
Is there a way around this, or is this scanner just not usable via WebUSB? Thanks!
Have you tried connecting to this device using WebUSB on other platforms? Windows has a particular additional requirement for applications (like Chrome) to access USB devices which is that the WinUSB.sys driver must be loaded for the interface.
I've written an article explaining the particular requirements on Windows here: https://developers.google.com/web/fundamentals/native-hardware/build-for-webusb/#windows
If you use the Windows Device Manager you can check which drivers are loaded for your device. If there is no driver loaded then you may be able to write a custom INF file as described in that article to instruct Windows to load the driver you want.

WinUSB application on raspberry Pi (win10 IoT)

I want to install and discuss with my own usb device on a raspberry pi with windows iot.
For that, I just create an inf file for arm like WinUSB driver on Windows 10 IoT. The device is recognized by the raspberry (seen on the startup list of connected device). Then I want to discuss with the device.
First, I have tried with the "winusb.dll" but I need to use the library "SetupApi" that does not compile for ARM. (I used this solution on windows PC and communicate correctly with the device).
Do you have an idea on how to communicate correctly with an winusb device on windows iot?
Thanks in advance for your answers.
So, I try to migrate to Windows.device.usb, and I don't succeed in connecting to the device. There there an exception when I call the FromIdAsync() function. It's exactly the same issue as : Can't access USB device in Universal App
There are some fantastic samples that can be found here.
https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/CustomUsbDeviceAccess
Download all the samples. Check where it creates watchers based on specific devices (there are two samples in there, you'd need to add your own in) the page that displays USB descriptors checks on the device type -- add in a check so that it returns DeviceType.all to see if it can query the descriptors.
I've managed to get it working on Windows 10 desktop, but have failed to craft an INF file that I can use on my IoT device. Once I get that working, I may return.

The windows Phone Emulator wasn't able to set the VHD on the virtual machine:

Once running Windows Phone 8 application I get the following error report:
Couldn't change synthetic disk drive of the virtual machine. 'Emulator WXGA.test' failed to add device 'Synthetic Disk Drive'.
'Emulator WVGA.test':Cannot attach storage media to the controller because the specific location is in use.
Try to run this in a command prompt (as administrator)
gpupdate /force

USB function controller emulation in QEMU

Does QEMU provide emulation for any target with USB device controller? Actually I am developing an embedded linux based device and was thinking about testing it on QEMU.
BR,
Mooni
You can find this information in the QEMU Manual, section "3.9 USB emulation":
QEMU emulates a PCI UHCI USB
controller. You can virtually plug
virtual USB devices or real host USB
devices (experimental, works only on
Linux hosts). Qemu will automatically
create and connect virtual USB hubs as
necessary to connect multiple USB
devices.
There you also find all relevant configuration parameters.
The USB Controller is provided for the following targets:
PC System
MIPS/malta has a PIIX4 PCI/USB/SMbus controller
ARM: has various options
I'm looking for this as well. There is a bit of code for virtual usb devices in the repo but I'm specifically looking for a way to write a dcd (device controller driver) which can be accessed as a virtual device from the host running the qemu simulation. I'm looking for a way to implement this for stm32 family.