On some fallback paths in virsh, error reported by the previously failed
API is cleared by virResetLastError() that doesn't free error stored by
virsh. This patch changes this to clear it using vshResetLibvirtError().
if (err && err->code == VIR_ERR_NO_DOMAIN_METADATA) {
desc = vshStrdup(ctl, "");
- virResetLastError();
+ vshResetLibvirtError();
return desc;
}
fallback:
/* fall back to old method (0.9.12 and older) */
- virResetLastError();
+ vshResetLibvirtError();
/* list active domains, if necessary */
if (!MATCH(VIR_CONNECT_LIST_FILTERS_ACTIVE) ||
if (current < 0) {
virDomainSnapshotPtr other = virDomainSnapshotCurrent(dom, 0);
- virResetLastError();
+ vshResetLibvirtError();
current = 0;
if (other) {
if (STREQ(name, virDomainSnapshotGetName(other)))
if (metadata < 0) {
metadata = virDomainSnapshotNum(dom,
VIR_DOMAIN_SNAPSHOT_LIST_METADATA);
- virResetLastError();
+ vshResetLibvirtError();
}
if (metadata >= 0)
vshPrint(ctl, "%-15s %s\n", _("Metadata:"),