[PATCH v2 04/10] kvm tools: Modify behaviour on missing ops ptr

Sasha Levin
2011-11-01T16:08:14Z

In case a read or write op ptr is missing simply ignore it instead of
critically failing. This provides an easier way to prevent read or write
in specific scenarios.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
tools/kvm/disk/core.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/kvm/disk/core.c b/tools/kvm/disk/core.c
index 9a84f39..4f51cbe 100644
--- a/tools/kvm/disk/core.c
+++ b/tools/kvm/disk/core.c
@@ -147,7 +147,7 @@ ssize_t disk_image__read(struct disk_image *disk, u64 sector, const struct iovec
return -1;
}
} else {
- die("No disk image operation for read\n");
+ /* Do nothing */
}

return total;
@@ -174,7 +174,7 @@ ssize_t disk_image__write(struct disk_image *disk, u64 sector, const struct iove
return -1;
}
} else {
- die("No disk image operation for read\n");
+ /* Do nothing */
}

return total;
--
1.7.7.1