X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fvirt.c;h=b9b224e18ca26b06e5ced408865713812ab5a63c;hb=42a30efe33c4d16276589e0dd1f9e135b38e054d;hp=7e7e057893471f146225ec9ee29e3e13286ddb46;hpb=47e93ad3cb7e70064ac19a03c34b6e6835f19fd5;p=collectd.git diff --git a/src/virt.c b/src/virt.c index 7e7e0578..b9b224e1 100644 --- a/src/virt.c +++ b/src/virt.c @@ -946,7 +946,8 @@ static void memory_stats_submit(gauge_t value, virDomainPtr dom, "last_update", "disk_caches"}; if ((tag_index < 0) || (tag_index >= (int)STATIC_ARRAY_SIZE(tags))) { - ERROR("virt plugin: Array index out of bounds: tag_index = %d", tag_index); + ERROR(PLUGIN_NAME " plugin: Array index out of bounds: tag_index = %d", + tag_index); return; } @@ -1567,7 +1568,7 @@ static int get_perf_events(virDomainPtr domain) { ERROR(PLUGIN_NAME " plugin: virDomainListGetStats failed with status %i.", status); - virErrorPtr err = virConnGetLastError(conn); + virErrorPtr err = virGetLastError(); if (err->code == VIR_ERR_NO_SUPPORT) { ERROR(PLUGIN_NAME " plugin: Disabled unsupported ExtraStats selector: perf"); @@ -1624,7 +1625,7 @@ static int get_vcpu_stats(virDomainPtr domain, unsigned short nr_virt_cpu) { ERROR(PLUGIN_NAME " plugin: virDomainGetVcpus failed with status %i.", status); - virErrorPtr err = virConnGetLastError(conn); + virErrorPtr err = virGetLastError(); if (err->code == VIR_ERR_NO_SUPPORT) { if (extra_stats & ex_stats_vcpu) ERROR(PLUGIN_NAME @@ -1658,7 +1659,7 @@ static int get_pcpu_stats(virDomainPtr dom) { if (nparams < 0) { VIRT_ERROR(conn, "getting the CPU params count"); - virErrorPtr err = virConnGetLastError(conn); + virErrorPtr err = virGetLastError(); if (err->code == VIR_ERR_NO_SUPPORT) { ERROR(PLUGIN_NAME " plugin: Disabled unsupported ExtraStats selector: pcpu"); @@ -1758,7 +1759,7 @@ static int get_memory_stats(virDomainPtr domain) { mem_stats); sfree(minfo); - virErrorPtr err = virConnGetLastError(conn); + virErrorPtr err = virGetLastError(); if (err->code == VIR_ERR_NO_SUPPORT) { ERROR(PLUGIN_NAME " plugin: Disabled unsupported ExtraStats selector: memory"); @@ -1823,7 +1824,7 @@ static int get_disk_err(virDomainPtr domain) { ERROR(PLUGIN_NAME " plugin: failed to get preferred size of disk errors array"); - virErrorPtr err = virConnGetLastError(conn); + virErrorPtr err = virGetLastError(); if (err->code == VIR_ERR_NO_SUPPORT) { ERROR(PLUGIN_NAME @@ -1878,7 +1879,7 @@ static int get_block_device_stats(struct block_device *block_dev) { ERROR(PLUGIN_NAME " plugin: virDomainGetBlockInfo failed for path: %s", block_dev->path); - virErrorPtr err = virConnGetLastError(conn); + virErrorPtr err = virGetLastError(); if (err->code == VIR_ERR_NO_SUPPORT) { if (extra_stats & ex_stats_disk_allocation) @@ -1982,7 +1983,7 @@ static int get_fs_info(virDomainPtr domain) { ERROR(PLUGIN_NAME " plugin: virDomainGetFSInfo failed: %d", mount_points_cnt); - virErrorPtr err = virConnGetLastError(conn); + virErrorPtr err = virGetLastError(); if (err->code == VIR_ERR_NO_SUPPORT) { ERROR(PLUGIN_NAME " plugin: Disabled unsupported ExtraStats selector: fs_info"); @@ -2047,7 +2048,7 @@ static int get_job_stats(virDomainPtr domain) { if (ret != 0) { ERROR(PLUGIN_NAME " plugin: virDomainGetJobStats failed: %d", ret); - virErrorPtr err = virConnGetLastError(conn); + virErrorPtr err = virGetLastError(); // VIR_ERR_INVALID_ARG returned when VIR_DOMAIN_JOB_STATS_COMPLETED flag is // not supported by driver if (err->code == VIR_ERR_NO_SUPPORT || err->code == VIR_ERR_INVALID_ARG) {