[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/23] tests/qtest: migration-test: Handle link() for win32
From: |
Thomas Huth |
Subject: |
[PULL 04/23] tests/qtest: migration-test: Handle link() for win32 |
Date: |
Tue, 30 Aug 2022 20:39:53 +0200 |
From: Bin Meng <bin.meng@windriver.com>
Windows does not provide a link() API like POSIX. Instead it provides
a similar API CreateHardLink() that does the same thing, but with
different argument order and return value.
Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20220824094029.1634519-14-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/qtest/migration-test.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index 21bd76be19..18d30bfc3c 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -876,9 +876,17 @@ test_migrate_tls_x509_start_common(QTestState *from,
g_mkdir_with_parents(data->workdir, 0700);
test_tls_init(data->keyfile);
+#ifndef _WIN32
g_assert(link(data->keyfile, data->serverkey) == 0);
+#else
+ g_assert(CreateHardLink(data->serverkey, data->keyfile, NULL) != 0);
+#endif
if (args->clientcert) {
+#ifndef _WIN32
g_assert(link(data->keyfile, data->clientkey) == 0);
+#else
+ g_assert(CreateHardLink(data->clientkey, data->keyfile, NULL) != 0);
+#endif
}
TLS_ROOT_REQ_SIMPLE(cacertreq, data->cacert);
--
2.31.1
- [PULL 00/23] First testing patches for QEMU 7.2, Thomas Huth, 2022/08/30
- [PULL 02/23] tests/qtest: Use g_mkdtemp(), Thomas Huth, 2022/08/30
- [PULL 04/23] tests/qtest: migration-test: Handle link() for win32,
Thomas Huth <=
- [PULL 05/23] backends/tpm: Exclude headers and macros that don't exist on win32, Thomas Huth, 2022/08/30
- [PULL 09/23] tests/qtest: i440fx-test: Skip running request_{bios, pflash} for win32, Thomas Huth, 2022/08/30
- [PULL 03/23] tests: Use g_mkdir_with_parents(), Thomas Huth, 2022/08/30
- [PULL 06/23] tests/qtest: Adapt {m48t59,rtc}-test cases for win32, Thomas Huth, 2022/08/30
- [PULL 10/23] tests/qtest: migration-test: Skip running test_migrate_fd_proto on win32, Thomas Huth, 2022/08/30
- [PULL 08/23] tests/qtest: Build cases that use memory-backend-file for posix only, Thomas Huth, 2022/08/30
- [PULL 11/23] tests/qtest: libqos: Drop inclusion of <sys/wait.h>, Thomas Huth, 2022/08/30
- [PULL 07/23] tests/qtest: Build e1000e-test for posix only, Thomas Huth, 2022/08/30
- [PULL 17/23] tests/vm: Add libslirp to the VM tests, Thomas Huth, 2022/08/30
- [PULL 19/23] tests/avocado: Fix trivial typo, Thomas Huth, 2022/08/30