提交 bb189c8e 编写于 作者: C Chen Hanxiao 提交者: John Ferlan

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: NChen Hanxiao <chenhanxiao@gmail.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 f0f2a5ec
...@@ -320,6 +320,7 @@ typedef enum { ...@@ -320,6 +320,7 @@ typedef enum {
VIR_ERR_AGENT_UNSYNCED = 97, /* guest agent replies with wrong id VIR_ERR_AGENT_UNSYNCED = 97, /* guest agent replies with wrong id
to guest-sync command (DEPRECATED)*/ to guest-sync command (DEPRECATED)*/
VIR_ERR_LIBSSH = 98, /* error in libssh transport driver */ VIR_ERR_LIBSSH = 98, /* error in libssh transport driver */
VIR_ERR_DEVICE_MISSING = 99, /* fail to find the desired device */
} virErrorNumber; } virErrorNumber;
/** /**
......
...@@ -1453,6 +1453,12 @@ virErrorMsg(virErrorNumber error, const char *info) ...@@ -1453,6 +1453,12 @@ virErrorMsg(virErrorNumber error, const char *info)
else else
errmsg = _("libssh transport error: %s"); errmsg = _("libssh transport error: %s");
break; break;
case VIR_ERR_DEVICE_MISSING:
if (info == NULL)
errmsg = _("device not found");
else
errmsg = _("device not found: %s");
break;
} }
return errmsg; return errmsg;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册