[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 1/7] block: Monitor command commit neglects to report
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PULL 1/7] block: Monitor command commit neglects to report some errors |
Date: |
Fri, 25 Jan 2013 12:14:32 -0200 |
From: Jeff Cody <address@hidden>
The non-live bdrv_commit() function may return one of the following
errors: -ENOTSUP, -EBUSY, -EACCES, -EIO. The only error that is
checked in the HMP handler is -EBUSY, so the monitor command 'commit'
silently fails for all error cases other than 'Device is in use'.
Report error using monitor_printf() and strerror(), and convert existing
qerror_report() calls in do_commit() to monitor_printf().
Signed-off-by: Jeff Cody <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>
---
blockdev.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/blockdev.c b/blockdev.c
index 9126587..030070b 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -642,21 +642,17 @@ void do_commit(Monitor *mon, const QDict *qdict)
if (!strcmp(device, "all")) {
ret = bdrv_commit_all();
- if (ret == -EBUSY) {
- qerror_report(QERR_DEVICE_IN_USE, device);
- return;
- }
} else {
bs = bdrv_find(device);
if (!bs) {
- qerror_report(QERR_DEVICE_NOT_FOUND, device);
+ monitor_printf(mon, "Device '%s' not found\n", device);
return;
}
ret = bdrv_commit(bs);
- if (ret == -EBUSY) {
- qerror_report(QERR_DEVICE_IN_USE, device);
- return;
- }
+ }
+ if (ret < 0) {
+ monitor_printf(mon, "'commit' error for '%s': %s\n", device,
+ strerror(-ret));
}
}
--
1.8.1.GIT
- [Qemu-devel] [PULL for-1.4 0/7] QMP queue, Luiz Capitulino, 2013/01/25
- [Qemu-devel] [PULL 1/7] block: Monitor command commit neglects to report some errors,
Luiz Capitulino <=
- [Qemu-devel] [PULL 3/7] balloon: re-enable balloon stats, Luiz Capitulino, 2013/01/25
- [Qemu-devel] [PULL 2/7] balloon: drop old stats code & API, Luiz Capitulino, 2013/01/25
- [Qemu-devel] [PULL 5/7] qemu-char: Add new char backend CirMemCharDriver, Luiz Capitulino, 2013/01/25
- [Qemu-devel] [PULL 4/7] docs: document virtio-balloon stats, Luiz Capitulino, 2013/01/25
- [Qemu-devel] [PULL 7/7] QAPI: Introduce memchar-read QMP command, Luiz Capitulino, 2013/01/25
- [Qemu-devel] [PULL 6/7] QAPI: Introduce memchar-write QMP command, Luiz Capitulino, 2013/01/25