X-Git-Url: https://repo.jachan.dev/qemu.git/blobdiff_plain/279826619dfb36bac39d8549526a76eabb9d311e..79d5ca5617cfc9be13a4f314ed800fca1267d903:/qemu-nbd.c diff --git a/qemu-nbd.c b/qemu-nbd.c index d5d5db73a0..0af97ca2c7 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA */ #include @@ -36,7 +36,7 @@ #define NBD_BUFFER_SIZE (1024*1024) -int verbose; +static int verbose; static void usage(const char *name) { @@ -190,7 +190,7 @@ int main(int argc, char **argv) char *device = NULL; char *socket = NULL; char sockpath[128]; - const char *sopt = "hVbo:p:rsnP:c:dvk:e:t"; + const char *sopt = "hVb:o:p:rsnP:c:dvk:e:t"; struct option lopt[] = { { "help", 0, 0, 'h' }, { "version", 0, 0, 'V' }, @@ -232,7 +232,7 @@ int main(int argc, char **argv) flags |= BDRV_O_SNAPSHOT; break; case 'n': - flags |= BDRV_O_DIRECT; + flags |= BDRV_O_NOCACHE; break; case 'b': bindto = optarg; @@ -409,8 +409,6 @@ int main(int argc, char **argv) } sharing_fds = qemu_malloc((shared + 1) * sizeof(int)); - if (sharing_fds == NULL) - errx(ENOMEM, "Cannot allocate sharing fds"); if (socket) { sharing_fds[0] = unix_socket_incoming(socket);