1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-10-21 15:33:53 +03:00

Switch libvirtd config loading code to use error APIs

Using VIR_ERROR means the test suite can't catch error messages
easily. Use the proper error reporting APIs instead
This commit is contained in:
Daniel P. Berrange
2012-04-04 15:00:17 +01:00
parent 6e6e9bebc2
commit a4475839dd
2 changed files with 41 additions and 22 deletions

View File

@@ -923,7 +923,12 @@ int main(int argc, char **argv) {
/* Read the config file if it exists*/
if (remote_config_file &&
daemonConfigLoadFile(config, remote_config_file, implicit_conf) < 0) {
VIR_ERROR(_("Can't load config file '%s'"), remote_config_file);
virErrorPtr err = virGetLastError();
if (err && err->message)
VIR_ERROR(_("Can't load config file: %s: %s"),
err->message, remote_config_file);
else
VIR_ERROR(_("Can't load config file: %s"), remote_config_file);
exit(EXIT_FAILURE);
}