qemu-io.c (dc0b0616f726956001be09e9a65a6e0b0bd939db) qemu-io.c (787e4a8500020695eb391e2f1cc4767ee071d441)
1/*
2 * Command line utility to exercise the QEMU I/O path.
3 *
4 * Copyright (C) 2009 Red Hat, Inc.
5 * Copyright (c) 2003-2005 Silicon Graphics, Inc.
6 *
7 * This work is licensed under the terms of the GNU GPL, version 2 or later.
8 * See the COPYING file in the top-level directory.

--- 1752 unchanged lines hidden (view full) ---

1761static int openfile(char *name, int flags, int growable)
1762{
1763 if (bs) {
1764 fprintf(stderr, "file open already, try 'help close'\n");
1765 return 1;
1766 }
1767
1768 if (growable) {
1/*
2 * Command line utility to exercise the QEMU I/O path.
3 *
4 * Copyright (C) 2009 Red Hat, Inc.
5 * Copyright (c) 2003-2005 Silicon Graphics, Inc.
6 *
7 * This work is licensed under the terms of the GNU GPL, version 2 or later.
8 * See the COPYING file in the top-level directory.

--- 1752 unchanged lines hidden (view full) ---

1761static int openfile(char *name, int flags, int growable)
1762{
1763 if (bs) {
1764 fprintf(stderr, "file open already, try 'help close'\n");
1765 return 1;
1766 }
1767
1768 if (growable) {
1769 if (bdrv_file_open(&bs, name, flags)) {
1769 if (bdrv_file_open(&bs, name, NULL, flags)) {
1770 fprintf(stderr, "%s: can't open device %s\n", progname, name);
1771 return 1;
1772 }
1773 } else {
1774 bs = bdrv_new("hda");
1775
1776 if (bdrv_open(bs, name, NULL, flags, NULL) < 0) {
1777 fprintf(stderr, "%s: can't open device %s\n", progname, name);

--- 255 unchanged lines hidden ---
1770 fprintf(stderr, "%s: can't open device %s\n", progname, name);
1771 return 1;
1772 }
1773 } else {
1774 bs = bdrv_new("hda");
1775
1776 if (bdrv_open(bs, name, NULL, flags, NULL) < 0) {
1777 fprintf(stderr, "%s: can't open device %s\n", progname, name);

--- 255 unchanged lines hidden ---