From: Thomas Huth <thuth@redhat.com>
To: Coiby Xu <coiby.xu@gmail.com>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, Laurent Vivier <lvivier@redhat.com>,
bharatlkmlkvm@gmail.com, stefanha@redhat.com,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v8 4/4] new qTest case to test the vhost-user-blk-server
Date: Fri, 5 Jun 2020 07:01:33 +0200 [thread overview]
Message-ID: <b8b6c706-e726-e7db-8a1c-ad6fce6ce461@redhat.com> (raw)
In-Reply-To: <20200604233538.256325-5-coiby.xu@gmail.com>
On 05/06/2020 01.35, Coiby Xu wrote:
> This test case has the same tests as tests/virtio-blk-test.c except for
> tests have block_resize. Since vhost-user server can only server one
> client one time, two instances of qemu-storage-daemon are launched
> for the hotplug test.
>
> In order to not block scripts/tap-driver.pl, vhost-user-blk-server will
> send "quit" command to qemu-storage-daemon's QMP monitor. So a function
> is added to libqtest.c to establish socket connection with socket
> server.
>
> Signed-off-by: Coiby Xu <coiby.xu@gmail.com>
> ---
> tests/Makefile.include | 3 +-
> tests/qtest/Makefile.include | 2 +
> tests/qtest/libqos/vhost-user-blk.c | 130 +++++
> tests/qtest/libqos/vhost-user-blk.h | 44 ++
> tests/qtest/libqtest.c | 54 +-
> tests/qtest/libqtest.h | 38 ++
> tests/qtest/vhost-user-blk-test.c | 737 ++++++++++++++++++++++++++++
> 7 files changed, 976 insertions(+), 32 deletions(-)
> create mode 100644 tests/qtest/libqos/vhost-user-blk.c
> create mode 100644 tests/qtest/libqos/vhost-user-blk.h
> create mode 100644 tests/qtest/vhost-user-blk-test.c
[...]
> new file mode 100644
> index 0000000000..3de9c59194
> --- /dev/null
> +++ b/tests/qtest/libqos/vhost-user-blk.c
> @@ -0,0 +1,130 @@
> +/*
> + * libqos driver framework
> + *
> + * Based on tests/qtest/libqos/virtio-blk.c
> + *
> + * Copyright (c) 2020 Coiby Xu <coiby.xu@gmail.com>
> + *
> + * Copyright (c) 2018 Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License version 2.1 as published by the Free Software Foundation.
Thanks for the update! ...
[...]
> diff --git a/tests/qtest/libqos/vhost-user-blk.h b/tests/qtest/libqos/vhost-user-blk.h
> new file mode 100644
> index 0000000000..ef4ef09cca
> --- /dev/null
> +++ b/tests/qtest/libqos/vhost-user-blk.h
> @@ -0,0 +1,44 @@
> +/*
> + * libqos driver framework
> + *
> + * Copyright (c) 2018 Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License version 2 as published by the Free Software Foundation.
... but you've missed the header here :-(
[...]
> diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
> index 49075b55a1..a7b7c96206 100644
> --- a/tests/qtest/libqtest.c
> +++ b/tests/qtest/libqtest.c
> @@ -31,40 +31,9 @@
> #include "qapi/qmp/qlist.h"
> #include "qapi/qmp/qstring.h"
>
> -#define MAX_IRQ 256
> #define SOCKET_TIMEOUT 50
> #define SOCKET_MAX_FDS 16
>
> -
> -typedef void (*QTestSendFn)(QTestState *s, const char *buf);
> -typedef void (*ExternalSendFn)(void *s, const char *buf);
> -typedef GString* (*QTestRecvFn)(QTestState *);
> -
> -typedef struct QTestClientTransportOps {
> - QTestSendFn send; /* for sending qtest commands */
> -
> - /*
> - * use external_send to send qtest command strings through functions which
> - * do not accept a QTestState as the first parameter.
> - */
> - ExternalSendFn external_send;
> -
> - QTestRecvFn recv_line; /* for receiving qtest command responses */
> -} QTestTransportOps;
> -
> -struct QTestState
> -{
> - int fd;
> - int qmp_fd;
> - pid_t qemu_pid; /* our child QEMU process */
> - int wstatus;
> - int expected_status;
> - bool big_endian;
> - bool irq_level[MAX_IRQ];
> - GString *rx;
> - QTestTransportOps ops;
> -};
Why do you have to move struct QTestState and friends to the header
instead? I'd prefer if we could keep it here if possible?
Thomas
next prev parent reply other threads:[~2020-06-05 5:02 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-04 23:35 [PATCH v8 0/4] vhost-user block device backend implementation Coiby Xu
2020-06-04 23:35 ` [PATCH v8 1/4] Allow vu_message_read to be replaced Coiby Xu
2020-06-11 10:45 ` Stefan Hajnoczi
2020-06-11 11:26 ` Marc-André Lureau
2020-06-04 23:35 ` [PATCH v8 2/4] generic vhost user server Coiby Xu
2020-06-11 13:14 ` Stefan Hajnoczi
2020-06-14 18:43 ` Coiby Xu
2020-06-04 23:35 ` [PATCH v8 3/4] vhost-user block device backend server Coiby Xu
2020-06-11 15:24 ` Stefan Hajnoczi
2020-06-14 19:04 ` Coiby Xu
2020-06-04 23:35 ` [PATCH v8 4/4] new qTest case to test the vhost-user-blk-server Coiby Xu
2020-06-05 5:01 ` Thomas Huth [this message]
2020-06-05 6:22 ` Coiby Xu
2020-06-05 9:25 ` Thomas Huth
2020-06-05 13:27 ` Coiby Xu
2020-06-11 12:37 ` [PATCH v8 0/4] vhost-user block device backend implementation Stefano Garzarella
2020-06-14 18:46 ` Coiby Xu
2020-06-15 8:46 ` Stefano Garzarella
2020-06-16 6:55 ` Coiby Xu
2020-06-11 15:27 ` Stefan Hajnoczi
2020-06-12 15:58 ` Coiby Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b8b6c706-e726-e7db-8a1c-ad6fce6ce461@redhat.com \
--to=thuth@redhat.com \
--cc=bharatlkmlkvm@gmail.com \
--cc=coiby.xu@gmail.com \
--cc=kwolf@redhat.com \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).