Hello,
I am new to qemu and have been recently playing with both the Windows binaries
and the linux binaries running under WSL. On WSL I've tried v8, 9 and 10. I'm
defining image files for each NS, not using any actual NVMe hardware for this.
I am able to hot add/remove NVMe controllers, but cannot seem to add/remove
namespaces underneath a controller. I've tried HMP and QMP command sequences
but always end up with the same result about the NVMe bus not being hot
pluggable. Is this not supported at this time?
Below is a snippet of my start script if that helps. What's shown below works
fine, but then I'd like to be able to, for example, add 2 more namespaces to
this same controller after the system is up.
Thank you!
Jeff
-name "${VM_NAME}"
-machine q35
-accel kvm
-cpu host
# vCPUs / RAM
-smp 8
-m 16G
# UI & boot menu
-display vnc=:1
-monitor stdio
-boot order=d,menu=on
# QMP + COM-over-TCP for kernel debugging if you want it
-qmp tcp:0.0.0.0:5955,server,nowait
-serial tcp:0.0.0.0:5555,server,nowait
# Networking (user-mode NAT). Add hostfwd later if you want inbound access.
-netdev user,id=n1
-device e1000,netdev=n1
# SMB-based file share
-nic user,id=nic0,smb=/mnt/f/VM
# --- Bootable IDE disk (install target) ---
-drive "file=${BOOT_IMG},format=raw,if=ide,index=0"
# --- NVMe namespace backing files ---
-drive "if=none,id=ns1,file=${NS1_IMG},format=raw"
-drive "if=none,id=ns2,file=${NS2_IMG},format=raw"
-drive "if=none,id=ns3,file=${NS3_IMG},format=raw"
-drive "if=none,id=ns4,file=${NS4_IMG},format=raw"
-drive "if=none,id=ns5,file=${NS5_IMG},format=raw"
# --- NVMe controller + namespaces (data disks) ---
-device pcie-root-port,id=rp0,bus=pcie.0,slot=0
-device nvme-subsys,id=nvmesubsys0,nqn=subsys0
-device nvme,id=nvme0,subsys=nvmesubsys0,serial=NVMECTRL0001,bus=rp0
# use nguid instead of uuid
-device
nvme-ns,drive=ns1,bus=nvme0,nsid=1,shared=off,nguid=2b0a6e8f06f948b3b1b8d6f71c2a9a44
-device
nvme-ns,drive=ns2,bus=nvme0,nsid=2,shared=off,nguid=7caa2b3f9c5d43b6a0c877b19b3d1e55
-device
nvme-ns,drive=ns3,bus=nvme0,nsid=3,shared=off,nguid=f3d1c2a7e9bb4d56a3f1c47b28aa9021