diff options
author | Max Reitz <mreitz@redhat.com> | 2013-09-05 14:45:29 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2013-09-12 10:12:48 +0200 |
commit | 34b5d2c68eb4082c288e70fb99c61af8f7b96fde (patch) | |
tree | 7c4c1e4e248a8e044dd891b0e54de1fcc03d7434 /block/sheepdog.c | |
parent | d5124c00d80b4d948509f2c7f6b54228d9981f75 (diff) |
block: Error parameter for open functions
Add an Error ** parameter to bdrv_open, bdrv_file_open and associated
functions to allow more specific error messages.
Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block/sheepdog.c')
-rw-r--r-- | block/sheepdog.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/block/sheepdog.c b/block/sheepdog.c index a93a32a2ae..38fb629650 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -1401,10 +1401,13 @@ static int sd_prealloc(const char *filename) uint32_t idx, max_idx; int64_t vdi_size; void *buf = g_malloc0(SD_DATA_OBJ_SIZE); + Error *local_err = NULL; int ret; - ret = bdrv_file_open(&bs, filename, NULL, BDRV_O_RDWR); + ret = bdrv_file_open(&bs, filename, NULL, BDRV_O_RDWR, &local_err); if (ret < 0) { + qerror_report_err(local_err); + error_free(local_err); goto out; } @@ -1449,6 +1452,7 @@ static int sd_create(const char *filename, QEMUOptionParameter *options, char vdi[SD_MAX_VDI_LEN], tag[SD_MAX_VDI_TAG_LEN]; uint32_t snapid; bool prealloc = false; + Error *local_err = NULL; s = g_malloc0(sizeof(BDRVSheepdogState)); @@ -1502,8 +1506,10 @@ static int sd_create(const char *filename, QEMUOptionParameter *options, goto out; } - ret = bdrv_file_open(&bs, backing_file, NULL, 0); + ret = bdrv_file_open(&bs, backing_file, NULL, 0, &local_err); if (ret < 0) { + qerror_report_err(local_err); + error_free(local_err); goto out; } |