[libvirt] [PATCH] Better error message when libvirtd fails to start.

Signed-off-by: Chris Lalancette <clalance@redhat.com> --- daemon/libvirtd.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index 78dfb2d..03bc1b4 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -2972,7 +2972,9 @@ int main(int argc, char **argv) { if (mkdir (rundir, 0755)) { if (errno != EEXIST) { - VIR_ERROR0 (_("unable to create rundir")); + char ebuf[1024]; + VIR_ERROR(_("unable to create rundir %s: %s"), rundir, + virStrerror(errno, ebuf, sizeof(ebuf))); return -1; } } -- 1.6.0.6

On 10/23/2009 07:01 AM, Chris Lalancette wrote:
Signed-off-by: Chris Lalancette <clalance@redhat.com> --- daemon/libvirtd.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index 78dfb2d..03bc1b4 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -2972,7 +2972,9 @@ int main(int argc, char **argv) {
if (mkdir (rundir, 0755)) { if (errno != EEXIST) { - VIR_ERROR0 (_("unable to create rundir")); + char ebuf[1024]; + VIR_ERROR(_("unable to create rundir %s: %s"), rundir, + virStrerror(errno, ebuf, sizeof(ebuf))); return -1; } }
ACK - Cole

Cole Robinson wrote:
On 10/23/2009 07:01 AM, Chris Lalancette wrote:
Signed-off-by: Chris Lalancette <clalance@redhat.com> --- daemon/libvirtd.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index 78dfb2d..03bc1b4 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -2972,7 +2972,9 @@ int main(int argc, char **argv) {
if (mkdir (rundir, 0755)) { if (errno != EEXIST) { - VIR_ERROR0 (_("unable to create rundir")); + char ebuf[1024]; + VIR_ERROR(_("unable to create rundir %s: %s"), rundir, + virStrerror(errno, ebuf, sizeof(ebuf))); return -1; } }
ACK
Thanks, committed. -- Chris Lalancette

On Fri, Oct 23, 2009 at 01:01:34PM +0200, Chris Lalancette wrote:
Signed-off-by: Chris Lalancette <clalance@redhat.com> --- daemon/libvirtd.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index 78dfb2d..03bc1b4 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -2972,7 +2972,9 @@ int main(int argc, char **argv) {
if (mkdir (rundir, 0755)) { if (errno != EEXIST) { - VIR_ERROR0 (_("unable to create rundir")); + char ebuf[1024]; + VIR_ERROR(_("unable to create rundir %s: %s"), rundir, + virStrerror(errno, ebuf, sizeof(ebuf)));
virReportSystemError() might be a bit nicer, but fine :-) Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (3)
-
Chris Lalancette
-
Cole Robinson
-
Daniel Veillard