aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
Diffstat (limited to 'block.c')
-rw-r--r--block.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/block.c b/block.c
index fd33d5ec43..ab77ba0233 100644
--- a/block.c
+++ b/block.c
@@ -33,6 +33,7 @@
#include "qapi/error.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qjson.h"
+#include "qapi/qmp/qnull.h"
#include "qapi/qmp/qstring.h"
#include "qapi/qobject-output-visitor.h"
#include "qapi/qapi-visit-block-core.h"
@@ -2645,7 +2646,9 @@ static BlockDriverState *bdrv_open_inherit(const char *filename,
/* See cautionary note on accessing @options above */
backing = qdict_get_try_str(options, "backing");
- if (backing && *backing == '\0') {
+ if (qobject_to(QNull, qdict_get(options, "backing")) != NULL ||
+ (backing && *backing == '\0'))
+ {
flags |= BDRV_O_NO_BACKING;
qdict_del(options, "backing");
}