qemu-io-cmds.c (3b35d4542c8537a9269f6372df531ced6c960084) qemu-io-cmds.c (a9262f551eba44d4d0f9e396d7124c059a93e204)
1/*
2 * Command line utility to exercise the QEMU I/O path.
3 *
4 * Copyright (C) 2009-2016 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.

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

542 int64_t bytes, int64_t *total)
543{
544 int ret;
545
546 if (bytes > INT_MAX) {
547 return -ERANGE;
548 }
549
1/*
2 * Command line utility to exercise the QEMU I/O path.
3 *
4 * Copyright (C) 2009-2016 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.

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

542 int64_t bytes, int64_t *total)
543{
544 int ret;
545
546 if (bytes > INT_MAX) {
547 return -ERANGE;
548 }
549
550 ret = blk_pread(blk, offset, (uint8_t *)buf, bytes, 0);
550 ret = blk_pread(blk, offset, bytes, (uint8_t *)buf, 0);
551 if (ret < 0) {
552 return ret;
553 }
554 *total = bytes;
555 return 1;
556}
557
558static int do_pwrite(BlockBackend *blk, char *buf, int64_t offset,
559 int64_t bytes, int flags, int64_t *total)
560{
561 int ret;
562
563 if (bytes > INT_MAX) {
564 return -ERANGE;
565 }
566
551 if (ret < 0) {
552 return ret;
553 }
554 *total = bytes;
555 return 1;
556}
557
558static int do_pwrite(BlockBackend *blk, char *buf, int64_t offset,
559 int64_t bytes, int flags, int64_t *total)
560{
561 int ret;
562
563 if (bytes > INT_MAX) {
564 return -ERANGE;
565 }
566
567 ret = blk_pwrite(blk, offset, (uint8_t *)buf, bytes, flags);
567 ret = blk_pwrite(blk, offset, bytes, (uint8_t *)buf, flags);
568 if (ret < 0) {
569 return ret;
570 }
571 *total = bytes;
572 return 1;
573}
574
575typedef struct {

--- 1946 unchanged lines hidden ---
568 if (ret < 0) {
569 return ret;
570 }
571 *total = bytes;
572 return 1;
573}
574
575typedef struct {

--- 1946 unchanged lines hidden ---