Patchwork [4/9] block: mirror_complete(): use error_setg_file_open()

login
register
mail settings
Submitter Luiz Capitulino
Date June 7, 2013, 7:52 p.m.
Message ID <1370634755-18132-5-git-send-email-lcapitulino@redhat.com>
Download mbox | patch
Permalink /patch/249801/
State New
Headers show

Comments

Luiz Capitulino - June 7, 2013, 7:52 p.m.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 block/mirror.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Stefan Hajnoczi - June 10, 2013, 8:44 a.m.
On Fri, Jun 07, 2013 at 03:52:30PM -0400, Luiz Capitulino wrote:
> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
> ---
>  block/mirror.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block/mirror.c b/block/mirror.c
> index 8b07dec..89d531d 100644
> --- a/block/mirror.c
> +++ b/block/mirror.c
> @@ -512,7 +512,7 @@ static void mirror_complete(BlockJob *job, Error **errp)
>          char backing_filename[PATH_MAX];
>          bdrv_get_full_backing_filename(s->target, backing_filename,
>                                         sizeof(backing_filename));
> -        error_set(errp, QERR_OPEN_FILE_FAILED, backing_filename);
> +        error_setg_file_open(errp, errno, backing_filename);

s/errno/-ret/

Patch

diff --git a/block/mirror.c b/block/mirror.c
index 8b07dec..89d531d 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -512,7 +512,7 @@  static void mirror_complete(BlockJob *job, Error **errp)
         char backing_filename[PATH_MAX];
         bdrv_get_full_backing_filename(s->target, backing_filename,
                                        sizeof(backing_filename));
-        error_set(errp, QERR_OPEN_FILE_FAILED, backing_filename);
+        error_setg_file_open(errp, errno, backing_filename);
         return;
     }
     if (!s->synced) {