openvz: Add more descriptive error message on Find failure

If openvzDomainLookupByID or openvzDomainLookupByName fails
to find a vm, let's be a bit more descriptive by providing
the failing id or name in the error message.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
This commit is contained in:
John Ferlan 2018-03-09 11:48:03 -05:00
parent e5d682c0b4
commit b7eb4b93c3

View File

@ -351,7 +351,8 @@ static virDomainPtr openvzDomainLookupByID(virConnectPtr conn,
openvzDriverUnlock(driver);
if (!vm) {
virReportError(VIR_ERR_NO_DOMAIN, NULL);
virReportError(VIR_ERR_NO_DOMAIN,
_("no domain with matching id '%d'"), id);
goto cleanup;
}
@ -425,7 +426,8 @@ static virDomainPtr openvzDomainLookupByName(virConnectPtr conn,
openvzDriverUnlock(driver);
if (!vm) {
virReportError(VIR_ERR_NO_DOMAIN, NULL);
virReportError(VIR_ERR_NO_DOMAIN,
_("no domain with matching name '%s'"), name);
goto cleanup;
}
@ -1114,8 +1116,8 @@ openvzDomainCreateWithFlags(virDomainPtr dom, unsigned int flags)
openvzDriverUnlock(driver);
if (!vm) {
virReportError(VIR_ERR_NO_DOMAIN, "%s",
_("no domain with matching id"));
virReportError(VIR_ERR_NO_DOMAIN,
_("no domain with matching name '%s'"), dom->name);
goto cleanup;
}