mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 21:34:54 +03:00
qemu: Introduce VIR_ERR_DEVICE_MISSING
Add new error code to be able to allow consumers (such as Nova) to be able to key of a specific error code rather than needing to search the error message." Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
f0f2a5ec21
commit
bb189c8e8c
@ -320,6 +320,7 @@ typedef enum {
|
||||
VIR_ERR_AGENT_UNSYNCED = 97, /* guest agent replies with wrong id
|
||||
to guest-sync command (DEPRECATED)*/
|
||||
VIR_ERR_LIBSSH = 98, /* error in libssh transport driver */
|
||||
VIR_ERR_DEVICE_MISSING = 99, /* fail to find the desired device */
|
||||
} virErrorNumber;
|
||||
|
||||
/**
|
||||
|
@ -1453,6 +1453,12 @@ virErrorMsg(virErrorNumber error, const char *info)
|
||||
else
|
||||
errmsg = _("libssh transport error: %s");
|
||||
break;
|
||||
case VIR_ERR_DEVICE_MISSING:
|
||||
if (info == NULL)
|
||||
errmsg = _("device not found");
|
||||
else
|
||||
errmsg = _("device not found: %s");
|
||||
break;
|
||||
}
|
||||
return errmsg;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user