[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 6/7] nbd: do not include block_int.h
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 6/7] nbd: do not include block_int.h |
Date: |
Thu, 19 Apr 2012 17:09:21 +0200 |
Signed-off-by: Paolo Bonzini <address@hidden>
---
nbd.c | 3 +--
qemu-nbd.c | 4 ++--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/nbd.c b/nbd.c
index 4c6d7f1..33ec209 100644
--- a/nbd.c
+++ b/nbd.c
@@ -18,7 +18,6 @@
#include "nbd.h"
#include "block.h"
-#include "block_int.h"
#include "qemu-coroutine.h"
@@ -703,7 +702,7 @@ NBDExport *nbd_export_new(BlockDriverState *bs, off_t
dev_offset,
exp->bs = bs;
exp->dev_offset = dev_offset;
exp->nbdflags = nbdflags;
- exp->size = size == -1 ? exp->bs->total_sectors * 512 : size;
+ exp->size = size == -1 ? bdrv_getlength(bs) * 512 : size;
return exp;
}
diff --git a/qemu-nbd.c b/qemu-nbd.c
index 6c3f9b5..53e2bb3 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -17,7 +17,7 @@
*/
#include "qemu-common.h"
-#include "block_int.h"
+#include "block.h"
#include "nbd.h"
#include <stdarg.h>
@@ -487,7 +487,7 @@ int main(int argc, char **argv)
err(EXIT_FAILURE, "Failed to bdrv_open '%s'", argv[optind]);
}
- fd_size = bs->total_sectors * 512;
+ fd_size = bdrv_getlength(bs) * 512;
if (partition != -1) {
ret = find_partition(bs, partition, &dev_offset, &fd_size);
--
1.7.9.3
- [Qemu-devel] [PULL 0/7] NBD patches for 1.1, Paolo Bonzini, 2012/04/19
- [Qemu-devel] [PATCH 2/7] nbd: consistently use ssize_t, Paolo Bonzini, 2012/04/19
- [Qemu-devel] [PATCH 1/7] nbd: avoid out of bounds access to recv_coroutine array, Paolo Bonzini, 2012/04/19
- [Qemu-devel] [PATCH 3/7] nbd: consistently check for <0 or >=0, Paolo Bonzini, 2012/04/19
- [Qemu-devel] [PATCH 5/7] nbd: do not block in nbd_wr_sync if no data at all is available, Paolo Bonzini, 2012/04/19
- [Qemu-devel] [PATCH 4/7] nbd: consistently return negative errno values, Paolo Bonzini, 2012/04/19
- [Qemu-devel] [PATCH 6/7] nbd: do not include block_int.h,
Paolo Bonzini <=
- Re: [Qemu-devel] [PULL 0/7] NBD patches for 1.1, Paolo Bonzini, 2012/04/19
- [Qemu-devel] [PATCH 7/7] nbd: obey FUA on reads, Paolo Bonzini, 2012/04/19