Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:Update
qemu-testsuite.9341
0100-block-backend-remove-blk_flush_all.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0100-block-backend-remove-blk_flush_all.patch of Package qemu-testsuite.9341
From d5579ed93f064d0c53d4b3161b491ef164195c16 Mon Sep 17 00:00:00 2001 From: John Snow <jsnow@redhat.com> Date: Thu, 22 Sep 2016 21:45:52 -0400 Subject: [PATCH] block-backend: remove blk_flush_all We can teach Xen to drain and flush each device as it needs to, instead of trying to flush ALL devices. This removes the last user of blk_flush_all. The function is therefore removed under the premise that any new uses of blk_flush_all would be the wrong paradigm: either flush the single device that requires flushing, or use an appropriate flush_all mechanism from outside of the BlkBackend layer. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Acked-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 49137bf6845eaecad51a047fc06dd11c56118460) [BR: BSC#1013341 - remove also from place we have patched] Signed-off-by: Bruce Rogers <brogers@suse.com> --- block/block-backend.c | 22 ---------------------- hw/i386/xen/xen_platform.c | 4 ---- hw/ide/piix.c | 4 ++++ include/sysemu/block-backend.h | 1 - 4 files changed, 4 insertions(+), 27 deletions(-) diff --git a/block/block-backend.c b/block/block-backend.c index 16c9d5e0f2..db350d7b64 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -1611,25 +1611,3 @@ int blk_commit_all(void) } return 0; } - -int blk_flush_all(void) -{ - BlockBackend *blk = NULL; - int result = 0; - - while ((blk = blk_all_next(blk)) != NULL) { - AioContext *aio_context = blk_get_aio_context(blk); - int ret; - - aio_context_acquire(aio_context); - if (blk_is_inserted(blk)) { - ret = blk_flush(blk); - if (ret < 0 && !result) { - result = ret; - } - } - aio_context_release(aio_context); - } - - return result; -} diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c index d15ef67e19..24dc3eb304 100644 --- a/hw/i386/xen/xen_platform.c +++ b/hw/i386/xen/xen_platform.c @@ -139,8 +139,6 @@ static void platform_fixed_ioport_writew(void *opaque, uint32_t addr, uint32_t v devices, and bit 2 the non-primary-master IDE devices. */ if (val & UNPLUG_ALL_IDE_DISKS) { DPRINTF("unplug disks\n"); - blk_drain_all(); - blk_flush_all(); pci_unplug_disks(pci_dev->bus); } if (val & UNPLUG_ALL_NICS) { @@ -333,8 +331,6 @@ static void xen_platform_ioport_writeb(void *opaque, hwaddr addr, */ PCIDevice *pci_dev = PCI_DEVICE(s); DPRINTF("unplug disks\n"); - blk_drain_all(); - blk_flush_all(); pci_unplug_disks(pci_dev->bus); DPRINTF("unplug nics\n"); pci_unplug_nics(pci_dev->bus); diff --git a/hw/ide/piix.c b/hw/ide/piix.c index 6d76ce980b..00381f4e42 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -179,6 +179,10 @@ int pci_piix3_xen_ide_unplug(DeviceState *dev) if (di != NULL && !di->media_cd) { BlockBackend *blk = blk_by_legacy_dinfo(di); DeviceState *ds = blk_get_attached_dev(blk); + + blk_drain(blk); + blk_flush(blk); + if (ds) { blk_detach_dev(blk, ds); } diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h index c62b6fe96d..f22b58c068 100644 --- a/include/sysemu/block-backend.h +++ b/include/sysemu/block-backend.h @@ -126,7 +126,6 @@ BlockAIOCB *blk_aio_ioctl(BlockBackend *blk, unsigned long int req, void *buf, int blk_co_discard(BlockBackend *blk, int64_t sector_num, int nb_sectors); int blk_co_flush(BlockBackend *blk); int blk_flush(BlockBackend *blk); -int blk_flush_all(void); int blk_commit_all(void); void blk_drain(BlockBackend *blk); void blk_drain_all(void);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor