static int openfile(char *name, int flags, int growable)

{

	if (bs) {

		fprintf(stderr, "file open already, try 'help close'\n");

		return 1;

	}



	bs = bdrv_new("hda");

	if (!bs)

		return 1;



	if (growable) {

		flags |= BDRV_O_FILE;

	}



	if (bdrv_open(bs, name, flags) == -1) {

		fprintf(stderr, "%s: can't open device %s\n", progname, name);

		bs = NULL;

		return 1;

	}



	if (growable) {

		bs->growable = 1;

	}

	return 0;

}

static int openfile(char *name, int flags, int growable)

{

	if (bs) {

		fprintf(stderr, "file open already, try 'help close'\n");

		return 1;

	}



	bs = bdrv_new("hda");

	if (!bs)

		return 1;



	if (growable) {

		flags |= BDRV_O_FILE;

	}



	if (bdrv_open(bs, name, flags) == -1) {

		fprintf(stderr, "%s: can't open device %s\n", progname, name);

		bs = NULL;

		return 1;

	}



	if (growable) {

		bs->growable = 1;

	}

	return 0;

}

static int FUNC_0(char *VAR_0, int VAR_1, int VAR_2)

{

	if (bs) {

		fprintf(stderr, "file open already, try 'help close'\n");

		return 1;

	}



	bs = bdrv_new("hda");

	if (!bs)

		return 1;



	if (VAR_2) {

		VAR_1 |= BDRV_O_FILE;

	}



	if (bdrv_open(bs, VAR_0, VAR_1) == -1) {

		fprintf(stderr, "%s: can't open device %s\n", progname, VAR_0);

		bs = NULL;

		return 1;

	}



	if (VAR_2) {

		bs->VAR_2 = 1;

	}

	return 0;

}

static int FUNC_0(char *VAR_0, int VAR_1, int VAR_2)
{ if (bs) { fprintf(stderr, "file open already, try 'help close'\n"); return 1; } bs = bdrv_new("hda"); if (!bs)
return 1; if (VAR_2) { VAR_1 |= BDRV_O_FILE; } if (bdrv_open(bs, VAR_0, VAR_1) == -1) { fprintf(stderr, "%s: can't open device %s\n", progname, VAR_0); bs = NULL; return 1; } if (VAR_2) { bs->VAR_2 = 1; } return 0; }