diff mbox

[v3,5/6] qtest/bios-tables: Correct Q35 command line

Message ID 1412187569-23452-6-git-send-email-jsnow@redhat.com
State New
Headers show

Commit Message

John Snow Oct. 1, 2014, 6:19 p.m. UTC
If the Q35 board types are to begin recognizing
and decoding syntactic sugar for drive/device
declarations, then workarounds found within
the qtests suite need to be adjusted to prevent
any test failures after the fix.

bios-tables-test improperly uses this cli:
-drive file=etc,id=hd -device ide-hd,drive=hd

Which will create a drive and device due to
the lack of specifying if=none. Then, it will
attempt to create a second device and fail.

This patch corrects this test to always use
the full, non-sugared -device/-drive syntax
for both PC and Q35.

Signed-off-by: John Snow <jsnow@redhat.com>
---
 tests/bios-tables-test.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Comments

Michael S. Tsirkin Oct. 2, 2014, 1:03 p.m. UTC | #1
On Wed, Oct 01, 2014 at 02:19:28PM -0400, John Snow wrote:
> If the Q35 board types are to begin recognizing
> and decoding syntactic sugar for drive/device
> declarations, then workarounds found within
> the qtests suite need to be adjusted to prevent
> any test failures after the fix.
> 
> bios-tables-test improperly uses this cli:
> -drive file=etc,id=hd -device ide-hd,drive=hd
> 
> Which will create a drive and device due to
> the lack of specifying if=none. Then, it will
> attempt to create a second device and fail.
> 
> This patch corrects this test to always use
> the full, non-sugared -device/-drive syntax
> for both PC and Q35.
> 
> Signed-off-by: John Snow <jsnow@redhat.com>

Reviewed-by: Michael S. Tsirkin <mst@redhat.com>

> ---
>  tests/bios-tables-test.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
> index 602932b..9e4d205 100644
> --- a/tests/bios-tables-test.c
> +++ b/tests/bios-tables-test.c
> @@ -714,14 +714,12 @@ static void test_acpi_one(const char *params, test_data *data)
>      uint8_t signature_high;
>      uint16_t signature;
>      int i;
> -    const char *device = "";
>  
> -    if (!g_strcmp0(data->machine, MACHINE_Q35)) {
> -        device = ",id=hd -device ide-hd,drive=hd";
> -    }
> +    args = g_strdup_printf("-net none -display none %s "
> +                           "-drive id=hd0,if=none,file=%s "
> +                           "-device ide-hd,drive=hd0 ",
> +                           params ? params : "", disk);
>  
> -    args = g_strdup_printf("-net none -display none %s -drive file=%s%s,",
> -                           params ? params : "", disk, device);
>      qtest_start(args);
>  
>     /* Wait at most 1 minute */
> -- 
> 1.9.3
diff mbox

Patch

diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
index 602932b..9e4d205 100644
--- a/tests/bios-tables-test.c
+++ b/tests/bios-tables-test.c
@@ -714,14 +714,12 @@  static void test_acpi_one(const char *params, test_data *data)
     uint8_t signature_high;
     uint16_t signature;
     int i;
-    const char *device = "";
 
-    if (!g_strcmp0(data->machine, MACHINE_Q35)) {
-        device = ",id=hd -device ide-hd,drive=hd";
-    }
+    args = g_strdup_printf("-net none -display none %s "
+                           "-drive id=hd0,if=none,file=%s "
+                           "-device ide-hd,drive=hd0 ",
+                           params ? params : "", disk);
 
-    args = g_strdup_printf("-net none -display none %s -drive file=%s%s,",
-                           params ? params : "", disk, device);
     qtest_start(args);
 
    /* Wait at most 1 minute */