On Tue, Feb 18, 2025 at 07:45:45PM +0800, honglei.wang@xxxxxxxxxx wrote: > From: hongleiwang <honglei.wang@xxxxxxxxxx> > > QEMU has supported nvme disk emulation for a long time, > see: https://qemu-project.gitlab.io/qemu/system/devices/nvme.html. > > The following patches introduce nvme and nvme-ns disk bus type: > A disk with nvme as bus is represented as nvme disk that contains > only one nvme namespace. In XML, it can be used like this: > <devices> > ... > <disk type='file' device='disk'> > <driver name='qemu' type='raw'/> > <source file='/tmp/data.img'/> > <target dev='nvmea' bus='nvme'/> > <serial>nvme-serial-value</serial> > </disk> > ... > </devices> > > A disk with nvme-ns as bus is represented as an nvme namespace > and needs to be attached to an nvme controller. In XML, it can be > used like this: > <devices> > ... > <disk type='file' device='disk'> > <driver name='qemu' type='raw'/> > <source file='/tmp/data.img'/> > <target dev='nvmensa' bus='nvme-ns'/> > <address type='drive' controller='0' bus='0' target='0' unit='0'/> > </disk> > <controller type='nvme' index='0'> > <serial>nvme-controller-serial-value</serial> > <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> > </controller> > ... > </devices> What is the reason for wanting to have both these config approaches ? With the first appearing to be a subset of the second, the first seems to lack a compelling reason to exist. Consider if someone deployed a VM with the first config style and then later wanted to add a 2nd namespace to the VM. They would have to rewrite their config to the second form anyway. It seems like we'd be better off only supportnig the second approach as it is more general. With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|