From: Kevin Wolf <kwolf@redhat.com>
To: Pavel Hrdina <phrdina@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/2] fdc: fix media detection
Date: Tue, 22 May 2012 14:01:31 +0200 [thread overview]
Message-ID: <4FBB801B.4010401@redhat.com> (raw)
In-Reply-To: <32c32f56ba695401f1357dff7935b9ace76c1ebf.1337683541.git.phrdina@redhat.com>
Am 22.05.2012 12:59, schrieb Pavel Hrdina:
> We have to set up 'media_changed' after guest start so floppy driver
> could detect that there is no media in drive. For this purpose we call
> 'fdctrl_change_cb' instead of 'fd_revalidate' in 'fdctrl_connect_drives'.
> 'fd_revalidate' is called inside 'fdctrl_change_cb'.
>
> In 'fdctrl_handle_seek' we always set current track because we don't care
> if there is media inserted or not.
>
> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Can you please add a qtest case that shows the problems that you're
fixing in this series?
> diff --git a/hw/fdc.c b/hw/fdc.c
> index cb4cd25..337b35a 100644
> --- a/hw/fdc.c
> +++ b/hw/fdc.c
> @@ -1617,11 +1617,7 @@ static void fdctrl_handle_seek(FDCtrl *fdctrl, int direction)
> /* The seek command just sends step pulses to the drive and doesn't care if
> * there is a medium inserted of if it's banging the head against the drive.
> */
> - if (fdctrl->fifo[2] > cur_drv->max_track) {
> - cur_drv->track = cur_drv->max_track;
> - } else {
> - cur_drv->track = fdctrl->fifo[2];
> - }
> + cur_drv->track = fdctrl->fifo[2];
Why is it okay to have cur_drv->track point outside the floppy? Won't it
mess up future calculations? Not all other places check it again
cur_drv->max_track.
Kevin
next prev parent reply other threads:[~2012-05-22 12:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-22 10:59 [Qemu-devel] [PATCH 0/2] fdc: fix media handling Pavel Hrdina
2012-05-22 10:59 ` [Qemu-devel] [PATCH 1/2] fdc: floppy drive should be visible after start without media Pavel Hrdina
2012-05-22 10:59 ` [Qemu-devel] [PATCH 2/2] fdc: fix media detection Pavel Hrdina
2012-05-22 12:01 ` Kevin Wolf [this message]
2012-05-22 13:28 ` Pavel Hrdina
2012-05-22 13:42 ` Kevin Wolf
2012-05-22 13:56 ` Pavel Hrdina
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=4FBB801B.4010401@redhat.com \
--to=kwolf@redhat.com \
--cc=phrdina@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.