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>
This commit is contained in:
Andreas Färber 2014-02-21 22:18:31 +01:00
parent 5c4e24c151
commit 592408b8ca
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}