Revision 38ceff04
b/nbd.c | ||
---|---|---|
18 | 18 |
|
19 | 19 |
#include "nbd.h" |
20 | 20 |
#include "block.h" |
21 |
#include "block_int.h" |
|
22 | 21 |
|
23 | 22 |
#include "qemu-coroutine.h" |
24 | 23 |
|
... | ... | |
703 | 702 |
exp->bs = bs; |
704 | 703 |
exp->dev_offset = dev_offset; |
705 | 704 |
exp->nbdflags = nbdflags; |
706 |
exp->size = size == -1 ? exp->bs->total_sectors * 512 : size;
|
|
705 |
exp->size = size == -1 ? bdrv_getlength(bs) : size;
|
|
707 | 706 |
return exp; |
708 | 707 |
} |
709 | 708 |
|
b/qemu-nbd.c | ||
---|---|---|
17 | 17 |
*/ |
18 | 18 |
|
19 | 19 |
#include "qemu-common.h" |
20 |
#include "block_int.h"
|
|
20 |
#include "block.h" |
|
21 | 21 |
#include "nbd.h" |
22 | 22 |
|
23 | 23 |
#include <stdarg.h> |
... | ... | |
487 | 487 |
err(EXIT_FAILURE, "Failed to bdrv_open '%s'", argv[optind]); |
488 | 488 |
} |
489 | 489 |
|
490 |
fd_size = bs->total_sectors * 512;
|
|
490 |
fd_size = bdrv_getlength(bs);
|
|
491 | 491 |
|
492 | 492 |
if (partition != -1) { |
493 | 493 |
ret = find_partition(bs, partition, &dev_offset, &fd_size); |
Also available in: Unified diff