On Fri, Aug 10, 2012 at 6:47 PM, Kevin Wolf <kw...@redhat.com> wrote: > From: Paolo Bonzini <pbonz...@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 <pbonz...@redhat.com> > Signed-off-by: Kevin Wolf <kw...@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