[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] qemu_agent: report VIR_ERR_AGENT_UNSYNCED if guest_sync failed.



From: Chen Hanxiao <chenhanxiao gmail com>

Commit 5e5019bf removed this kind of error.

But we've already protected race condition by qemuDomainObjEnterAgent,
it was very unlikely to revieve a sync from other calls.
For call from virDomain*, it's better to show this error
if we really got a mismatch sync.

Signed-off-by: Chen Hanxiao <chenhanxiao gmail com>
---
 src/qemu/qemu_agent.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
index 5d125c413..cdcacf5c8 100644
--- a/src/qemu/qemu_agent.c
+++ b/src/qemu/qemu_agent.c
@@ -354,7 +354,9 @@ qemuAgentIOProcessLine(qemuAgentPtr mon,
                 if (msg->id != id) {
                     VIR_DEBUG("Guest agent returned ID: %llu instead of %llu",
                               id, msg->id);
-                    ret = 0;
+                    virReportError(VIR_ERR_AGENT_UNSYNCED,
+                                   _("Guest agent returned ID: %llu "
+                                     "instead of %llu"), id, msg->id);
                     goto cleanup;
                 }
             }
-- 
2.14.3


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]