diff mbox

[RFC,2/7] sd.c: introduce variable for trekking valid data

Message ID 1368202225-45798-3-git-send-email-i.mitsyanko@gmail.com
State New
Headers show

Commit Message

Igor Mitsyanko May 10, 2013, 4:10 p.m. UTC
Initialize it appropriately when various commands are processed.

Signed-off-by: Igor Mitsyanko <i.mitsyanko@gmail.com>
---
 hw/sd/sd.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Peter Maydell June 14, 2013, 11:49 a.m. UTC | #1
On 10 May 2013 17:10, Igor Mitsyanko <i.mitsyanko@gmail.com> wrote:
> Initialize it appropriately when various commands are processed.

"tracking", but the commit message doesn't match the
patch contents anyway -- should this patch have more
content from later patches, or be squashed into one of
them?

>
> Signed-off-by: Igor Mitsyanko <i.mitsyanko@gmail.com>
> ---
>  hw/sd/sd.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/hw/sd/sd.c b/hw/sd/sd.c
> index 1dd1331..775a55c 100644
> --- a/hw/sd/sd.c
> +++ b/hw/sd/sd.c
> @@ -116,6 +116,7 @@ struct SDState {
>      QEMUIOVector qiov;
>      struct iovec iov;
>      BlockDriverAIOCB *aiocb;
> +    uint32_t transf_cnt;

How does this work for migration -- are we guaranteed that
all outstanding AIO requests complete before we try to
migrate?

>  };
>
>  static void sd_set_mode(SDState *sd)
> --
> 1.8.1.4
>


thanks
-- PMM
Stefan Hajnoczi June 17, 2013, 12:30 p.m. UTC | #2
On Fri, Jun 14, 2013 at 12:49:52PM +0100, Peter Maydell wrote:
> On 10 May 2013 17:10, Igor Mitsyanko <i.mitsyanko@gmail.com> wrote:
> > Initialize it appropriately when various commands are processed.
> 
> "tracking", but the commit message doesn't match the
> patch contents anyway -- should this patch have more
> content from later patches, or be squashed into one of
> them?
> 
> >
> > Signed-off-by: Igor Mitsyanko <i.mitsyanko@gmail.com>
> > ---
> >  hw/sd/sd.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/hw/sd/sd.c b/hw/sd/sd.c
> > index 1dd1331..775a55c 100644
> > --- a/hw/sd/sd.c
> > +++ b/hw/sd/sd.c
> > @@ -116,6 +116,7 @@ struct SDState {
> >      QEMUIOVector qiov;
> >      struct iovec iov;
> >      BlockDriverAIOCB *aiocb;
> > +    uint32_t transf_cnt;
> 
> How does this work for migration -- are we guaranteed that
> all outstanding AIO requests complete before we try to
> migrate?

Migration does bdrv_drain_all() to complete all pending requests
(indirectly by pausing the guest in do_vm_stop()).

Stefan
Paolo Bonzini June 17, 2013, 2:03 p.m. UTC | #3
Il 17/06/2013 14:30, Stefan Hajnoczi ha scritto:
>>> > > @@ -116,6 +116,7 @@ struct SDState {
>>> > >      QEMUIOVector qiov;
>>> > >      struct iovec iov;
>>> > >      BlockDriverAIOCB *aiocb;
>>> > > +    uint32_t transf_cnt;
>> > 
>> > How does this work for migration -- are we guaranteed that
>> > all outstanding AIO requests complete before we try to
>> > migrate?
> Migration does bdrv_drain_all() to complete all pending requests
> (indirectly by pausing the guest in do_vm_stop()).

... and sd.c AFAIR doesn't support rerror/werror so it doesn't have to
migrate pending requests.

Paolo
diff mbox

Patch

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 1dd1331..775a55c 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -116,6 +116,7 @@  struct SDState {
     QEMUIOVector qiov;
     struct iovec iov;
     BlockDriverAIOCB *aiocb;
+    uint32_t transf_cnt;
 };
 
 static void sd_set_mode(SDState *sd)