Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
#include "nbd.h"
#include "block.h"
-#include "block_int.h"
#include "qemu-coroutine.h"
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;
}
*/
#include "qemu-common.h"
-#include "block_int.h"
+#include "block.h"
#include "nbd.h"
#include <stdarg.h>
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);