* [Qemu-devel] [PATCH 2/3] block: complete all IOs before resizing a device
@ 2013-03-11 10:04 Peter Lieven
2013-03-19 13:11 ` Kevin Wolf
0 siblings, 1 reply; 2+ messages in thread
From: Peter Lieven @ 2013-03-11 10:04 UTC (permalink / raw)
To: qemu-devel@nongnu.org
Cc: Kevin Wolf, Paolo Bonzini, Jeff Cody, Anthony Liguori
this patch ensures that all pending IOs are completed
before a device is resized. this is especially important
if a device is shrinked as it the bdrv_check_request()
result is invalidated.
Signed-off-by: Peter Lieven <pl@kamp.de>
---
blockdev.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/blockdev.c b/blockdev.c
index 0e67d06..be36ed7 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1062,6 +1062,9 @@ void qmp_block_resize(const char *device, int64_t size, Error **errp)
return;
}
+ /* complete all in-flight operations before resizing the device */
+ bdrv_drain_all();
+
switch (bdrv_truncate(bs, size)) {
case 0:
break;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH 2/3] block: complete all IOs before resizing a device
2013-03-11 10:04 [Qemu-devel] [PATCH 2/3] block: complete all IOs before resizing a device Peter Lieven
@ 2013-03-19 13:11 ` Kevin Wolf
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2013-03-19 13:11 UTC (permalink / raw)
To: Peter Lieven
Cc: Paolo Bonzini, Jeff Cody, qemu-devel@nongnu.org, Anthony Liguori
Am 11.03.2013 um 11:04 hat Peter Lieven geschrieben:
> this patch ensures that all pending IOs are completed
> before a device is resized. this is especially important
> if a device is shrinked as it the bdrv_check_request()
> result is invalidated.
>
> Signed-off-by: Peter Lieven <pl@kamp.de>
Thanks, applied to the block branch.
Kevin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-03-19 13:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-11 10:04 [Qemu-devel] [PATCH 2/3] block: complete all IOs before resizing a device Peter Lieven
2013-03-19 13:11 ` Kevin Wolf
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).