Patchwork [v3,07/16] qtest: Don't reset on qtest chardev connect

login
register
mail settings
Submitter Markus Armbruster
Date June 14, 2013, 11:15 a.m.
Message ID <1371208516-7857-8-git-send-email-armbru@redhat.com>
Download mbox | patch
Permalink /patch/251362/
State New
Headers show

Comments

Markus Armbruster - June 14, 2013, 11:15 a.m.
libqtest's qtest_init() connecting to the qtest socket triggers reset.
This was coded in the hope we could use the same QEMU process for
multiple tests that way.  Never used.  Injects an extra reset even
when it's not used, and that can mess up tests such as the one of
-boot once I'm about to add.  Drop it.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 qtest.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Anthony Liguori - June 14, 2013, 1:44 p.m.
Markus Armbruster <armbru@redhat.com> writes:

> libqtest's qtest_init() connecting to the qtest socket triggers reset.
> This was coded in the hope we could use the same QEMU process for
> multiple tests that way.  Never used.  Injects an extra reset even
> when it's not used, and that can mess up tests such as the one of
> -boot once I'm about to add.  Drop it.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

We could always add a reset qtest command.  Probably makes more sense really.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>

Regards,

Anthony Liguori

> ---
>  qtest.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/qtest.c b/qtest.c
> index 07a9612..74f1842 100644
> --- a/qtest.c
> +++ b/qtest.c
> @@ -472,7 +472,12 @@ static void qtest_event(void *opaque, int event)
>  
>      switch (event) {
>      case CHR_EVENT_OPENED:
> -        qemu_system_reset(false);
> +        /*
> +         * We used to call qemu_system_reset() here, hoping we could
> +         * use the same process for multiple tests that way.  Never
> +         * used.  Injects an extra reset even when it's not used, and
> +         * that can mess up tests, e.g. -boot once.
> +         */
>          for (i = 0; i < ARRAY_SIZE(irq_levels); i++) {
>              irq_levels[i] = 0;
>          }
> -- 
> 1.7.11.7
Markus Armbruster - June 18, 2013, 11:41 a.m.
Anthony Liguori <aliguori@us.ibm.com> writes:

> Markus Armbruster <armbru@redhat.com> writes:
>
>> libqtest's qtest_init() connecting to the qtest socket triggers reset.
>> This was coded in the hope we could use the same QEMU process for
>> multiple tests that way.  Never used.  Injects an extra reset even
>> when it's not used, and that can mess up tests such as the one of
>> -boot once I'm about to add.  Drop it.
>>
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>
> We could always add a reset qtest command.  Probably makes more sense really.

Agree.  But since I don't need it at this time...

> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>

Thanks!

Patch

diff --git a/qtest.c b/qtest.c
index 07a9612..74f1842 100644
--- a/qtest.c
+++ b/qtest.c
@@ -472,7 +472,12 @@  static void qtest_event(void *opaque, int event)
 
     switch (event) {
     case CHR_EVENT_OPENED:
-        qemu_system_reset(false);
+        /*
+         * We used to call qemu_system_reset() here, hoping we could
+         * use the same process for multiple tests that way.  Never
+         * used.  Injects an extra reset even when it's not used, and
+         * that can mess up tests, e.g. -boot once.
+         */
         for (i = 0; i < ARRAY_SIZE(irq_levels); i++) {
             irq_levels[i] = 0;
         }