Improve error reporting for virConnectGetHostname calls

All drivers have copy + pasted inadequate error reporting which wraps
util.c:virGetHostname. Move all error reporting to this function, and improve
what we report.

Changes from v1:
  Drop the driver wrappers around virGetHostname. This means we still need
  to keep the new conn argument to virGetHostname, but I think it's worth
  it.
This commit is contained in:
Cole Robinson
2009-10-23 13:01:22 -04:00
parent af1e2ede26
commit 517761fd96
11 changed files with 29 additions and 113 deletions

View File

@@ -524,7 +524,7 @@ cmdRunConsole(vshControl *ctl, virDomainPtr dom)
char *thatHost = NULL;
char *thisHost = NULL;
if (!(thisHost = virGetHostname())) {
if (!(thisHost = virGetHostname(ctl->conn))) {
vshError(ctl, "%s", _("Failed to get local hostname"));
goto cleanup;
}