qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	John Snow <jsnow@redhat.com>
Subject: Re: [Qemu-devel] efi var store migration assert (bdrv_co_do_pwritev: Assertion `!(bs->open_flags & 0x0800)' failed.)
Date: Fri, 15 Apr 2016 12:49:00 +0200	[thread overview]
Message-ID: <5710C71C.2070901@redhat.com> (raw)
In-Reply-To: <CAFEAcA-ZwDZUSAsBhns-EF3dv0P2G3O9a=_vZOSt1NvwOGu+_Q@mail.gmail.com>



On 14/04/2016 17:30, Peter Maydell wrote:
> On 4 April 2016 at 11:40, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>>
>> On 01/04/2016 19:58, Dr. David Alan Gilbert wrote:
>>> In the continuing journeys of trying to migrate a q35 guest with ovmf,
>>> I've just hit this assert:
>>>
>>> qemu-system-x86_64: /root/git/qemu/block/io.c:1297: bdrv_co_do_pwritev: Assertion `!(bs->open_flags & 0x0800)' failed.
>>>
>>> This is just ahead of rc0 - 1458317c8ada834cf39287f6d11a8cb8a37360d6 from yesterday.
>>
>> Try this...
> 
> Hi Paolo -- this bug is on the list of "things we should probably
> fix for 2.6", but your fix below doesn't have your Signed-off-by
> line. Were you planning to send this as a proper patch, or could
> you provide an s-o-b line so somebody else (David?) can take the
> code and clean it up into an actual patch?

Indeed. I had sent the S-o-b to David, but that was a private email so

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Thanks,

Paolo

> thanks
> -- PMM
> 
>>
>> Paolo
>>
>> diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c
>> index c475c2a..e96a7b0 100644
>> --- a/hw/block/pflash_cfi01.c
>> +++ b/hw/block/pflash_cfi01.c
>> @@ -46,6 +46,7 @@
>>  #include "exec/address-spaces.h"
>>  #include "qemu/host-utils.h"
>>  #include "hw/sysbus.h"
>> +#include "sysemu/sysemu.h"
>>
>>  #define PFLASH_BUG(fmt, ...) \
>>  do { \
>> @@ -97,6 +98,7 @@ struct pflash_t {
>>      MemoryRegion mem;
>>      char *name;
>>      void *storage;
>> +    VMChangeStateEntry *vmstate;
>>  };
>>
>>  static int pflash_post_load(void *opaque, int version_id);
>> @@ -944,13 +946,24 @@ MemoryRegion *pflash_cfi01_get_memory(pflash_t *fl)
>>      return &fl->mem;
>>  }
>>
>> +static void postload_update_cb(void *opaque, int running, RunState state)
>> +{
>> +    pflash_t *pfl = opaque;
>> +
>> +    /* This is called after bdrv_invalidate_cache_all.  */
>> +    qemu_del_vm_change_state_handler(pfl->vmstate);
>> +    pfl->vmstate = NULL;
>> +
>> +    DPRINTF("%s: updating bdrv for %s\n", __func__, pfl->name);
>> +    pflash_update(pfl, 0, pfl->sector_len * pfl->nb_blocs);
>> +}
>> +
>>  static int pflash_post_load(void *opaque, int version_id)
>>  {
>>      pflash_t *pfl = opaque;
>>
>>      if (!pfl->ro) {
>> -        DPRINTF("%s: updating bdrv for %s\n", __func__, pfl->name);
>> -        pflash_update(pfl, 0, pfl->sector_len * pfl->nb_blocs);
>> +        pfl->vmstate = qemu_add_vm_change_state_handler(postload_update_cb, pfl);
>>      }
>>      return 0;
>>  }

      reply	other threads:[~2016-04-15 10:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-01 17:58 [Qemu-devel] efi var store migration assert (bdrv_co_do_pwritev: Assertion `!(bs->open_flags & 0x0800)' failed.) Dr. David Alan Gilbert
2016-04-04 10:40 ` Paolo Bonzini
2016-04-05 10:48   ` Dr. David Alan Gilbert
2016-04-05 10:58     ` Laszlo Ersek
2016-04-05 11:25       ` Dr. David Alan Gilbert
2016-04-05 11:34         ` Laszlo Ersek
2016-04-05 13:06     ` Paolo Bonzini
2016-04-14 15:30   ` Peter Maydell
2016-04-15 10:49     ` Paolo Bonzini [this message]

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=5710C71C.2070901@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).