do_snapshot_blkdev() error on missing snapshot_file argument
authorJes Sorensen <Jes.Sorensen@redhat.com>
Thu, 6 Jan 2011 16:02:23 +0000 (17:02 +0100)
committerKevin Wolf <kwolf@redhat.com>
Mon, 24 Jan 2011 10:08:50 +0000 (11:08 +0100)
Current code does not support snapshot internally to the running
image. Error in case no snapshot_file is specified.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blockdev.c

index d7add36929ea0fc553246d8b62f33bcb026e9111..662f7a9d86c2d310342845f331a7b359b1d3abb3 100644 (file)
@@ -526,6 +526,12 @@ int do_snapshot_blkdev(Monitor *mon, const QDict *qdict, QObject **ret_data)
     int ret = 0;
     int flags;
 
+    if (!filename) {
+        qerror_report(QERR_MISSING_PARAMETER, "snapshot_file");
+        ret = -1;
+        goto out;
+    }
+
     bs = bdrv_find(device);
     if (!bs) {
         qerror_report(QERR_DEVICE_NOT_FOUND, device);