Received: from eggs.gnu.org ([208.118.235.92]:45653) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKs6J-0003tm-4w for qemu-devel@nongnu.org; Wed, 27 Mar 2013 11:17:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UKs67-0004Qr-Ox for qemu-devel@nongnu.org; Wed, 27 Mar 2013 11:17:19 -0400 Received: from mail-la0-x22a.google.com ([2a00:1450:4010:c03::22a]:55662) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKs67-0004QS-Gv for qemu-devel@nongnu.org; Wed, 27 Mar 2013 11:17:07 -0400 Received: by mail-la0-f42.google.com with SMTP id fe20so15935761lab.15 for ; Wed, 27 Mar 2013 08:17:06 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1344617249-6620-8-git-send-email-kwolf@redhat.com> References: <1344617249-6620-1-git-send-email-kwolf@redhat.com> <1344617249-6620-8-git-send-email-kwolf@redhat.com> From: Artyom Tarasenko Date: Wed, 27 Mar 2013 16:16:45 +0100 Message-ID: Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Qemu-devel] [PATCH 07/11] blockdev: flip default cache mode from writethrough to writeback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , Blue Swirl , qemu-devel On Fri, Aug 10, 2012 at 6:47 PM, Kevin Wolf wrote: > From: Paolo Bonzini > > 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 addr 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 cphase] esp0: disconnected esp0: Aborting command esp0: dumping state esp0: dma -- cond_reg addr 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 cphase] 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 > Signed-off-by: Kevin Wolf > --- > 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