[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 3/3] fdc-test: introduced qtest no_media_on_s
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v3 3/3] fdc-test: introduced qtest no_media_on_start |
Date: |
Wed, 23 May 2012 14:35:19 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 |
Am 23.05.2012 14:15, schrieb Paolo Bonzini:
> Il 23/05/2012 13:27, Pavel Hrdina ha scritto:
>> After guest start DSKCHG bit in DIR register should be set. If there
>> is no media in drive, this bit should be set all the time.
>>
>> Signed-off-by: Pavel Hrdina <address@hidden>
>> ---
>> tests/fdc-test.c | 29 ++++++++++++++++++++++++++---
>> 1 files changed, 26 insertions(+), 3 deletions(-)
>>
>> diff --git a/tests/fdc-test.c b/tests/fdc-test.c
>> index 5b5dd74..e002c5c 100644
>> --- a/tests/fdc-test.c
>> +++ b/tests/fdc-test.c
>> @@ -108,6 +108,30 @@ static void send_step_pulse(void)
>> cyl = (cyl + 1) % 4;
>> }
>>
>> +static void test_no_media_on_start(void)
>> +{
>> + uint8_t dir;
>> +
>> + /* Media changed bit must be set all time after start if there is
>> + * no media in drive. */
>> + dir = inb(FLOPPY_BASE + reg_dir);
>> + assert_bit_set(dir, DSKCHG);
>> + dir = inb(FLOPPY_BASE + reg_dir);
>> + assert_bit_set(dir, DSKCHG);
>> + send_step_pulse();
>> + send_step_pulse();
>> + dir = inb(FLOPPY_BASE + reg_dir);
>> + assert_bit_set(dir, DSKCHG);
>> + dir = inb(FLOPPY_BASE + reg_dir);
>> + assert_bit_set(dir, DSKCHG);
>> +
>> + /* Insert media for other tests. */
>> + qmp("{'execute':'change', 'arguments':{ 'device':'floppy0', "
>> + "'target': '%s' }}", test_image);
>> + qmp(""); /* ignore event (FIXME open -> open transition?!) */
>> + qmp(""); /* ignore event */
>> +}
Can you also include a read from the CMOS to verify your fix?
> This makes it impossible to use the testcase with -p/-s (try
> tests/fdc-test --help). Please move these commands to
> test_media_change.
Makes sense.
> Alternatively (perhaps better), leave the "-drive"
> option and add a matching eject command to test_no_media_on_start.
Ejecting a floppy while the VM is running is different from not having
it inserted at startup. Not sure, maybe system_reset after ejecting
would help to run the same code paths.
Kevin