diff mbox

fix virtio-blk failure after reboot

Message ID 20100915163144.GM3008@redhat.com
State New
Headers show

Commit Message

Gleb Natapov Sept. 15, 2010, 4:31 p.m. UTC
vring_virtqueue should be zeroed otherwise old values will be reused
after reboot.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
--
			Gleb.

Comments

Michael S. Tsirkin Sept. 15, 2010, 9:05 p.m. UTC | #1
On Wed, Sep 15, 2010 at 06:31:44PM +0200, Gleb Natapov wrote:
> vring_virtqueue should be zeroed otherwise old values will be reused
> after reboot.
> 
> Signed-off-by: Gleb Natapov <gleb@redhat.com>

Nice one.

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

> diff --git a/src/virtio-blk.c b/src/virtio-blk.c
> index 34d7863..7a25826 100644
> --- a/src/virtio-blk.c
> +++ b/src/virtio-blk.c
> @@ -109,6 +109,7 @@ init_virtio_blk(u16 bdf)
>          goto fail;
>      }
>      memset(vdrive_g, 0, sizeof(*vdrive_g));
> +    memset(vq, 0, sizeof(*vq));
>      vdrive_g->drive.type = DTYPE_VIRTIO;
>      vdrive_g->drive.cntl_id = bdf;
>      vdrive_g->vq = vq;
> --
> 			Gleb.
Kevin O'Connor Sept. 25, 2010, 3:44 p.m. UTC | #2
On Wed, Sep 15, 2010 at 06:31:44PM +0200, Gleb Natapov wrote:
> vring_virtqueue should be zeroed otherwise old values will be reused
> after reboot.
> 
> Signed-off-by: Gleb Natapov <gleb@redhat.com>

Applied.  Thanks.

-Kevin
Kevin O'Connor Nov. 8, 2010, 11:59 p.m. UTC | #3
On Wed, Sep 15, 2010 at 06:31:44PM +0200, Gleb Natapov wrote:
> vring_virtqueue should be zeroed otherwise old values will be reused
> after reboot.
> 
> Signed-off-by: Gleb Natapov <gleb@redhat.com>
> diff --git a/src/virtio-blk.c b/src/virtio-blk.c
> index 34d7863..7a25826 100644
> --- a/src/virtio-blk.c
> +++ b/src/virtio-blk.c
> @@ -109,6 +109,7 @@ init_virtio_blk(u16 bdf)
>          goto fail;
>      }
>      memset(vdrive_g, 0, sizeof(*vdrive_g));
> +    memset(vq, 0, sizeof(*vq));
>      vdrive_g->drive.type = DTYPE_VIRTIO;
>      vdrive_g->drive.cntl_id = bdf;
>      vdrive_g->vq = vq;

This didn't make it into SeaBIOS v0.6.1.  Should we add this to the
stable branch as v0.6.1.2?  Any other bugfixes that need to go in to
the stable branch (maybe Isaku's pci overflow patches)?

-Kevin
Gleb Natapov Nov. 9, 2010, 6:46 a.m. UTC | #4
On Mon, Nov 08, 2010 at 06:59:37PM -0500, Kevin O'Connor wrote:
> On Wed, Sep 15, 2010 at 06:31:44PM +0200, Gleb Natapov wrote:
> > vring_virtqueue should be zeroed otherwise old values will be reused
> > after reboot.
> > 
> > Signed-off-by: Gleb Natapov <gleb@redhat.com>
> > diff --git a/src/virtio-blk.c b/src/virtio-blk.c
> > index 34d7863..7a25826 100644
> > --- a/src/virtio-blk.c
> > +++ b/src/virtio-blk.c
> > @@ -109,6 +109,7 @@ init_virtio_blk(u16 bdf)
> >          goto fail;
> >      }
> >      memset(vdrive_g, 0, sizeof(*vdrive_g));
> > +    memset(vq, 0, sizeof(*vq));
> >      vdrive_g->drive.type = DTYPE_VIRTIO;
> >      vdrive_g->drive.cntl_id = bdf;
> >      vdrive_g->vq = vq;
> 
> This didn't make it into SeaBIOS v0.6.1.  Should we add this to the
> stable branch as v0.6.1.2?  Any other bugfixes that need to go in to
> the stable branch (maybe Isaku's pci overflow patches)?
> 
Yes. Please add it to stable branch.

--
			Gleb.
Kevin O'Connor Nov. 13, 2010, 3:01 p.m. UTC | #5
On Tue, Nov 09, 2010 at 08:46:43AM +0200, Gleb Natapov wrote:
> On Mon, Nov 08, 2010 at 06:59:37PM -0500, Kevin O'Connor wrote:
> > On Wed, Sep 15, 2010 at 06:31:44PM +0200, Gleb Natapov wrote:
> > > vring_virtqueue should be zeroed otherwise old values will be reused
> > > after reboot.
> > > 
> > > Signed-off-by: Gleb Natapov <gleb@redhat.com>
> > > diff --git a/src/virtio-blk.c b/src/virtio-blk.c
> > > index 34d7863..7a25826 100644
> > > --- a/src/virtio-blk.c
> > > +++ b/src/virtio-blk.c
> > > @@ -109,6 +109,7 @@ init_virtio_blk(u16 bdf)
> > >          goto fail;
> > >      }
> > >      memset(vdrive_g, 0, sizeof(*vdrive_g));
> > > +    memset(vq, 0, sizeof(*vq));
> > >      vdrive_g->drive.type = DTYPE_VIRTIO;
> > >      vdrive_g->drive.cntl_id = bdf;
> > >      vdrive_g->vq = vq;
> > 
> > This didn't make it into SeaBIOS v0.6.1.  Should we add this to the
> > stable branch as v0.6.1.2?  Any other bugfixes that need to go in to
> > the stable branch (maybe Isaku's pci overflow patches)?
> > 
> Yes. Please add it to stable branch.

I added it and tagged it as v0.6.1.2.

-Kevin
diff mbox

Patch

diff --git a/src/virtio-blk.c b/src/virtio-blk.c
index 34d7863..7a25826 100644
--- a/src/virtio-blk.c
+++ b/src/virtio-blk.c
@@ -109,6 +109,7 @@  init_virtio_blk(u16 bdf)
         goto fail;
     }
     memset(vdrive_g, 0, sizeof(*vdrive_g));
+    memset(vq, 0, sizeof(*vq));
     vdrive_g->drive.type = DTYPE_VIRTIO;
     vdrive_g->drive.cntl_id = bdf;
     vdrive_g->vq = vq;