[libvirt] [PATCH 0/2] Minor doc/error message fixes

Peter Krempa (2): qemu: Fix error messages when dispatching guest agent commands qemu: Drop word "either" from comments for agent monitor functions src/qemu/qemu_agent.c | 11 ++++++----- src/qemu/qemu_domain.c | 10 +++++----- 2 files changed, 11 insertions(+), 10 deletions(-) -- 1.8.0

Error messages produced while dispatching guest agent commands didn't have an apparent reference to the fact that they are dealing with guest agent commands. This patch fixes up some of the messages to contain that reference. --- src/qemu/qemu_agent.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c index ab6dc22..67e0413 100644 --- a/src/qemu/qemu_agent.c +++ b/src/qemu/qemu_agent.c @@ -890,7 +890,8 @@ static int qemuAgentSend(qemuAgentPtr mon, ret = -2; } else { virReportSystemError(errno, "%s", - _("Unable to wait on monitor condition")); + _("Unable to wait on agent monitor " + "condition")); } goto cleanup; } @@ -1124,17 +1125,17 @@ qemuAgentCheckError(virJSONValuePtr cmd, char *replystr = virJSONValueToString(reply, false); /* Log the full JSON formatted command & error */ - VIR_DEBUG("unable to execute QEMU command %s: %s", + VIR_DEBUG("unable to execute QEMU agent command %s: %s", cmdstr, replystr); /* Only send the user the command name + friendly error */ if (!error) virReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to execute QEMU command '%s'"), + _("unable to execute QEMU agent command '%s'"), qemuAgentCommandName(cmd)); else virReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to execute QEMU command '%s': %s"), + _("unable to execute QEMU agent command '%s': %s"), qemuAgentCommandName(cmd), qemuAgentStringifyError(error)); @@ -1148,7 +1149,7 @@ qemuAgentCheckError(virJSONValuePtr cmd, VIR_DEBUG("Neither 'return' nor 'error' is set in the JSON reply %s: %s", cmdstr, replystr); virReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to execute QEMU command '%s'"), + _("unable to execute QEMU agentcommand '%s'"), qemuAgentCommandName(cmd)); VIR_FREE(cmdstr); VIR_FREE(replystr); -- 1.8.0

On 2012年11月28日 20:35, Peter Krempa wrote:
Error messages produced while dispatching guest agent commands didn't have an apparent reference to the fact that they are dealing with guest agent commands. This patch fixes up some of the messages to contain that reference. --- src/qemu/qemu_agent.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c index ab6dc22..67e0413 100644 --- a/src/qemu/qemu_agent.c +++ b/src/qemu/qemu_agent.c @@ -890,7 +890,8 @@ static int qemuAgentSend(qemuAgentPtr mon, ret = -2; } else { virReportSystemError(errno, "%s", - _("Unable to wait on monitor condition")); + _("Unable to wait on agent monitor " + "condition")); } goto cleanup; } @@ -1124,17 +1125,17 @@ qemuAgentCheckError(virJSONValuePtr cmd, char *replystr = virJSONValueToString(reply, false);
/* Log the full JSON formatted command& error */ - VIR_DEBUG("unable to execute QEMU command %s: %s", + VIR_DEBUG("unable to execute QEMU agent command %s: %s", cmdstr, replystr);
/* Only send the user the command name + friendly error */ if (!error) virReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to execute QEMU command '%s'"), + _("unable to execute QEMU agent command '%s'"), qemuAgentCommandName(cmd)); else virReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to execute QEMU command '%s': %s"), + _("unable to execute QEMU agent command '%s': %s"), qemuAgentCommandName(cmd), qemuAgentStringifyError(error));
@@ -1148,7 +1149,7 @@ qemuAgentCheckError(virJSONValuePtr cmd, VIR_DEBUG("Neither 'return' nor 'error' is set in the JSON reply %s: %s", cmdstr, replystr); virReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to execute QEMU command '%s'"), + _("unable to execute QEMU agentcommand '%s'"),
s/agentcommand/agent command/,
qemuAgentCommandName(cmd)); VIR_FREE(cmdstr); VIR_FREE(replystr);
Otherwise ACK.

Error messages produced while dispatching guest agent commands didn't have an apparent reference to the fact that they are dealing with guest agent commands. This patch fixes up some of the messages to contain that reference.
@@ -1148,7 +1149,7 @@ qemuAgentCheckError(virJSONValuePtr cmd, VIR_DEBUG("Neither 'return' nor 'error' is set in the JSON reply %s: %s", cmdstr, replystr); virReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to execute QEMU command '%s'"), + _("unable to execute QEMU agentcommand
Missing a space. ACK with that fixed.

--- src/qemu/qemu_domain.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 92f4a3e..78ebe9f 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1162,9 +1162,9 @@ qemuDomainObjExitAgentInternal(struct qemud_driver *driver, /* * obj must be locked before calling, qemud_driver must be unlocked * - * To be called immediately before any QEMU agent API call - * Must have already either called qemuDomainObjBeginJob() and checked - * that the VM is still active; + * To be called immediately before any QEMU agent API call. + * Must have already called qemuDomainObjBeginJob() and checked + * that the VM is still active. * * To be followed with qemuDomainObjExitAgent() once complete */ @@ -1187,8 +1187,8 @@ void qemuDomainObjExitAgent(struct qemud_driver *driver, /* * obj must be locked before calling, qemud_driver must be locked * - * To be called immediately before any QEMU agent API call - * Must have already either called qemuDomainObjBeginJobWithDriver() and + * To be called immediately before any QEMU agent API call. + * Must have already called qemuDomainObjBeginJobWithDriver() and * checked that the VM is still active; may not be used for nested async jobs. * * To be followed with qemuDomainObjExitAgentWithDriver() once complete -- 1.8.0

On 2012年11月28日 20:35, Peter Krempa wrote:
--- src/qemu/qemu_domain.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 92f4a3e..78ebe9f 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1162,9 +1162,9 @@ qemuDomainObjExitAgentInternal(struct qemud_driver *driver, /* * obj must be locked before calling, qemud_driver must be unlocked * - * To be called immediately before any QEMU agent API call - * Must have already either called qemuDomainObjBeginJob() and checked - * that the VM is still active; + * To be called immediately before any QEMU agent API call. + * Must have already called qemuDomainObjBeginJob() and checked + * that the VM is still active. * * To be followed with qemuDomainObjExitAgent() once complete */ @@ -1187,8 +1187,8 @@ void qemuDomainObjExitAgent(struct qemud_driver *driver, /* * obj must be locked before calling, qemud_driver must be locked * - * To be called immediately before any QEMU agent API call - * Must have already either called qemuDomainObjBeginJobWithDriver() and + * To be called immediately before any QEMU agent API call. + * Must have already called qemuDomainObjBeginJobWithDriver() and * checked that the VM is still active; may not be used for nested async jobs. * * To be followed with qemuDomainObjExitAgentWithDriver() once complete
ACK.
participants (3)
-
Eric Blake
-
Osier Yang
-
Peter Krempa