aboutsummaryrefslogtreecommitdiff
path: root/hw/block/nvme.c
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 /hw/block/nvme.c
parent5c4e24c1516b6b8c21b6defcd4ffcf05f21202f7 (diff)
downloadqemu-592408b8cab08bb4ec4771d7b1e20343b7f072fc.zip
qemu-592408b8cab08bb4ec4771d7b1e20343b7f072fc.tar.gz
qemu-592408b8cab08bb4ec4771d7b1e20343b7f072fc.tar.bz2
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>
Diffstat (limited to 'hw/block/nvme.c')
-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 2882ffe..5fd8f89 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;
}