aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2014-02-21 22:18:31 +0100
committerAndreas Färber <afaerber@suse.de>2014-03-31 22:35:03 +0200
commit592408b8cab08bb4ec4771d7b1e20343b7f072fc (patch)
tree7042eff47827a6e7cd047bfde580eed99adeedcd
parent5c4e24c1516b6b8c21b6defcd4ffcf05f21202f7 (diff)
nvme: Permit zero-length block devices
It may not be sensible for normal use cases, but it allows to use /dev/null in QTest. Acked-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
-rw-r--r--hw/block/nvme.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 2882ffefce..5fd8f89822 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -752,8 +752,8 @@ static int nvme_init(PCIDevice *pci_dev)
return -1;
}
- bs_size = bdrv_getlength(n->conf.bs);
- if (bs_size <= 0) {
+ bs_size = bdrv_getlength(n->conf.bs);
+ if (bs_size < 0) {
return -1;
}