diff options
-rw-r--r-- | tests/qtest/vhost-user-blk-test.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/qtest/vhost-user-blk-test.c b/tests/qtest/vhost-user-blk-test.c index 8796c74ca4..6f108a1b62 100644 --- a/tests/qtest/vhost-user-blk-test.c +++ b/tests/qtest/vhost-user-blk-test.c @@ -789,6 +789,14 @@ static const char *qtest_qemu_storage_daemon_binary(void) exit(0); } + /* If we've got a path to the binary, check whether we can access it */ + if (strchr(qemu_storage_daemon_bin, '/') && + access(qemu_storage_daemon_bin, X_OK) != 0) { + fprintf(stderr, "ERROR: '%s' is not accessible\n", + qemu_storage_daemon_bin); + exit(1); + } + return qemu_storage_daemon_bin; } |