mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
block: use proper qerrors in qmp_block_resize
Let's report specific errors so that management tools and users can identify the problem. Two new qerrors are needed: * QERR_DEVICE_HAS_NO_MEDIUM for ENOMEDIUM * QERR_DEVICE_IS_READ_ONLY for EACCES Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
parent
c1303596a1
commit
939a1cc399
4 changed files with 37 additions and 10 deletions
8
qerror.c
8
qerror.c
|
@ -79,6 +79,10 @@ static const QErrorStringTable qerror_table[] = {
|
|||
.error_fmt = QERR_DEVICE_FEATURE_BLOCKS_MIGRATION,
|
||||
.desc = "Migration is disabled when using feature '%(feature)' in device '%(device)'",
|
||||
},
|
||||
{
|
||||
.error_fmt = QERR_DEVICE_HAS_NO_MEDIUM,
|
||||
.desc = "Device '%(device)' has no medium",
|
||||
},
|
||||
{
|
||||
.error_fmt = QERR_DEVICE_INIT_FAILED,
|
||||
.desc = "Device '%(device)' could not be initialized",
|
||||
|
@ -87,6 +91,10 @@ static const QErrorStringTable qerror_table[] = {
|
|||
.error_fmt = QERR_DEVICE_IN_USE,
|
||||
.desc = "Device '%(device)' is in use",
|
||||
},
|
||||
{
|
||||
.error_fmt = QERR_DEVICE_IS_READ_ONLY,
|
||||
.desc = "Device '%(device)' is read only",
|
||||
},
|
||||
{
|
||||
.error_fmt = QERR_DEVICE_LOCKED,
|
||||
.desc = "Device '%(device)' is locked",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue