VIR_ERR_AUTH_UNAVAILABLE = 94, /* authentication unavailable */
VIR_ERR_NO_SERVER = 95, /* Server was not found */
VIR_ERR_NO_CLIENT = 96, /* Client was not found */
+ VIR_ERR_AGENT_UNSYNCED = 97, /* guest agent replies with wrong id
+ to guest-sync command */
} virErrorNumber;
/**
goto cleanup;
if (!sync_msg.rxObject) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ virReportError(VIR_ERR_AGENT_UNSYNCED, "%s",
_("Missing monitor reply object"));
goto cleanup;
}
if (virJSONValueObjectGetNumberUlong(sync_msg.rxObject,
"return", &id_ret) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ virReportError(VIR_ERR_AGENT_UNSYNCED, "%s",
_("Malformed return value"));
goto cleanup;
}
VIR_DEBUG("Guest returned ID: %llu", id_ret);
if (id_ret != id) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
+ virReportError(VIR_ERR_AGENT_UNSYNCED,
_("Guest agent returned ID: %llu instead of %llu"),
id_ret, id);
goto cleanup;
else
errmsg = _("Client not found: %s");
break;
+ case VIR_ERR_AGENT_UNSYNCED:
+ if (info == NULL)
+ errmsg = _("guest agent replied with wrong id to guest-sync command");
+ else
+ errmsg = _("guest agent replied with wrong id to guest-sync command: %s");
+ break;
}
return errmsg;
}