VIR_ERR_NO_NETWORK_PORT = 107, /* network port not found */
VIR_ERR_NO_HOSTNAME = 108, /* no domain's hostname found */
VIR_ERR_CHECKPOINT_INCONSISTENT = 109, /* checkpoint can't be used */
+ VIR_ERR_MULTIPLE_DOMAINS = 110, /* more than one matching domain found */
# ifdef VIR_ENUM_SENTINELS
VIR_ERR_NUMBER_LAST
if (hypervGetVirtualSystemByName(priv, name, &computerSystem) < 0)
goto cleanup;
+ if (computerSystem->next) {
+ virReportError(VIR_ERR_MULTIPLE_DOMAINS,
+ _("Multiple domains exist with the name '%s': repeat the request using a UUID"),
+ name);
+ goto cleanup;
+ }
+
hypervMsvmComputerSystemToDomain(conn, computerSystem, &domain);
cleanup:
N_("no hostname found: %s") },
[VIR_ERR_CHECKPOINT_INCONSISTENT] = {
N_("checkpoint inconsistent"),
- N_("checkpoint inconsistent: %s")
- },
+ N_("checkpoint inconsistent: %s") },
+ [VIR_ERR_MULTIPLE_DOMAINS] = {
+ N_("multiple matching domains found"),
+ N_("multiple matching domains found: %s") },
};
G_STATIC_ASSERT(G_N_ELEMENTS(virErrorMsgStrings) == VIR_ERR_NUMBER_LAST);