From 2c958f377633ec534d485c261e2380182b05adb9 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Thu, 30 Aug 2018 12:13:37 +0200 Subject: [PATCH] Synchronize Virterror with libvirt 4.6.0 In particular, add all the various error codes, and error domains. Also, add an older domain that was previously skipped. --- libvirt/libvirt.ml | 202 +++++++++++++++++++++++++++++++++++++++++++ libvirt/libvirt.mli | 101 ++++++++++++++++++++++ libvirt/libvirt_c_epilogue.c | 4 +- 3 files changed, 305 insertions(+), 2 deletions(-) diff --git a/libvirt/libvirt.ml b/libvirt/libvirt.ml index eb9f6e4..15da362 100644 --- a/libvirt/libvirt.ml +++ b/libvirt/libvirt.ml @@ -184,6 +184,57 @@ struct | VIR_WAR_NO_STORAGE | VIR_ERR_NO_STORAGE_POOL | VIR_ERR_NO_STORAGE_VOL + | VIR_WAR_NO_NODE + | VIR_ERR_INVALID_NODE_DEVICE + | VIR_ERR_NO_NODE_DEVICE + | VIR_ERR_NO_SECURITY_MODEL + | VIR_ERR_OPERATION_INVALID + | VIR_WAR_NO_INTERFACE + | VIR_ERR_NO_INTERFACE + | VIR_ERR_INVALID_INTERFACE + | VIR_ERR_MULTIPLE_INTERFACES + | VIR_WAR_NO_NWFILTER + | VIR_ERR_INVALID_NWFILTER + | VIR_ERR_NO_NWFILTER + | VIR_ERR_BUILD_FIREWALL + | VIR_WAR_NO_SECRET + | VIR_ERR_INVALID_SECRET + | VIR_ERR_NO_SECRET + | VIR_ERR_CONFIG_UNSUPPORTED + | VIR_ERR_OPERATION_TIMEOUT + | VIR_ERR_MIGRATE_PERSIST_FAILED + | VIR_ERR_HOOK_SCRIPT_FAILED + | VIR_ERR_INVALID_DOMAIN_SNAPSHOT + | VIR_ERR_NO_DOMAIN_SNAPSHOT + | VIR_ERR_INVALID_STREAM + | VIR_ERR_ARGUMENT_UNSUPPORTED + | VIR_ERR_STORAGE_PROBE_FAILED + | VIR_ERR_STORAGE_POOL_BUILT + | VIR_ERR_SNAPSHOT_REVERT_RISKY + | VIR_ERR_OPERATION_ABORTED + | VIR_ERR_AUTH_CANCELLED + | VIR_ERR_NO_DOMAIN_METADATA + | VIR_ERR_MIGRATE_UNSAFE + | VIR_ERR_OVERFLOW + | VIR_ERR_BLOCK_COPY_ACTIVE + | VIR_ERR_OPERATION_UNSUPPORTED + | VIR_ERR_SSH + | VIR_ERR_AGENT_UNRESPONSIVE + | VIR_ERR_RESOURCE_BUSY + | VIR_ERR_ACCESS_DENIED + | VIR_ERR_DBUS_SERVICE + | VIR_ERR_STORAGE_VOL_EXIST + | VIR_ERR_CPU_INCOMPATIBLE + | VIR_ERR_XML_INVALID_SCHEMA + | VIR_ERR_MIGRATE_FINISH_OK + | VIR_ERR_AUTH_UNAVAILABLE + | VIR_ERR_NO_SERVER + | VIR_ERR_NO_CLIENT + | VIR_ERR_AGENT_UNSYNCED + | VIR_ERR_LIBSSH + | VIR_ERR_DEVICE_MISSING + | VIR_ERR_INVALID_NWFILTER_BINDING + | VIR_ERR_NO_NWFILTER_BINDING | VIR_ERR_UNKNOWN of int let string_of_code = function @@ -238,6 +289,57 @@ struct | VIR_WAR_NO_STORAGE -> "VIR_WAR_NO_STORAGE" | VIR_ERR_NO_STORAGE_POOL -> "VIR_ERR_NO_STORAGE_POOL" | VIR_ERR_NO_STORAGE_VOL -> "VIR_ERR_NO_STORAGE_VOL" + | VIR_WAR_NO_NODE -> "VIR_WAR_NO_NODE" + | VIR_ERR_INVALID_NODE_DEVICE -> "VIR_ERR_INVALID_NODE_DEVICE" + | VIR_ERR_NO_NODE_DEVICE -> "VIR_ERR_NO_NODE_DEVICE" + | VIR_ERR_NO_SECURITY_MODEL -> "VIR_ERR_NO_SECURITY_MODEL" + | VIR_ERR_OPERATION_INVALID -> "VIR_ERR_OPERATION_INVALID" + | VIR_WAR_NO_INTERFACE -> "VIR_WAR_NO_INTERFACE" + | VIR_ERR_NO_INTERFACE -> "VIR_ERR_NO_INTERFACE" + | VIR_ERR_INVALID_INTERFACE -> "VIR_ERR_INVALID_INTERFACE" + | VIR_ERR_MULTIPLE_INTERFACES -> "VIR_ERR_MULTIPLE_INTERFACES" + | VIR_WAR_NO_NWFILTER -> "VIR_WAR_NO_NWFILTER" + | VIR_ERR_INVALID_NWFILTER -> "VIR_ERR_INVALID_NWFILTER" + | VIR_ERR_NO_NWFILTER -> "VIR_ERR_NO_NWFILTER" + | VIR_ERR_BUILD_FIREWALL -> "VIR_ERR_BUILD_FIREWALL" + | VIR_WAR_NO_SECRET -> "VIR_WAR_NO_SECRET" + | VIR_ERR_INVALID_SECRET -> "VIR_ERR_INVALID_SECRET" + | VIR_ERR_NO_SECRET -> "VIR_ERR_NO_SECRET" + | VIR_ERR_CONFIG_UNSUPPORTED -> "VIR_ERR_CONFIG_UNSUPPORTED" + | VIR_ERR_OPERATION_TIMEOUT -> "VIR_ERR_OPERATION_TIMEOUT" + | VIR_ERR_MIGRATE_PERSIST_FAILED -> "VIR_ERR_MIGRATE_PERSIST_FAILED" + | VIR_ERR_HOOK_SCRIPT_FAILED -> "VIR_ERR_HOOK_SCRIPT_FAILED" + | VIR_ERR_INVALID_DOMAIN_SNAPSHOT -> "VIR_ERR_INVALID_DOMAIN_SNAPSHOT" + | VIR_ERR_NO_DOMAIN_SNAPSHOT -> "VIR_ERR_NO_DOMAIN_SNAPSHOT" + | VIR_ERR_INVALID_STREAM -> "VIR_ERR_INVALID_STREAM" + | VIR_ERR_ARGUMENT_UNSUPPORTED -> "VIR_ERR_ARGUMENT_UNSUPPORTED" + | VIR_ERR_STORAGE_PROBE_FAILED -> "VIR_ERR_STORAGE_PROBE_FAILED" + | VIR_ERR_STORAGE_POOL_BUILT -> "VIR_ERR_STORAGE_POOL_BUILT" + | VIR_ERR_SNAPSHOT_REVERT_RISKY -> "VIR_ERR_SNAPSHOT_REVERT_RISKY" + | VIR_ERR_OPERATION_ABORTED -> "VIR_ERR_OPERATION_ABORTED" + | VIR_ERR_AUTH_CANCELLED -> "VIR_ERR_AUTH_CANCELLED" + | VIR_ERR_NO_DOMAIN_METADATA -> "VIR_ERR_NO_DOMAIN_METADATA" + | VIR_ERR_MIGRATE_UNSAFE -> "VIR_ERR_MIGRATE_UNSAFE" + | VIR_ERR_OVERFLOW -> "VIR_ERR_OVERFLOW" + | VIR_ERR_BLOCK_COPY_ACTIVE -> "VIR_ERR_BLOCK_COPY_ACTIVE" + | VIR_ERR_OPERATION_UNSUPPORTED -> "VIR_ERR_OPERATION_UNSUPPORTED" + | VIR_ERR_SSH -> "VIR_ERR_SSH" + | VIR_ERR_AGENT_UNRESPONSIVE -> "VIR_ERR_AGENT_UNRESPONSIVE" + | VIR_ERR_RESOURCE_BUSY -> "VIR_ERR_RESOURCE_BUSY" + | VIR_ERR_ACCESS_DENIED -> "VIR_ERR_ACCESS_DENIED" + | VIR_ERR_DBUS_SERVICE -> "VIR_ERR_DBUS_SERVICE" + | VIR_ERR_STORAGE_VOL_EXIST -> "VIR_ERR_STORAGE_VOL_EXIST" + | VIR_ERR_CPU_INCOMPATIBLE -> "VIR_ERR_CPU_INCOMPATIBLE" + | VIR_ERR_XML_INVALID_SCHEMA -> "VIR_ERR_XML_INVALID_SCHEMA" + | VIR_ERR_MIGRATE_FINISH_OK -> "VIR_ERR_MIGRATE_FINISH_OK" + | VIR_ERR_AUTH_UNAVAILABLE -> "VIR_ERR_AUTH_UNAVAILABLE" + | VIR_ERR_NO_SERVER -> "VIR_ERR_NO_SERVER" + | VIR_ERR_NO_CLIENT -> "VIR_ERR_NO_CLIENT" + | VIR_ERR_AGENT_UNSYNCED -> "VIR_ERR_AGENT_UNSYNCED" + | VIR_ERR_LIBSSH -> "VIR_ERR_LIBSSH" + | VIR_ERR_DEVICE_MISSING -> "VIR_ERR_DEVICE_MISSING" + | VIR_ERR_INVALID_NWFILTER_BINDING -> "VIR_ERR_INVALID_NWFILTER_BINDING" + | VIR_ERR_NO_NWFILTER_BINDING -> "VIR_ERR_NO_NWFILTER_BINDING" | VIR_ERR_UNKNOWN i -> "VIR_ERR_" ^ string_of_int i type domain = @@ -258,7 +360,57 @@ struct | VIR_FROM_OPENVZ | VIR_FROM_XENXM | VIR_FROM_STATS_LINUX + | VIR_FROM_LXC | VIR_FROM_STORAGE + | VIR_FROM_NETWORK + | VIR_FROM_DOMAIN + | VIR_FROM_UML + | VIR_FROM_NODEDEV + | VIR_FROM_XEN_INOTIFY + | VIR_FROM_SECURITY + | VIR_FROM_VBOX + | VIR_FROM_INTERFACE + | VIR_FROM_ONE + | VIR_FROM_ESX + | VIR_FROM_PHYP + | VIR_FROM_SECRET + | VIR_FROM_CPU + | VIR_FROM_XENAPI + | VIR_FROM_NWFILTER + | VIR_FROM_HOOK + | VIR_FROM_DOMAIN_SNAPSHOT + | VIR_FROM_AUDIT + | VIR_FROM_SYSINFO + | VIR_FROM_STREAMS + | VIR_FROM_VMWARE + | VIR_FROM_EVENT + | VIR_FROM_LIBXL + | VIR_FROM_LOCKING + | VIR_FROM_HYPERV + | VIR_FROM_CAPABILITIES + | VIR_FROM_URI + | VIR_FROM_AUTH + | VIR_FROM_DBUS + | VIR_FROM_PARALLELS + | VIR_FROM_DEVICE + | VIR_FROM_SSH + | VIR_FROM_LOCKSPACE + | VIR_FROM_INITCTL + | VIR_FROM_IDENTITY + | VIR_FROM_CGROUP + | VIR_FROM_ACCESS + | VIR_FROM_SYSTEMD + | VIR_FROM_BHYVE + | VIR_FROM_CRYPTO + | VIR_FROM_FIREWALL + | VIR_FROM_POLKIT + | VIR_FROM_THREAD + | VIR_FROM_ADMIN + | VIR_FROM_LOGGING + | VIR_FROM_XENXL + | VIR_FROM_PERF + | VIR_FROM_LIBSSH + | VIR_FROM_RESCTRL | VIR_FROM_UNKNOWN of int let string_of_domain = function @@ -279,7 +431,57 @@ struct | VIR_FROM_OPENVZ -> "VIR_FROM_OPENVZ" | VIR_FROM_XENXM -> "VIR_FROM_XENXM" | VIR_FROM_STATS_LINUX -> "VIR_FROM_STATS_LINUX" + | VIR_FROM_LXC -> "VIR_FROM_LXC" | VIR_FROM_STORAGE -> "VIR_FROM_STORAGE" + | VIR_FROM_NETWORK -> "VIR_FROM_NETWORK" + | VIR_FROM_DOMAIN -> "VIR_FROM_DOMAIN" + | VIR_FROM_UML -> "VIR_FROM_UML" + | VIR_FROM_NODEDEV -> "VIR_FROM_NODEDEV" + | VIR_FROM_XEN_INOTIFY -> "VIR_FROM_XEN_INOTIFY" + | VIR_FROM_SECURITY -> "VIR_FROM_SECURITY" + | VIR_FROM_VBOX -> "VIR_FROM_VBOX" + | VIR_FROM_INTERFACE -> "VIR_FROM_INTERFACE" + | VIR_FROM_ONE -> "VIR_FROM_ONE" + | VIR_FROM_ESX -> "VIR_FROM_ESX" + | VIR_FROM_PHYP -> "VIR_FROM_PHYP" + | VIR_FROM_SECRET -> "VIR_FROM_SECRET" + | VIR_FROM_CPU -> "VIR_FROM_CPU" + | VIR_FROM_XENAPI -> "VIR_FROM_XENAPI" + | VIR_FROM_NWFILTER -> "VIR_FROM_NWFILTER" + | VIR_FROM_HOOK -> "VIR_FROM_HOOK" + | VIR_FROM_DOMAIN_SNAPSHOT -> "VIR_FROM_DOMAIN_SNAPSHOT" + | VIR_FROM_AUDIT -> "VIR_FROM_AUDIT" + | VIR_FROM_SYSINFO -> "VIR_FROM_SYSINFO" + | VIR_FROM_STREAMS -> "VIR_FROM_STREAMS" + | VIR_FROM_VMWARE -> "VIR_FROM_VMWARE" + | VIR_FROM_EVENT -> "VIR_FROM_EVENT" + | VIR_FROM_LIBXL -> "VIR_FROM_LIBXL" + | VIR_FROM_LOCKING -> "VIR_FROM_LOCKING" + | VIR_FROM_HYPERV -> "VIR_FROM_HYPERV" + | VIR_FROM_CAPABILITIES -> "VIR_FROM_CAPABILITIES" + | VIR_FROM_URI -> "VIR_FROM_URI" + | VIR_FROM_AUTH -> "VIR_FROM_AUTH" + | VIR_FROM_DBUS -> "VIR_FROM_DBUS" + | VIR_FROM_PARALLELS -> "VIR_FROM_PARALLELS" + | VIR_FROM_DEVICE -> "VIR_FROM_DEVICE" + | VIR_FROM_SSH -> "VIR_FROM_SSH" + | VIR_FROM_LOCKSPACE -> "VIR_FROM_LOCKSPACE" + | VIR_FROM_INITCTL -> "VIR_FROM_INITCTL" + | VIR_FROM_IDENTITY -> "VIR_FROM_IDENTITY" + | VIR_FROM_CGROUP -> "VIR_FROM_CGROUP" + | VIR_FROM_ACCESS -> "VIR_FROM_ACCESS" + | VIR_FROM_SYSTEMD -> "VIR_FROM_SYSTEMD" + | VIR_FROM_BHYVE -> "VIR_FROM_BHYVE" + | VIR_FROM_CRYPTO -> "VIR_FROM_CRYPTO" + | VIR_FROM_FIREWALL -> "VIR_FROM_FIREWALL" + | VIR_FROM_POLKIT -> "VIR_FROM_POLKIT" + | VIR_FROM_THREAD -> "VIR_FROM_THREAD" + | VIR_FROM_ADMIN -> "VIR_FROM_ADMIN" + | VIR_FROM_LOGGING -> "VIR_FROM_LOGGING" + | VIR_FROM_XENXL -> "VIR_FROM_XENXL" + | VIR_FROM_PERF -> "VIR_FROM_PERF" + | VIR_FROM_LIBSSH -> "VIR_FROM_LIBSSH" + | VIR_FROM_RESCTRL -> "VIR_FROM_RESCTRL" | VIR_FROM_UNKNOWN i -> "VIR_FROM_" ^ string_of_int i type level = diff --git a/libvirt/libvirt.mli b/libvirt/libvirt.mli index e3920d5..77e110e 100644 --- a/libvirt/libvirt.mli +++ b/libvirt/libvirt.mli @@ -1313,6 +1313,57 @@ sig | VIR_WAR_NO_STORAGE | VIR_ERR_NO_STORAGE_POOL | VIR_ERR_NO_STORAGE_VOL + | VIR_WAR_NO_NODE + | VIR_ERR_INVALID_NODE_DEVICE + | VIR_ERR_NO_NODE_DEVICE + | VIR_ERR_NO_SECURITY_MODEL + | VIR_ERR_OPERATION_INVALID + | VIR_WAR_NO_INTERFACE + | VIR_ERR_NO_INTERFACE + | VIR_ERR_INVALID_INTERFACE + | VIR_ERR_MULTIPLE_INTERFACES + | VIR_WAR_NO_NWFILTER + | VIR_ERR_INVALID_NWFILTER + | VIR_ERR_NO_NWFILTER + | VIR_ERR_BUILD_FIREWALL + | VIR_WAR_NO_SECRET + | VIR_ERR_INVALID_SECRET + | VIR_ERR_NO_SECRET + | VIR_ERR_CONFIG_UNSUPPORTED + | VIR_ERR_OPERATION_TIMEOUT + | VIR_ERR_MIGRATE_PERSIST_FAILED + | VIR_ERR_HOOK_SCRIPT_FAILED + | VIR_ERR_INVALID_DOMAIN_SNAPSHOT + | VIR_ERR_NO_DOMAIN_SNAPSHOT + | VIR_ERR_INVALID_STREAM + | VIR_ERR_ARGUMENT_UNSUPPORTED + | VIR_ERR_STORAGE_PROBE_FAILED + | VIR_ERR_STORAGE_POOL_BUILT + | VIR_ERR_SNAPSHOT_REVERT_RISKY + | VIR_ERR_OPERATION_ABORTED + | VIR_ERR_AUTH_CANCELLED + | VIR_ERR_NO_DOMAIN_METADATA + | VIR_ERR_MIGRATE_UNSAFE + | VIR_ERR_OVERFLOW + | VIR_ERR_BLOCK_COPY_ACTIVE + | VIR_ERR_OPERATION_UNSUPPORTED + | VIR_ERR_SSH + | VIR_ERR_AGENT_UNRESPONSIVE + | VIR_ERR_RESOURCE_BUSY + | VIR_ERR_ACCESS_DENIED + | VIR_ERR_DBUS_SERVICE + | VIR_ERR_STORAGE_VOL_EXIST + | VIR_ERR_CPU_INCOMPATIBLE + | VIR_ERR_XML_INVALID_SCHEMA + | VIR_ERR_MIGRATE_FINISH_OK + | VIR_ERR_AUTH_UNAVAILABLE + | VIR_ERR_NO_SERVER + | VIR_ERR_NO_CLIENT + | VIR_ERR_AGENT_UNSYNCED + | VIR_ERR_LIBSSH + | VIR_ERR_DEVICE_MISSING + | VIR_ERR_INVALID_NWFILTER_BINDING + | VIR_ERR_NO_NWFILTER_BINDING (* ^^ NB: If you add a variant you MUST edit libvirt_c_epilogue.c:MAX_VIR_* *) | VIR_ERR_UNKNOWN of int @@ -1338,7 +1389,57 @@ sig | VIR_FROM_OPENVZ | VIR_FROM_XENXM | VIR_FROM_STATS_LINUX + | VIR_FROM_LXC | VIR_FROM_STORAGE + | VIR_FROM_NETWORK + | VIR_FROM_DOMAIN + | VIR_FROM_UML + | VIR_FROM_NODEDEV + | VIR_FROM_XEN_INOTIFY + | VIR_FROM_SECURITY + | VIR_FROM_VBOX + | VIR_FROM_INTERFACE + | VIR_FROM_ONE + | VIR_FROM_ESX + | VIR_FROM_PHYP + | VIR_FROM_SECRET + | VIR_FROM_CPU + | VIR_FROM_XENAPI + | VIR_FROM_NWFILTER + | VIR_FROM_HOOK + | VIR_FROM_DOMAIN_SNAPSHOT + | VIR_FROM_AUDIT + | VIR_FROM_SYSINFO + | VIR_FROM_STREAMS + | VIR_FROM_VMWARE + | VIR_FROM_EVENT + | VIR_FROM_LIBXL + | VIR_FROM_LOCKING + | VIR_FROM_HYPERV + | VIR_FROM_CAPABILITIES + | VIR_FROM_URI + | VIR_FROM_AUTH + | VIR_FROM_DBUS + | VIR_FROM_PARALLELS + | VIR_FROM_DEVICE + | VIR_FROM_SSH + | VIR_FROM_LOCKSPACE + | VIR_FROM_INITCTL + | VIR_FROM_IDENTITY + | VIR_FROM_CGROUP + | VIR_FROM_ACCESS + | VIR_FROM_SYSTEMD + | VIR_FROM_BHYVE + | VIR_FROM_CRYPTO + | VIR_FROM_FIREWALL + | VIR_FROM_POLKIT + | VIR_FROM_THREAD + | VIR_FROM_ADMIN + | VIR_FROM_LOGGING + | VIR_FROM_XENXL + | VIR_FROM_PERF + | VIR_FROM_LIBSSH + | VIR_FROM_RESCTRL (* ^^ NB: If you add a variant you MUST edit libvirt_c_epilogue.c: MAX_VIR_* *) | VIR_FROM_UNKNOWN of int diff --git a/libvirt/libvirt_c_epilogue.c b/libvirt/libvirt_c_epilogue.c index f5f0591..4574131 100644 --- a/libvirt/libvirt_c_epilogue.c +++ b/libvirt/libvirt_c_epilogue.c @@ -143,8 +143,8 @@ Val_virconnectcredential (const virConnectCredentialPtr cred) * to convert it into VIR_*_UNKNOWN (code). */ -#define MAX_VIR_CODE 50 /* VIR_ERR_NO_STORAGE_VOL */ -#define MAX_VIR_DOMAIN 17 /* VIR_FROM_STORAGE */ +#define MAX_VIR_CODE 101 /* VIR_ERR_NO_NWFILTER_BINDING */ +#define MAX_VIR_DOMAIN 67 /* VIR_FROM_RESCTRL */ #define MAX_VIR_LEVEL VIR_ERR_ERROR static inline value -- 1.8.3.1