+Mon Jan 12 18:55:16 +0100 2009 Jim Meyering <meyering@redhat.com>
+
+ diagnose "libvirtd --config=no-such-file"
+ * qemud/qemud.c (remoteReadConfigFile): Don't return 0 (success)
+ when the config file is unreadable or nonexistent
+ Return -1, not 0, upon virConfReadFile failure.
+ (main): If remote_config_file is not specified via --config(-f),
+ use the default config file only if it exists. Otherwise,
+ use /dev/null.
+ * src/conf.c (virConfReadFile): Don't diagnose virFileReadAll
+ failure, since it already does that.
+
Mon Jan 12 18:55:15 +0100 2009 Jim Meyering <meyering@redhat.com>
fix non-srcdir build failure
/*
* qemud.c: daemon start of day, guest process & i/o management
*
- * Copyright (C) 2006, 2007, 2008 Red Hat, Inc.
+ * Copyright (C) 2006, 2007, 2008, 2009 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
auth_unix_ro = REMOTE_AUTH_NONE;
#endif
- /* Just check the file is readable before opening it, otherwise
- * libvirt emits an error.
- */
- if (access (filename, R_OK) == -1) return 0;
-
conf = virConfReadFile (filename);
- if (!conf) return 0;
+ if (!conf) return -1;
/*
* First get all the logging settings and activate them
struct sigaction sig_action;
int sigpipe[2];
const char *pid_file = NULL;
- const char *remote_config_file = SYSCONF_DIR "/libvirt/libvirtd.conf";
+ const char *remote_config_file = NULL;
int ret = 1;
struct option opts[] = {
}
}
+ if (remote_config_file == NULL) {
+ static const char *default_config_file
+ = SYSCONF_DIR "/libvirt/libvirtd.conf";
+ remote_config_file =
+ (access(default_config_file, X_OK) == 0
+ ? default_config_file
+ : "/dev/null");
+ }
+
if (godaemon) {
if (qemudGoDaemon() < 0) {
VIR_ERROR(_("Failed to fork as daemon: %s"), strerror(errno));
/**
* conf.c: parser for a subset of the Python encoded Xen configuration files
*
- * Copyright (C) 2006, 2007, 2008 Red Hat, Inc.
+ * Copyright (C) 2006, 2007, 2008, 2009 Red Hat, Inc.
*
* See COPYING.LIB for the License of this software
*
}
if ((len = virFileReadAll(filename, MAX_CONFIG_FILE_SIZE, &content)) < 0) {
- virConfError(NULL, VIR_ERR_OPEN_FAILED, filename);
return NULL;
}