nbd: do not include block_int.h
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 12 Mar 2012 15:17:27 +0000 (16:17 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 19 Apr 2012 15:19:37 +0000 (17:19 +0200)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
nbd.c
qemu-nbd.c

diff --git a/nbd.c b/nbd.c
index 4c6d7f1..d4dafc6 100644 (file)
--- 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) : size;
     return exp;
 }
 
index 6c3f9b5..5a0300e 100644 (file)
@@ -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);
 
     if (partition != -1) {
         ret = find_partition(bs, partition, &dev_offset, &fd_size);