aboutsummaryrefslogtreecommitdiffstats
path: root/gpxe/src/arch/i386/interface/pcbios/keepsan.c
blob: 904e017d8c9fc0d5fa0cd2f371f68dd431d093ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <stdint.h>
#include <stdio.h>
#include <gpxe/settings.h>
#include <gpxe/dhcp.h>
#include <gpxe/init.h>
#include <gpxe/sanboot.h>
#include <usr/autoboot.h>

struct setting keep_san_setting __setting = {
	.name = "keep-san",
	.description = "Preserve SAN connection",
	.tag = DHCP_EB_KEEP_SAN,
	.type = &setting_type_int8,
};

int keep_san ( void ) {
	int keep_san;

	keep_san = fetch_intz_setting ( NULL, &keep_san_setting );
	if ( ! keep_san )
		return 0;

	printf ( "Preserving connection to SAN disk\n" );
	shutdown_exit_flags |= SHUTDOWN_KEEP_DEVICES;
	return 1;
}