From 5687da2c7a1e07a2d94ddf63613b5087e547f69e Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Tue, 20 Feb 2007 19:09:44 +0000 Subject: [PATCH] Tue Feb 20 19:08:58 IST 2007 Mark McLoughlin * qemud/conf.c: use strerror(errno) in some error messages to make them a bit more useful --- ChangeLog | 21 +++++++++++++-------- qemud/conf.c | 24 +++++++++++++++--------- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1f18845d9f..8a0d63cbdb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,13 +1,18 @@ -Fri Feb 20 19:07:12 IST 2007 Mark McLoughlin +Tue Feb 20 19:08:58 IST 2007 Mark McLoughlin + + * qemud/conf.c: use strerror(errno) in some error messages + to make them a bit more useful + +Tue Feb 20 19:07:12 IST 2007 Mark McLoughlin * qemud/conf.c: don't free active networks/vms if we fail to save the new config -Fri Feb 20 18:25:42 IST 2007 Mark McLoughlin +Tue Feb 20 18:25:42 IST 2007 Mark McLoughlin * virsh.c: cmdNetworkList() re-indent this. -Fri Feb 20 17:49:22 IST 2007 Mark McLoughlin +Tue Feb 20 17:49:22 IST 2007 Mark McLoughlin Fix a few leaks @@ -18,28 +23,28 @@ Fri Feb 20 17:49:22 IST 2007 Mark McLoughlin * qemud/iptables.c: fix a typo causing a leak -Fri Feb 20 16:49:53 IST 2007 Mark McLoughlin +Tue Feb 20 16:49:53 IST 2007 Mark McLoughlin * qemud/conf.c, qemud/qemud.c: only create config dirs when actually trying to write out config. -Fri Feb 20 09:56:35 IST 2007 Mark McLoughlin +Tue Feb 20 09:56:35 IST 2007 Mark McLoughlin * qemud/bridge.c: change the fix for the alignment warning a little. -Fri Feb 20 09:03:05 IST 2007 Mark McLoughlin +Tue Feb 20 09:03:05 IST 2007 Mark McLoughlin * qemud/qemud.c: clean up qemudInitialize() and qemudListen() so as to coalesce the two "system vs. user" code paths and fix up some problems noticed by dan. -Fri Feb 19 16:59:18 IST 2007 Mark McLoughlin +Mon Feb 19 16:59:18 IST 2007 Mark McLoughlin * qemud/qemud.c: don't shutdown guest and networks on SIGHUP -Fri Feb 19 16:58:53 IST 2007 Mark McLoughlin +Mon Feb 19 16:58:53 IST 2007 Mark McLoughlin * qemud/qemud.c: handle SIGQUIT. diff --git a/qemud/conf.c b/qemud/conf.c index 310259afb4..001d178b1f 100644 --- a/qemud/conf.c +++ b/qemud/conf.c @@ -1158,23 +1158,23 @@ static int qemudSaveConfig(struct qemud_server *server, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR )) < 0) { qemudReportError(server, VIR_ERR_INTERNAL_ERROR, - "cannot create config file %s", - vm->configFile); + "cannot create config file %s: %s", + vm->configFile, strerror(errno)); goto cleanup; } towrite = strlen(xml); if (write(fd, xml, towrite) != towrite) { qemudReportError(server, VIR_ERR_INTERNAL_ERROR, - "cannot write config file %s", - vm->configFile); + "cannot write config file %s: %s", + vm->configFile, strerror(errno)); goto cleanup; } if (close(fd) < 0) { qemudReportError(server, VIR_ERR_INTERNAL_ERROR, - "cannot save config file %s", - vm->configFile); + "cannot save config file %s: %s", + vm->configFile, strerror(errno)); goto cleanup; } @@ -1293,18 +1293,24 @@ static int qemudSaveNetworkConfig(struct qemud_server *server, if ((fd = open(network->configFile, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR )) < 0) { - qemudReportError(server, VIR_ERR_INTERNAL_ERROR, "cannot create config file %s", network->configFile); + qemudReportError(server, VIR_ERR_INTERNAL_ERROR, + "cannot create config file %s: %s", + network->configFile, strerror(errno)); goto cleanup; } towrite = strlen(xml); if (write(fd, xml, towrite) != towrite) { - qemudReportError(server, VIR_ERR_INTERNAL_ERROR, "cannot write config file %s", network->configFile); + qemudReportError(server, VIR_ERR_INTERNAL_ERROR, + "cannot write config file %s", + network->configFile, strerror(errno)); goto cleanup; } if (close(fd) < 0) { - qemudReportError(server, VIR_ERR_INTERNAL_ERROR, "cannot save config file %s", network->configFile); + qemudReportError(server, VIR_ERR_INTERNAL_ERROR, + "cannot save config file %s", + network->configFile, strerror(errno)); goto cleanup; }