diff mbox

[5/9] blockdev: use error_setg_file_open()

Message ID 1370634755-18132-6-git-send-email-lcapitulino@redhat.com
State New
Headers show

Commit Message

Luiz Capitulino June 7, 2013, 7:52 p.m. UTC
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 blockdev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Stefan Hajnoczi June 10, 2013, 8:45 a.m. UTC | #1
On Fri, Jun 07, 2013 at 03:52:31PM -0400, Luiz Capitulino wrote:
> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
> ---
>  blockdev.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

s/errno/-ret/g
Luiz Capitulino June 10, 2013, 1:25 p.m. UTC | #2
On Mon, 10 Jun 2013 10:45:23 +0200
Stefan Hajnoczi <stefanha@gmail.com> wrote:

> On Fri, Jun 07, 2013 at 03:52:31PM -0400, Luiz Capitulino wrote:
> > Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
> > ---
> >  blockdev.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> s/errno/-ret/g

I'll fix this and double check the other patches.

Thanks for reviewing Stefan!
diff mbox

Patch

diff --git a/blockdev.c b/blockdev.c
index 9937311..c09adba 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -899,7 +899,7 @@  static void external_snapshot_prepare(BlkTransactionStates *common,
     ret = bdrv_open(states->new_bs, new_image_file, NULL,
                     flags | BDRV_O_NO_BACKING, drv);
     if (ret != 0) {
-        error_set(errp, QERR_OPEN_FILE_FAILED, new_image_file);
+        error_setg_file_open(errp, errno, new_image_file);
     }
 }
 
@@ -1063,7 +1063,7 @@  static void qmp_bdrv_open_encrypted(BlockDriverState *bs, const char *filename,
                                     const char *password, Error **errp)
 {
     if (bdrv_open(bs, filename, NULL, bdrv_flags, drv) < 0) {
-        error_set(errp, QERR_OPEN_FILE_FAILED, filename);
+        error_setg_file_open(errp, errno, filename);
         return;
     }
 
@@ -1483,7 +1483,7 @@  void qmp_drive_mirror(const char *device, const char *target,
 
     if (ret < 0) {
         bdrv_delete(target_bs);
-        error_set(errp, QERR_OPEN_FILE_FAILED, target);
+        error_setg_file_open(errp, errno, target);
         return;
     }