Support network disk parameters for virsh attach-disk XML generator
The "virsh attach-disk" command is a wrapper around "virsh attach-device" which can generate the XML config needed to attach a disk. It does not currently know how to generate the XML for any network based disks though, such as ISCSI, RBD, GluserFS.
It needs new args to generate XML configs such as
<disk type='network' device='disk'>
<driver name='qemu' type='raw'/>
<source protocol='http' name='/my-file.img'>
<host name='example.org'/>
</source>
<target dev='vdaa' bus='virtio'/>
</disk>
<disk type='network' device='disk'>
<driver name='qemu' type='raw'/>
<source protocol='nbd'>
<host transport='unix' socket='/var/run/nbdsock'/>
</source>
<target dev='vdab' bus='virtio'/>
</disk>
<disk type='network' device='disk'>
<driver name='qemu' type='raw'/>
<source protocol='rbd' name='pool/image'>
<host name='mon1.example.org' port='6321'/>
<host name='mon2.example.org' port='6322'/>
<host name='mon3.example.org' port='6322'/>
</source>
<target dev='vdac' bus='virtio'/>
</disk>
<disk type='network' device='disk'>
<driver name='qemu' type='raw'/>
<source protocol='sheepdog' name='image,with,commas'>
<host name='example.org' port='6000'/>
</source>
<target dev='vdad' bus='virtio'/>
</disk>
<disk type='network' device='disk'>
<driver name='qemu' type='raw'/>
<source protocol='gluster' name='test-volume/test-gluster2.raw'>
<host name='192.168.1.100'/>
</source>
<target dev='vdae' bus='virtio'/>
</disk>
An example commit extending virsh attach-disk with the --iothread option:
https://github.com/libvirt/libvirt/commit/bc5a8090afa84095634ccee1e1a6ca9a2a9b177a
commit bc5a8090afa84095634ccee1e1a6ca9a2a9b177a
Author: John Ferlan <jferlan@redhat.com>
Date: Tue Sep 2 11:20:41 2014 -0400
virsh: Add iothread to 'attach-disk'
All the parameters to add for network disk support:
--source-protocol
--source-name
--source-host-name (maybe take host:port syntax too)
--source-host-transport
--source-host-socket
Then the extra bit would be teaching it to decode gluster://
style URLs into those correct parameters.