Commit bb1b0ed9 authored by Michal Privoznik's avatar Michal Privoznik

libvirtSnmp: Report libvirt errors if no domain is found

Instead of plain printf(), report proper libvirt error.
Signed-off-by: default avatarMichal Privoznik <[email protected]>
Reviewed-by: default avatarMartin Kletzander <[email protected]>
parent 6aa3f553
......@@ -322,7 +322,7 @@ libvirtSnmpCreate(unsigned char *uuid, int state)
}
if (!(dom = virDomainLookupByUUID(conn, uuid))) {
printf("Cannot find domain to create\n");
printLibvirtError("No such domain");
return -1;
}
......@@ -344,7 +344,7 @@ libvirtSnmpDestroy(unsigned char *uuid)
int ret = -1;
if (!(dom = virDomainLookupByUUID(conn, uuid))) {
printf("Cannot find domain to destroy\n");
printLibvirtError("No such domain");
return -1;
}
......@@ -366,7 +366,7 @@ libvirtSnmpChangeState(unsigned char *uuid, int newstate, int oldstate)
int ret = -1;
if (!(dom = virDomainLookupByUUID(conn, uuid))) {
printf("Cannot find domain to change\n");
printLibvirtError("No such domain");
return 1;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment