
On 05/15/2014 11:59 PM, Markus Armbruster wrote:
Copying Luiz...
src/qemu/qemu_monitor_json.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
+ if ((data = virJSONValueObjectGet(reply, "error"))) { + const char *klass = virJSONValueObjectGetString(data, "class"); + const char *desc = virJSONValueObjectGetString(data, "desc");
- if (ret < 0) + if (STREQ_NULLABLE(klass, "GenericError") && + STREQ_NULLABLE(desc, "guest hasn't updated any stats yet")) {
You snipped so much of the diff that I have trouble finding the place this applies.
Apologies; it is for qemuMonitorJSONGetMemoryStats() calling qom-get: http://libvirt.org/git/?p=libvirt.git;a=blob;f=src/qemu/qemu_monitor_json.c;...
Is "no stats yet" really an error? Libvirt has done nothing wrong, and I'd argue the guest hasn't done anything wrong, either. Should we simply return an empty result? Like "cat" on a file that hasn't gotten its data, yet.
Yes, that would be reasonable. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org