[libvirt] [PATCH] qemu: bulk stats: Ignore errors from missing/inaccessible disks

Rather than erroring out make the best attempt to retrieve other data if disks are inaccessible or missing. The failure will still be logged though. Since the bulk stats API is called on multiple domains an error like this makes the API unusable. This regression was introduced by commit 596a13713420e01b20ce3dc3fdbe06d073682675 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1209394 --- src/qemu/qemu_driver.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f5a3ef9..e79e2a9 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -19275,8 +19275,13 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver, ret = 0; goto cleanup; } - if (qemuStorageLimitsRefresh(driver, cfg, dom, src) < 0) + + if (qemuStorageLimitsRefresh(driver, cfg, dom, src) < 0) { + virResetLastError(); + ret = 0; goto cleanup; + } + if (src->allocation) QEMU_ADD_BLOCK_PARAM_ULL(record, maxparams, block_idx, "allocation", src->allocation); -- 2.3.5

On 04/15/2015 10:19 AM, Peter Krempa wrote:
Rather than erroring out make the best attempt to retrieve other data if disks are inaccessible or missing. The failure will still be logged though.
Since the bulk stats API is called on multiple domains an error like this makes the API unusable. This regression was introduced by commit 596a13713420e01b20ce3dc3fdbe06d073682675
D'oh - that points to me.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1209394 --- src/qemu/qemu_driver.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Wed, Apr 15, 2015 at 10:25:35 -0600, Eric Blake wrote:
On 04/15/2015 10:19 AM, Peter Krempa wrote:
Rather than erroring out make the best attempt to retrieve other data if disks are inaccessible or missing. The failure will still be logged though.
Since the bulk stats API is called on multiple domains an error like this makes the API unusable. This regression was introduced by commit 596a13713420e01b20ce3dc3fdbe06d073682675
D'oh - that points to me.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1209394 --- src/qemu/qemu_driver.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
ACK.
Pushed; Thanks. Peter
participants (2)
-
Eric Blake
-
Peter Krempa