diff --git a/include/libvirt/virterror.h b/include/libvirt/virterror.h index 91ba297843..3e7c7a02c7 100644 --- a/include/libvirt/virterror.h +++ b/include/libvirt/virterror.h @@ -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; /** diff --git a/src/util/virerror.c b/src/util/virerror.c index 562c3bc61d..c000b00436 100644 --- a/src/util/virerror.c +++ b/src/util/virerror.c @@ -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; }