Is there a way to use virsh attach-device without using a target?
For example, I attach a disk by using an xml file which includes the target "sdc".
<disk type='block' device='disk'>
<source dev='/dev/disk/by-label/mydisk' />
<target dev='sdc' bus='scsi' />
</disk>
To speed the process I'd like to not specify a target device, only the bus. The reason for this is so I don't have to login to the guest, get the current devices used, then edit the host xml file to use a new "sdX" name, and finally then attach the disk. It would save a lot of steps to just let it attach to the next available disk device in the guest.
I'm moving enough disks in and out of the guest it's become annoying. Also, when I detach the disk, it leaves the sdX device used, so I have to edit the file and move up the letters until it works. I'd like to also be able to script this and that would be much easier if I didn't need to know what the next device available is in the guest.
If there's a way to get the next available in the guest using virsh or other kvm/qemu commands, that would be nice too.
I only use CLI - no virt manager.
EDIT:
I just found "virsh domblklist", which lists the block devices on the guest, so I may look into changing to use virsh attach-disk. Just have to learn the arguments for that.