[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 13/51] tests/qtest: migration-test: Handle link() for win32
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [PATCH 13/51] tests/qtest: migration-test: Handle link() for win32 |
Date: |
Wed, 24 Aug 2022 19:41:50 +0100 |
User-agent: |
Mutt/2.2.6 (2022-06-05) |
* Bin Meng (bmeng.cn@gmail.com) wrote:
> 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>
> ---
>
> 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 38356d4aba..af9250750b 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.34.1
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
- Re: [PATCH 07/51] tests: Avoid using hardcoded /tmp in test cases, (continued)
- [PATCH 10/51] hw/usb: dev-mtp: Use g_mkdir_with_parents(), Bin Meng, 2022/08/24
- [PATCH 11/51] qga/commands-posix-ssh: Use g_mkdir_with_parents(), Bin Meng, 2022/08/24
- [PATCH 12/51] tests: Use g_mkdir_with_parents(), Bin Meng, 2022/08/24
- [PATCH 13/51] tests/qtest: migration-test: Handle link() for win32, Bin Meng, 2022/08/24
- Re: [PATCH 13/51] tests/qtest: migration-test: Handle link() for win32,
Dr. David Alan Gilbert <=
- [PATCH 15/51] tests/qtest: Adapt {m48t59,rtc}-test cases for win32, Bin Meng, 2022/08/24
- [PATCH 08/51] block/vvfat: Unify the mkdir() call, Bin Meng, 2022/08/24
- [PATCH 14/51] backends/tpm: Exclude headers and macros that don't exist on win32, Bin Meng, 2022/08/24
- [PATCH 16/51] tests/qtest: Build e1000e-test for posix only, Bin Meng, 2022/08/24
- [PATCH 17/51] tests/qtest: Build virtio-net-test for posix only, Bin Meng, 2022/08/24