mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user