qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Artyom Tarasenko <atar4qemu@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Blue Swirl <blauwirbel@gmail.com>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 07/11] blockdev: flip default cache mode from writethrough to writeback
Date: Wed, 27 Mar 2013 16:16:45 +0100	[thread overview]
Message-ID: <CACXAS8AKvhEb7OSsaDx73hCTOhAFvyO2-ATC=LSjAqXxe1ce1w@mail.gmail.com> (raw)
In-Reply-To: <1344617249-6620-8-git-send-email-kwolf@redhat.com>

On Fri, Aug 10, 2012 at 6:47 PM, Kevin Wolf <kwolf@redhat.com> wrote:
> From: Paolo Bonzini <pbonzini@redhat.com>
>
> Now all major device models (IDE, SCSI, virtio) can choose between
> writethrough and writeback at run-time, and virtio will even revert
> to writethrough if the guest is not capable of sending flushes.  So
> we can change the default to writeback at last.
>
> Tested, for lack of a better idea, with a breakpoint on bdrv_open
> and all cache choices one by one.

This patch breaks shutting down of a sparc32 guest (or at least the
Debian-4 image I have):

$ sparc-softmmu/qemu-system-sparc -M SS-5 -nographic -hda  ../disk-debian-4
[...]
Debian GNU/Linux 4.0 debian ttyS0

debian login: root
Password:
Linux debian 2.6.18-6-sparc32 #1 Tue Nov 10 00:31:37 UTC 2009 sparc
# poweroff
[...]
Will now halt.
Synchronizing SCSI cache for disk sda:
esp0: Aborting command
esp0: dumping state
esp0: dma -- cond_reg<a4400010> addr<f000000b>
esp0: SW [sreg<03> sstep<04> ireg<10>]
esp0: HW reread [sreg<03> sstep<00> ireg<08>]
esp0: current command [tgt<00> lun<00> pphase<MSGINDONE> cphase<CLUELESS>]
esp0: disconnected
esp0: Aborting command
esp0: dumping state
esp0: dma -- cond_reg<a4400010> addr<f000000b>
esp0: SW [sreg<03> sstep<04> ireg<10>]
esp0: HW reread [sreg<03> sstep<04> ireg<00>]
esp0: current command [tgt<00> lun<00> pphase<UNISSUED> cphase<UNISSUED>]
esp0: disconnected
esp0: Resetting scsi bus
esp0: SCSI bus reset interrupt
esp0: no command in esp_handle()
Kernel panic - not syncing: esp_handle: current_SC == penguin within interrupt!
 <0>Press Stop-A (L1-A) to return to the boot prom


Without the patch, the line "Synchronizing SCSI cache for disk sda"
doesn't come up, so the patch probably just unveils a bug somewhere
else (esp?).

> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  blockdev.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/blockdev.c b/blockdev.c
> index 8669142..7c83baa 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -377,6 +377,7 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi)
>         }
>      }
>
> +    bdrv_flags |= BDRV_O_CACHE_WB;
>      if ((buf = qemu_opt_get(opts, "cache")) != NULL) {
>          if (bdrv_parse_cache_flags(buf, &bdrv_flags) != 0) {
>              error_report("invalid cache option");
> --
> 1.7.6.5
>
>



-- 
Regards,
Artyom Tarasenko

linux/sparc and solaris/sparc under qemu blog:
http://tyom.blogspot.com/search/label/qemu

  reply	other threads:[~2013-03-27 15:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-10 16:47 [Qemu-devel] [PULL 00/11] Block patches Kevin Wolf
2012-08-10 16:47 ` [Qemu-devel] [PATCH 01/11] virtio-blk: fix use-after-free while handling scsi commands Kevin Wolf
2012-08-10 16:47 ` [Qemu-devel] [PATCH 02/11] ahci: Fix ahci cdrom read corruptions for reads > 128k Kevin Wolf
2012-08-10 16:47 ` [Qemu-devel] [PATCH 03/11] ahci: Fix sglist memleak in ahci_dma_rw_buf() Kevin Wolf
2012-08-10 16:47 ` [Qemu-devel] [PATCH 04/11] qemu-iotests: Save some sed processes Kevin Wolf
2012-08-10 16:47 ` [Qemu-devel] [PATCH 05/11] virtio-blk: support VIRTIO_BLK_F_CONFIG_WCE Kevin Wolf
2012-08-12 20:47   ` Anthony Liguori
2012-08-10 16:47 ` [Qemu-devel] [PATCH 06/11] virtio-blk: disable write cache if not negotiated Kevin Wolf
2012-08-10 16:47 ` [Qemu-devel] [PATCH 07/11] blockdev: flip default cache mode from writethrough to writeback Kevin Wolf
2013-03-27 15:16   ` Artyom Tarasenko [this message]
2013-03-27 15:19     ` Paolo Bonzini
2012-08-10 16:47 ` [Qemu-devel] [PATCH 08/11] qed: mark image clean after repair succeeds Kevin Wolf
2012-08-10 16:47 ` [Qemu-devel] [PATCH 09/11] qcow2: " Kevin Wolf
2012-08-10 16:47 ` [Qemu-devel] [PATCH 10/11] block: add BLOCK_O_CHECK for qemu-img check Kevin Wolf
2012-08-10 16:47 ` [Qemu-devel] [PATCH 11/11] qemu-iotests: skip 039 with ./check -nocache Kevin Wolf
2012-08-12 18:14 ` [Qemu-devel] [PULL 00/11] Block patches Anthony Liguori

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='CACXAS8AKvhEb7OSsaDx73hCTOhAFvyO2-ATC=LSjAqXxe1ce1w@mail.gmail.com' \
    --to=atar4qemu@gmail.com \
    --cc=blauwirbel@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@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 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).