diff --git a/blockdev.c b/blockdev.c
index 1a500b8..04c3a39 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -777,7 +777,11 @@ void qmp_transaction(BlockdevActionList *dev_list, Error **
                                    states->old_bs->drv->format_name,
                                    NULL, -1, flags);
              if (ret) {
-                error_set(errp, QERR_OPEN_FILE_FAILED, new_image_file);
+                if (ret == -EPERM) {
+                    error_set(errp, QERR_PERMISSION_DENIED);
+                } else {
+                    error_set(errp, QERR_OPEN_FILE_FAILED, new_image_file);
+                }
                  goto delete_and_fail;
              }
          }

Which is handling:

             ret = bdrv_img_create(new_image_file, format,
                                   states->old_bs->filename,
                                   states->old_bs->drv->format_name,
                                   NULL, -1, flags);

But it would be even better to push Error ** into bdrv_img_create().  There's 
only two callers so it would be trivial to do that.  Then you could do:

diff --git a/block.c b/block.c
index b88ee90..a7bf8a9 100644
--- a/block.c
+++ b/block.c
@@ -3881,7 +3881,8 @@ bdrv_acct_done(BlockDriverState *bs, BlockAcctCookie *cook

  int bdrv_img_create(const char *filename, const char *fmt,
                      const char *base_filename, const char *base_fmt,
-                    char *options, uint64_t img_size, int flags)
+                    char *options, uint64_t img_size, int flags,
+                    Error **errp)
  {
      QEMUOptionParameter *param = NULL, *create_options = NULL;
      QEMUOptionParameter *backing_fmt, *backing_file, *size;
@@ -3893,14 +3894,14 @@ int bdrv_img_create(const char *filename, const char *fm
      /* Find driver and parse its options */
      drv = bdrv_find_format(fmt);
      if (!drv) {
-        error_report("Unknown file format '%s'", fmt);
+        error_set(errp, QERR_INVALID_BLOCK_FORMAT, fmt);
          ret = -EINVAL;
          goto out;
      }

Etc.

> Who can tell me what has happened here? Oh, yes, the command failed, I
> would have guessed that from the "error" key. But the actual error
> description is as useless as it gets. It doesn't tell me anything about
> _why_ the snapshot couldn't be created. ("Permission denied" would have
