2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 13:58:34 +00:00

s390:criu: Add support for s390 consoles

On s390 we have special console drivers with minors 64 and 65.
Add support for them in criu code and in zdtm testsuite.

Reviewed-by: Alice Frosi <alice@linux.vnet.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
Michael Holzheu 2017-06-30 20:31:45 +02:00 committed by Pavel Emelyanov
parent 27db1d9a04
commit c2f30337a5
2 changed files with 18 additions and 1 deletions

View File

@ -295,6 +295,17 @@ struct tty_driver *get_tty_driver(dev_t rdev, dev_t dev)
* of kernel).
*/
return &vt_driver;
#ifdef __s390x__
/*
* On s390 we have the following consoles:
* - tty3215 : ttyS0 , minor = 64, linemode console
* - sclp_line : ttyS0 , minor = 64, linemode console
* - sclp_vt220 : ttysclp0, minor = 65, vt220 console
* See also "drivers/s390/char"
*/
else if (minor == 64 || minor == 65)
return &vt_driver;
#endif
/* Other minors points to UART serial ports */
break;
case USB_SERIAL_MAJOR:

View File

@ -15,6 +15,12 @@ const char *test_author = "Ruslan Kuprieiev <kupruser@gmail.com>";
char *filename;
TEST_OPTION(filename, string, "file name", 1);
#ifdef __s390x__
#define MINOR 64 /* ttyS0 */
#else
#define MINOR 5
#endif
int main(int argc, char **argv)
{
struct stat st1, st2;
@ -22,7 +28,7 @@ int main(int argc, char **argv)
test_init(argc, argv);
if (mknod(filename, S_IFCHR | S_IRUSR | S_IWUSR, makedev(4, 5))) {
if (mknod(filename, S_IFCHR | S_IRUSR | S_IWUSR, makedev(4, MINOR))) {
pr_perror("Can't create virtual terminal %s", filename);
return 1;
}