Improve qrexec protocol mismatch error dialog

- only have one button, because "yes/no" makes no sense in this context
- inform use to use "-t pv" for xl console, because otherwise it won't
  work for HVM domains.
- use the actual VM name, not "vmname"
This commit is contained in:
Jean-Philippe Ouellet 2017-12-07 14:42:33 -05:00
parent be9e759697
commit c69662eb28
No known key found for this signature in database
GPG Key ID: 4747332C27533622

View File

@ -167,16 +167,16 @@ static void incompatible_protocol_error_message(
int ret; int ret;
struct stat buf; struct stat buf;
ret=stat("/usr/bin/kdialog", &buf); ret=stat("/usr/bin/kdialog", &buf);
#define KDIALOG_CMD "kdialog --title 'Qrexec daemon' --warningyesno " #define KDIALOG_CMD "kdialog --title 'Qrexec daemon' --sorry "
#define ZENITY_CMD "zenity --title 'Qrexec daemon' --question --text " #define ZENITY_CMD "zenity --title 'Qrexec daemon' --warning --text "
snprintf(text, sizeof(text), snprintf(text, sizeof(text),
"%s" "%s"
"'Domain %s uses incompatible qrexec protocol (%d instead of %d). " "'Domain %s uses incompatible qrexec protocol (%d instead of %d). "
"You need to update either dom0 or VM packages.\n" "You need to update either dom0 or VM packages.\n"
"To access this VM console do not close this error message and call:\n" "To access this VM console do not close this error message and run:\n"
"sudo xl console vmname'", "sudo xl console -t pv %s'",
ret==0 ? KDIALOG_CMD : ZENITY_CMD, ret==0 ? KDIALOG_CMD : ZENITY_CMD,
domain_name, remote_version, QREXEC_PROTOCOL_VERSION); domain_name, remote_version, QREXEC_PROTOCOL_VERSION, domain_name);
#undef KDIALOG_CMD #undef KDIALOG_CMD
#undef ZENITY_CMD #undef ZENITY_CMD
system(text); system(text);