block/ssh: Implement .bdrv_refresh_filename()
commitb8c1f90118ee81090ff9093790f88bf335132814
authorMax Reitz <mreitz@redhat.com>
Mon, 25 Feb 2019 19:08:27 +0000 (25 20:08 +0100)
committerMax Reitz <mreitz@redhat.com>
Tue, 7 May 2019 15:14:21 +0000 (7 17:14 +0200)
treec116593ed580f78745b57f32c048104f52446df3
parent444b82369b9f4f487538f2cb23647862c48aca1c
block/ssh: Implement .bdrv_refresh_filename()

This requires some changes to keep iotests 104 and 207 working.

qemu-img info in 104 will now return a filename including the user name
and the port, which need to be filtered by adjusting REMOTE_TEST_DIR in
common.rc.  This additional information has to be marked optional,
however (which is simple as REMOTE_TEST_DIR is a regex), because
otherwise 197 and 215 would fail: They use it (indirectly) to filter
qemu-img create output which contains a backing filename they have
passed to it -- which probably does not contain a user name or port
number.

The problem in 207 is a nice one to have: qemu-img info used to return
json:{} filenames, but with this patch it returns nice plain ones.  We
now need to adjust the filtering to hide the user name (and port number
while we are at it).  The simplest way to do this is to include both in
iotests.remote_filename() so that bdrv_refresh_filename() will not
change it, and then iotests.img_info_log() will filter it correctly
automatically.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Tested-by: Richard W.M. Jones <rjones@redhat.com>
Message-id: 20190225190828.17726-2-mreitz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/ssh.c
tests/qemu-iotests/207
tests/qemu-iotests/207.out
tests/qemu-iotests/common.rc
tests/qemu-iotests/iotests.py