在 2016-10-13 3:46, Max Reitz 写道:
On 12.10.2016 10:55, Hao QingFeng wrote:
Just a common question for this case, if sshx block driver wasn't built
into qemu-img, this case would fail as below:
Good point, and thanks for bringing it up, but it's not directly linked
to this series other than by its subject, of course, so I'd rather add a
fix on top.
Thanks and sorry for sending to the improper mail series.
Actually I am not sure if I understood it. Do you mean
exec /home/haoqf/KVMonz/qemu/tests/qemu-iotests/../../qemu-img info
qemu-img: Could not open
'driver=ssh,host=localhost,port=0.42,path=/foo': Unknown driver 'ssh'
Adding 162.notrun can bypass this case but it would skip it even if
qemu-img has sshx block driver, in which case I think it should be run.
So How about adding a script to dynamically check at runtime if the
current env qemu-img can meet the requirement to run the test or not?
Unfortunately, the list of block drivers listed by will not contain ssh
if ssh is built as a module, which is possible.
rather than "CONFIG_LIBSSH2=y" in config-host.mak? But in the configure it's
set to be "CONFIG_LIBSSH2=y":
if test "$libssh2" = "yes" ; then
echo "CONFIG_LIBSSH2=y" >> $config_host_mak
echo "LIBSSH2_CFLAGS=$libssh2_cflags" >> $config_host_mak
echo "LIBSSH2_LIBS=$libssh2_libs" >> $config_host_mak
Meanwhile I changed it to be "CONFIG_LIBSSH2=m" and reconfig, make the qemu,
qemu-img --help can still prompt ssh.
This is a bug that should be fixed, but I'd rather do so in a separate
series from this one.
In any case, once it is fixed I'd rather just take the approach quorum
tests take already (e.g. test 081), which is something like:
test_ssh=$($QEMU_IMG --help | grep '^Supported formats:.* ssh\( \|$\)')
[ "$test_ssh" = "" ] && _notrun "ssh support required"
Cool. Agree with this like what was done in 081. thanks