]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virsh: cmdAttachDisk: Don't assume type='block' if file can't be examined
authorPeter Krempa <pkrempa@redhat.com>
Thu, 19 Nov 2020 10:01:22 +0000 (11:01 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 23 Nov 2020 13:44:39 +0000 (14:44 +0100)
commit5c9fc43e690a6c3dac140af13590eba9dc44722f
tree2464a343b17aca81cff701043fe1fcb3d865c34f
parent426369ebfad84ae83ac37adcf36e4890569143af
virsh: cmdAttachDisk: Don't assume type='block' if file can't be examined

'virsh attach-disk' uses stat() to determine if the 'source' is a
regular file. If stat fails though it assumes that the file is block.

Since it's way more common to have regular files and the detection does
not work at all when accessing a remote host, modify the default to
assume type='file' by default.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
tests/virsh-output.out
tools/virsh-domain.c