소스 검색

blockdev: Eliminate silly QERR_BLOCK_JOB_NOT_ACTIVE macro

The QERR_ macros are leftovers from the days of "rich" error objects.
They're used with error_set() and qerror_report(), and expand into the
first *two* arguments.  This trickiness has become pointless.  Clean
this one up.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1422524221-8566-3-git-send-email-armbru@redhat.com
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Markus Armbruster 10 년 전
부모
커밋
2e3a0266bd
2개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 1
      blockdev.c
  2. 0 3
      include/qapi/qmp/qerror.h

+ 2 - 1
blockdev.c

@@ -2674,7 +2674,8 @@ static BlockJob *find_block_job(const char *device, AioContext **aio_context,
     return bs->job;
     return bs->job;
 
 
 notfound:
 notfound:
-    error_set(errp, QERR_BLOCK_JOB_NOT_ACTIVE, device);
+    error_set(errp, ERROR_CLASS_DEVICE_NOT_ACTIVE,
+              "No active block job on device '%s'", device);
     *aio_context = NULL;
     *aio_context = NULL;
     return NULL;
     return NULL;
 }
 }

+ 0 - 3
include/qapi/qmp/qerror.h

@@ -37,9 +37,6 @@ void qerror_report_err(Error *err);
 #define QERR_BASE_NOT_FOUND \
 #define QERR_BASE_NOT_FOUND \
     ERROR_CLASS_GENERIC_ERROR, "Base '%s' not found"
     ERROR_CLASS_GENERIC_ERROR, "Base '%s' not found"
 
 
-#define QERR_BLOCK_JOB_NOT_ACTIVE \
-    ERROR_CLASS_DEVICE_NOT_ACTIVE, "No active block job on device '%s'"
-
 #define QERR_BLOCK_JOB_NOT_READY \
 #define QERR_BLOCK_JOB_NOT_READY \
     ERROR_CLASS_GENERIC_ERROR, "The active block job for device '%s' cannot be completed"
     ERROR_CLASS_GENERIC_ERROR, "The active block job for device '%s' cannot be completed"