diff mbox series

ipmi-bt-test: force ipv4

Message ID 20231018191123.1176602-1-vsementsov@yandex-team.ru
State New
Headers show
Series ipmi-bt-test: force ipv4 | expand

Commit Message

Vladimir Sementsov-Ogievskiy Oct. 18, 2023, 7:11 p.m. UTC
We open ipv4 listening socket. But "localhost" in qemu parameters may
load to Qemu trying to connect with ipv6 and fail with "Connection
refused". Force ipv4 by using ipv4 ip address.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
---
 tests/qtest/ipmi-bt-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Thomas Huth Oct. 19, 2023, 5:17 a.m. UTC | #1
On 18/10/2023 21.11, Vladimir Sementsov-Ogievskiy wrote:
> We open ipv4 listening socket. But "localhost" in qemu parameters may
> load to Qemu trying to connect with ipv6 and fail with "Connection
> refused". Force ipv4 by using ipv4 ip address.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
> ---
>   tests/qtest/ipmi-bt-test.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/qtest/ipmi-bt-test.c b/tests/qtest/ipmi-bt-test.c
> index ed431e34e6..383239bcd4 100644
> --- a/tests/qtest/ipmi-bt-test.c
> +++ b/tests/qtest/ipmi-bt-test.c
> @@ -411,7 +411,7 @@ int main(int argc, char **argv)
>       g_test_init(&argc, &argv, NULL);
>   
>       global_qtest = qtest_initf(
> -        " -chardev socket,id=ipmi0,host=localhost,port=%d,reconnect=10"
> +        " -chardev socket,id=ipmi0,host=127.0.0.1,port=%d,reconnect=10"
>           " -device ipmi-bmc-extern,chardev=ipmi0,id=bmc0"
>           " -device isa-ipmi-bt,bmc=bmc0", emu_port);
>       qtest_irq_intercept_in(global_qtest, "ioapic");

Thanks, I'll queue it for my next pull request.

Acked-by: Thomas Huth <thuth@redhat.com>
Corey Minyard Oct. 19, 2023, 6:30 p.m. UTC | #2
On Wed, Oct 18, 2023 at 10:11:23PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> We open ipv4 listening socket. But "localhost" in qemu parameters may
> load to Qemu trying to connect with ipv6 and fail with "Connection
> refused". Force ipv4 by using ipv4 ip address.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
> ---
>  tests/qtest/ipmi-bt-test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/qtest/ipmi-bt-test.c b/tests/qtest/ipmi-bt-test.c
> index ed431e34e6..383239bcd4 100644
> --- a/tests/qtest/ipmi-bt-test.c
> +++ b/tests/qtest/ipmi-bt-test.c
> @@ -411,7 +411,7 @@ int main(int argc, char **argv)
>      g_test_init(&argc, &argv, NULL);
>  
>      global_qtest = qtest_initf(
> -        " -chardev socket,id=ipmi0,host=localhost,port=%d,reconnect=10"
> +        " -chardev socket,id=ipmi0,host=127.0.0.1,port=%d,reconnect=10"

Yeah, this make sense.

Acked-by: Corey Minyard <cminyard@mvista.com>

>          " -device ipmi-bmc-extern,chardev=ipmi0,id=bmc0"
>          " -device isa-ipmi-bt,bmc=bmc0", emu_port);
>      qtest_irq_intercept_in(global_qtest, "ioapic");
> -- 
> 2.34.1
>
diff mbox series

Patch

diff --git a/tests/qtest/ipmi-bt-test.c b/tests/qtest/ipmi-bt-test.c
index ed431e34e6..383239bcd4 100644
--- a/tests/qtest/ipmi-bt-test.c
+++ b/tests/qtest/ipmi-bt-test.c
@@ -411,7 +411,7 @@  int main(int argc, char **argv)
     g_test_init(&argc, &argv, NULL);
 
     global_qtest = qtest_initf(
-        " -chardev socket,id=ipmi0,host=localhost,port=%d,reconnect=10"
+        " -chardev socket,id=ipmi0,host=127.0.0.1,port=%d,reconnect=10"
         " -device ipmi-bmc-extern,chardev=ipmi0,id=bmc0"
         " -device isa-ipmi-bt,bmc=bmc0", emu_port);
     qtest_irq_intercept_in(global_qtest, "ioapic");