[libvirt] [PATCH 0/2] Kill off 'function (...args...)' whitespace

Libvirt normally omits whitespace between the function name and its args, but there are still approx 1000 places where whitespace is included. Since people can't follow the style, clean this up and then enforce it with syntax-check.

From: "Daniel P. Berrange" <berrange@redhat.com> The libvirt coding standard is to use 'function(...args...)' instead of 'function (...args...)'. A non-trivial number of places did not follow this rule and are fixed in this patch. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- daemon/libvirtd-config.c | 94 ++-- daemon/libvirtd.c | 118 ++--- python/libvirt-override.c | 34 +- src/conf/domain_conf.c | 26 +- src/conf/network_conf.c | 4 +- src/esx/esx_driver.c | 4 +- src/interface/interface_backend_netcf.c | 2 +- src/libvirt.c | 746 +++++++++++++-------------- src/libxl/libxl_conf.c | 2 +- src/lxc/lxc_conf.c | 16 +- src/lxc/lxc_container.c | 2 +- src/network/bridge_driver.c | 4 +- src/nodeinfo.c | 2 +- src/nwfilter/nwfilter_driver.c | 2 +- src/nwfilter/nwfilter_ebiptables_driver.c | 10 +- src/openvz/openvz_conf.c | 2 +- src/openvz/openvz_driver.c | 16 +- src/qemu/qemu_capabilities.c | 4 +- src/qemu/qemu_command.c | 8 +- src/qemu/qemu_conf.c | 148 +++--- src/qemu/qemu_driver.c | 116 ++--- src/qemu/qemu_hotplug.c | 4 +- src/qemu/qemu_migration.c | 10 +- src/qemu/qemu_monitor_text.c | 100 ++-- src/remote/remote_driver.c | 818 +++++++++++++++--------------- src/rpc/virnetclient.c | 16 +- src/rpc/virnetserverclient.c | 2 +- src/rpc/virnetsocket.c | 2 +- src/rpc/virnettlscontext.c | 2 +- src/secret/secret_driver.c | 2 +- src/security/virt-aa-helper.c | 4 +- src/storage/storage_backend.c | 8 +- src/storage/storage_backend_disk.c | 4 +- src/storage/storage_backend_mpath.c | 2 +- src/storage/storage_driver.c | 2 +- src/test/test_driver.c | 30 +- src/uml/uml_conf.c | 2 +- src/uml/uml_driver.c | 10 +- src/util/command.c | 2 +- src/util/conf.c | 8 +- src/util/logging.c | 4 +- src/util/pci.c | 2 +- src/util/stats_linux.c | 24 +- src/util/storage_file.c | 4 +- src/util/util.c | 28 +- src/util/virterror.c | 2 +- src/util/virtime.c | 4 +- src/util/viruri.c | 24 +- src/vbox/vbox_driver.c | 8 +- src/vbox/vbox_tmpl.c | 30 +- src/xen/block_stats.c | 42 +- src/xen/xen_driver.c | 346 ++++++------- src/xen/xen_hypervisor.c | 68 +-- src/xen/xen_inotify.c | 2 +- src/xen/xend_internal.c | 122 ++--- src/xen/xm_internal.c | 28 +- src/xen/xs_internal.c | 26 +- src/xenapi/xenapi_driver.c | 104 ++-- src/xenapi/xenapi_utils.c | 12 +- src/xenxs/xen_sxpr.c | 10 +- tests/commandtest.c | 4 +- tests/conftest.c | 2 +- tests/seclabeltest.c | 12 +- tests/testutils.c | 10 +- tests/testutilsxen.c | 2 +- tests/viratomictest.c | 2 +- tests/virhashtest.c | 4 +- tools/console.c | 2 +- tools/virsh-edit.c | 2 +- tools/virsh-host.c | 2 +- tools/virsh-interface.c | 2 +- tools/virsh.c | 2 +- 72 files changed, 1662 insertions(+), 1662 deletions(-) diff --git a/daemon/libvirtd-config.c b/daemon/libvirtd-config.c index d9dfea1..7838044 100644 --- a/daemon/libvirtd-config.c +++ b/daemon/libvirtd-config.c @@ -45,7 +45,7 @@ remoteConfigGetStringList(virConfPtr conf, const char *key, char ***list_arg, const char *filename) { char **list; - virConfValuePtr p = virConfGetValue (conf, key); + virConfValuePtr p = virConfGetValue(conf, key); if (!p) return 0; @@ -57,7 +57,7 @@ remoteConfigGetStringList(virConfPtr conf, const char *key, char ***list_arg, key); return -1; } - list[0] = strdup (p->str); + list[0] = strdup(p->str); list[1] = NULL; if (list[0] == NULL) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -88,7 +88,7 @@ remoteConfigGetStringList(virConfPtr conf, const char *key, char ***list_arg, VIR_FREE(list); return -1; } - list[i] = strdup (pp->str); + list[i] = strdup(pp->str); if (list[i] == NULL) { int j; for (j = 0 ; j < i ; j++) @@ -119,15 +119,15 @@ remoteConfigGetStringList(virConfPtr conf, const char *key, char ***list_arg, /* A helper function used by each of the following macros. */ static int -checkType (virConfValuePtr p, const char *filename, - const char *key, virConfType required_type) +checkType(virConfValuePtr p, const char *filename, + const char *key, virConfType required_type) { if (p->type != required_type) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("remoteReadConfigFile: %s: %s: invalid type:" " got %s; expected %s"), filename, key, - virConfTypeName (p->type), - virConfTypeName (required_type)); + virConfTypeName(p->type), + virConfTypeName(required_type)); return -1; } return 0; @@ -139,12 +139,12 @@ checkType (virConfValuePtr p, const char *filename, failure), give a diagnostic and "goto" the cleanup-and-fail label. */ #define GET_CONF_STR(conf, filename, var_name) \ do { \ - virConfValuePtr p = virConfGetValue (conf, #var_name); \ + virConfValuePtr p = virConfGetValue(conf, #var_name); \ if (p) { \ - if (checkType (p, filename, #var_name, VIR_CONF_STRING) < 0) \ + if (checkType(p, filename, #var_name, VIR_CONF_STRING) < 0) \ goto error; \ VIR_FREE(data->var_name); \ - if (!(data->var_name = strdup (p->str))) { \ + if (!(data->var_name = strdup(p->str))) { \ virReportOOMError(); \ goto error; \ } \ @@ -154,9 +154,9 @@ checkType (virConfValuePtr p, const char *filename, /* Like GET_CONF_STR, but for integral values. */ #define GET_CONF_INT(conf, filename, var_name) \ do { \ - virConfValuePtr p = virConfGetValue (conf, #var_name); \ + virConfValuePtr p = virConfGetValue(conf, #var_name); \ if (p) { \ - if (checkType (p, filename, #var_name, VIR_CONF_LONG) < 0) \ + if (checkType(p, filename, #var_name, VIR_CONF_LONG) < 0) \ goto error; \ data->var_name = p->l; \ } \ @@ -166,11 +166,11 @@ checkType (virConfValuePtr p, const char *filename, static int remoteConfigGetAuth(virConfPtr conf, const char *key, int *auth, const char *filename) { virConfValuePtr p; - p = virConfGetValue (conf, key); + p = virConfGetValue(conf, key); if (!p) return 0; - if (checkType (p, filename, key, VIR_CONF_STRING) < 0) + if (checkType(p, filename, key, VIR_CONF_STRING) < 0) return -1; if (!p->str) @@ -366,11 +366,11 @@ daemonConfigLoadOptions(struct daemonConfig *data, const char *filename, virConfPtr conf) { - GET_CONF_INT (conf, filename, listen_tcp); - GET_CONF_INT (conf, filename, listen_tls); - GET_CONF_STR (conf, filename, tls_port); - GET_CONF_STR (conf, filename, tcp_port); - GET_CONF_STR (conf, filename, listen_addr); + GET_CONF_INT(conf, filename, listen_tcp); + GET_CONF_INT(conf, filename, listen_tls); + GET_CONF_STR(conf, filename, tls_port); + GET_CONF_STR(conf, filename, tcp_port); + GET_CONF_STR(conf, filename, listen_addr); if (remoteConfigGetAuth(conf, "auth_unix_rw", &data->auth_unix_rw, filename) < 0) goto error; @@ -393,22 +393,22 @@ daemonConfigLoadOptions(struct daemonConfig *data, if (remoteConfigGetAuth(conf, "auth_tls", &data->auth_tls, filename) < 0) goto error; - GET_CONF_STR (conf, filename, unix_sock_group); - GET_CONF_STR (conf, filename, unix_sock_ro_perms); - GET_CONF_STR (conf, filename, unix_sock_rw_perms); + GET_CONF_STR(conf, filename, unix_sock_group); + GET_CONF_STR(conf, filename, unix_sock_ro_perms); + GET_CONF_STR(conf, filename, unix_sock_rw_perms); - GET_CONF_STR (conf, filename, unix_sock_dir); + GET_CONF_STR(conf, filename, unix_sock_dir); - GET_CONF_INT (conf, filename, mdns_adv); - GET_CONF_STR (conf, filename, mdns_name); + GET_CONF_INT(conf, filename, mdns_adv); + GET_CONF_STR(conf, filename, mdns_name); - GET_CONF_INT (conf, filename, tls_no_sanity_certificate); - GET_CONF_INT (conf, filename, tls_no_verify_certificate); + GET_CONF_INT(conf, filename, tls_no_sanity_certificate); + GET_CONF_INT(conf, filename, tls_no_verify_certificate); - GET_CONF_STR (conf, filename, key_file); - GET_CONF_STR (conf, filename, cert_file); - GET_CONF_STR (conf, filename, ca_file); - GET_CONF_STR (conf, filename, crl_file); + GET_CONF_STR(conf, filename, key_file); + GET_CONF_STR(conf, filename, cert_file); + GET_CONF_STR(conf, filename, ca_file); + GET_CONF_STR(conf, filename, crl_file); if (remoteConfigGetStringList(conf, "tls_allowed_dn_list", &data->tls_allowed_dn_list, filename) < 0) @@ -420,28 +420,28 @@ daemonConfigLoadOptions(struct daemonConfig *data, goto error; - GET_CONF_INT (conf, filename, min_workers); - GET_CONF_INT (conf, filename, max_workers); - GET_CONF_INT (conf, filename, max_clients); + GET_CONF_INT(conf, filename, min_workers); + GET_CONF_INT(conf, filename, max_workers); + GET_CONF_INT(conf, filename, max_clients); - GET_CONF_INT (conf, filename, prio_workers); + GET_CONF_INT(conf, filename, prio_workers); - GET_CONF_INT (conf, filename, max_requests); - GET_CONF_INT (conf, filename, max_client_requests); + GET_CONF_INT(conf, filename, max_requests); + GET_CONF_INT(conf, filename, max_client_requests); - GET_CONF_INT (conf, filename, audit_level); - GET_CONF_INT (conf, filename, audit_logging); + GET_CONF_INT(conf, filename, audit_level); + GET_CONF_INT(conf, filename, audit_logging); - GET_CONF_STR (conf, filename, host_uuid); + GET_CONF_STR(conf, filename, host_uuid); - GET_CONF_INT (conf, filename, log_level); - GET_CONF_STR (conf, filename, log_filters); - GET_CONF_STR (conf, filename, log_outputs); - GET_CONF_INT (conf, filename, log_buffer_size); + GET_CONF_INT(conf, filename, log_level); + GET_CONF_STR(conf, filename, log_filters); + GET_CONF_STR(conf, filename, log_outputs); + GET_CONF_INT(conf, filename, log_buffer_size); - GET_CONF_INT (conf, filename, keepalive_interval); - GET_CONF_INT (conf, filename, keepalive_count); - GET_CONF_INT (conf, filename, keepalive_required); + GET_CONF_INT(conf, filename, keepalive_interval); + GET_CONF_INT(conf, filename, keepalive_count); + GET_CONF_INT(conf, filename, keepalive_required); return 0; diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index d2e0a04..b81eedb 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -710,23 +710,23 @@ error: static void daemonVersion(const char *argv0) { - printf ("%s (%s) %s\n", argv0, PACKAGE_NAME, PACKAGE_VERSION); + printf("%s (%s) %s\n", argv0, PACKAGE_NAME, PACKAGE_VERSION); } #ifdef __sun static int daemonSetupPrivs(void) { - chown ("/var/run/libvirt", SYSTEM_UID, SYSTEM_UID); + chown("/var/run/libvirt", SYSTEM_UID, SYSTEM_UID); - if (__init_daemon_priv (PU_RESETGROUPS | PU_CLEARLIMITSET, - SYSTEM_UID, SYSTEM_UID, PRIV_XVM_CONTROL, NULL)) { + if (__init_daemon_priv(PU_RESETGROUPS | PU_CLEARLIMITSET, + SYSTEM_UID, SYSTEM_UID, PRIV_XVM_CONTROL, NULL)) { VIR_ERROR(_("additional privileges are required")); return -1; } - if (priv_set (PRIV_OFF, PRIV_ALLSETS, PRIV_FILE_LINK_ANY, PRIV_PROC_INFO, - PRIV_PROC_SESSION, PRIV_PROC_EXEC, PRIV_PROC_FORK, NULL)) { + if (priv_set(PRIV_OFF, PRIV_ALLSETS, PRIV_FILE_LINK_ANY, PRIV_PROC_INFO, + PRIV_PROC_SESSION, PRIV_PROC_EXEC, PRIV_PROC_FORK, NULL)) { VIR_ERROR(_("failed to set reduced privileges")); return -1; } @@ -881,42 +881,42 @@ static int migrateProfile(void) static void daemonUsage(const char *argv0, bool privileged) { - fprintf (stderr, - _("\n\ -Usage:\n\ - %s [options]\n\ -\n\ -Options:\n\ - -v | --verbose Verbose messages.\n\ - -d | --daemon Run as a daemon & write PID file.\n\ - -l | --listen Listen for TCP/IP connections.\n\ - -t | --timeout <secs> Exit after timeout period.\n\ - -f | --config <file> Configuration file.\n\ - | --version Display version information.\n\ - -p | --pid-file <file> Change name of PID file.\n\ -\n\ -libvirt management daemon:\n"), argv0); + fprintf(stderr, + _("\n" +"Usage:\n" +" %s [options]\n" +"\n" +"Options:\n" +" -v | --verbose Verbose messages.\n" +" -d | --daemon Run as a daemon & write PID file.\n" +" -l | --listen Listen for TCP/IP connections.\n" +" -t | --timeout <secs> Exit after timeout period.\n" +" -f | --config <file> Configuration file.\n" +" | --version Display version information.\n" +" -p | --pid-file <file> Change name of PID file.\n" +"\n" +"libvirt management daemon:\n"), argv0); if (privileged) { fprintf(stderr, - _("\n\ - Default paths:\n\ -\n\ - Configuration file (unless overridden by -f):\n\ - %s/libvirt/libvirtd.conf\n\ -\n\ - Sockets:\n\ - %s/run/libvirt/libvirt-sock\n\ - %s/run/libvirt/libvirt-sock-ro\n\ -\n\ - TLS:\n\ - CA certificate: %s/pki/CA/caert.pem\n\ - Server certificate: %s/pki/libvirt/servercert.pem\n\ - Server private key: %s/pki/libvirt/private/serverkey.pem\n\ -\n\ - PID file (unless overridden by -p):\n\ - %s/run/libvirtd.pid\n\ -\n"), + _("\n" +" Default paths:\n" +"\n" +" Configuration file (unless overridden by -f):\n" +" %s/libvirt/libvirtd.conf\n" +"\n" +" Sockets:\n" +" %s/run/libvirt/libvirt-sock\n" +" %s/run/libvirt/libvirt-sock-ro\n" +"\n" +" TLS:\n" +" CA certificate: %s/pki/CA/caert.pem\n" +" Server certificate: %s/pki/libvirt/servercert.pem\n" +" Server private key: %s/pki/libvirt/private/serverkey.pem\n" +"\n" +" PID file (unless overridden by -p):\n" +" %s/run/libvirtd.pid\n" +"\n"), SYSCONFDIR, LOCALSTATEDIR, LOCALSTATEDIR, @@ -926,23 +926,23 @@ libvirt management daemon:\n"), argv0); LOCALSTATEDIR); } else { fprintf(stderr, - "%s", _("\n\ - Default paths:\n\ -\n\ - Configuration file (unless overridden by -f):\n\ - $XDG_CONFIG_HOME/libvirt/libvirtd.conf\n\ -\n\ - Sockets:\n\ - $XDG_RUNTIME_DIR/libvirt/libvirt-sock (in UNIX abstract namespace)\n\ -\n\ - TLS:\n\ - CA certificate: $HOME/.pki/libvirt/cacert.pem\n\ - Server certificate: $HOME/.pki/libvirt/servercert.pem\n\ - Server private key: $HOME/.pki/libvirt/serverkey.pem\n\ -\n\ - PID file:\n\ - $XDG_RUNTIME_DIR/libvirt/libvirtd.pid\n\ -\n")); + "%s", _("\n" +" Default paths:\n" +"\n" +" Configuration file (unless overridden by -f):\n" +" $XDG_CONFIG_HOME/libvirt/libvirtd.conf\n" +"\n" +" Sockets:\n" +" $XDG_RUNTIME_DIR/libvirt/libvirt-sock (in UNIX abstract namespace)\n" +"\n" +" TLS:\n" +" CA certificate: $HOME/.pki/libvirt/cacert.pem\n" +" Server certificate: $HOME/.pki/libvirt/servercert.pem\n" +" Server private key: $HOME/.pki/libvirt/serverkey.pem\n" +"\n" +" PID file:\n" +" $XDG_RUNTIME_DIR/libvirt/libvirtd.pid\n" +"\n")); } } @@ -982,8 +982,8 @@ int main(int argc, char **argv) { {0, 0, 0, 0} }; - if (setlocale (LC_ALL, "") == NULL || - bindtextdomain (PACKAGE, LOCALEDIR) == NULL || + if (setlocale(LC_ALL, "") == NULL || + bindtextdomain(PACKAGE, LOCALEDIR) == NULL || textdomain(PACKAGE) == NULL || virInitialize() < 0) { fprintf(stderr, _("%s: initialization failed\n"), argv[0]); @@ -1078,7 +1078,7 @@ int main(int argc, char **argv) { default: VIR_ERROR(_("%s: internal error: unknown flag: %c"), argv[0], c); - exit (EXIT_FAILURE); + exit(EXIT_FAILURE); } } diff --git a/python/libvirt-override.c b/python/libvirt-override.c index 83dc925..2011ecb 100644 --- a/python/libvirt-override.c +++ b/python/libvirt-override.c @@ -1940,21 +1940,21 @@ libvirt_virConnectOpenAuth(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { ************************************************************************/ static PyObject * -libvirt_virGetVersion (PyObject *self ATTRIBUTE_UNUSED, PyObject *args) +libvirt_virGetVersion(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { char *type = NULL; unsigned long libVer, typeVer = 0; int c_retval; - if (!PyArg_ParseTuple (args, (char *) "|s", &type)) + if (!PyArg_ParseTuple(args, (char *) "|s", &type)) return NULL; LIBVIRT_BEGIN_ALLOW_THREADS; if (type == NULL) - c_retval = virGetVersion (&libVer, NULL, NULL); + c_retval = virGetVersion(&libVer, NULL, NULL); else - c_retval = virGetVersion (&libVer, type, &typeVer); + c_retval = virGetVersion(&libVer, type, &typeVer); LIBVIRT_END_ALLOW_THREADS; @@ -1962,14 +1962,14 @@ libvirt_virGetVersion (PyObject *self ATTRIBUTE_UNUSED, PyObject *args) return VIR_PY_NONE; if (type == NULL) - return PyInt_FromLong (libVer); + return PyInt_FromLong(libVer); else - return Py_BuildValue ((char *) "kk", libVer, typeVer); + return Py_BuildValue((char *) "kk", libVer, typeVer); } static PyObject * -libvirt_virConnectGetVersion (PyObject *self ATTRIBUTE_UNUSED, - PyObject *args) +libvirt_virConnectGetVersion(PyObject *self ATTRIBUTE_UNUSED, + PyObject *args) { unsigned long hvVersion; int c_retval; @@ -1990,12 +1990,12 @@ libvirt_virConnectGetVersion (PyObject *self ATTRIBUTE_UNUSED, if (c_retval == -1) return VIR_PY_INT_FAIL; - return PyInt_FromLong (hvVersion); + return PyInt_FromLong(hvVersion); } static PyObject * -libvirt_virConnectGetLibVersion (PyObject *self ATTRIBUTE_UNUSED, - PyObject *args) +libvirt_virConnectGetLibVersion(PyObject *self ATTRIBUTE_UNUSED, + PyObject *args) { unsigned long libVer; int c_retval; @@ -2016,7 +2016,7 @@ libvirt_virConnectGetLibVersion (PyObject *self ATTRIBUTE_UNUSED, if (c_retval == -1) return VIR_PY_INT_FAIL; - return PyInt_FromLong (libVer); + return PyInt_FromLong(libVer); } static PyObject * @@ -4404,7 +4404,7 @@ static PyObject *libvirt_dict = NULL; static PyObject *libvirt_dom_class = NULL; static PyObject * -getLibvirtModuleObject (void) { +getLibvirtModuleObject(void) { if(libvirt_module) return libvirt_module; @@ -4421,7 +4421,7 @@ getLibvirtModuleObject (void) { } static PyObject * -getLibvirtDictObject (void) { +getLibvirtDictObject(void) { if(libvirt_dict) return libvirt_dict; @@ -4438,7 +4438,7 @@ getLibvirtDictObject (void) { } static PyObject * -getLibvirtDomainClassObject (void) { +getLibvirtDomainClassObject(void) { if(libvirt_dom_class) return libvirt_dom_class; @@ -4975,7 +4975,7 @@ libvirt_virEventInvokeHandleCallback(PyObject *self ATTRIBUTE_UNUSED, if(cb) { LIBVIRT_BEGIN_ALLOW_THREADS; - cb (watch, fd, event, opaque); + cb(watch, fd, event, opaque); LIBVIRT_END_ALLOW_THREADS; } @@ -5002,7 +5002,7 @@ libvirt_virEventInvokeTimeoutCallback(PyObject *self ATTRIBUTE_UNUSED, opaque = (void *) PyvirVoidPtr_Get(py_opaque); if(cb) { LIBVIRT_BEGIN_ALLOW_THREADS; - cb (timer, opaque); + cb(timer, opaque); LIBVIRT_END_ALLOW_THREADS; } diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index f0c5d50..75a66cb 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4879,14 +4879,14 @@ virDomainNetDefParseXML(virCapsPtr caps, } else if (!script && xmlStrEqual(cur->name, BAD_CAST "script")) { script = virXMLPropString(cur, "path"); - } else if (xmlStrEqual (cur->name, BAD_CAST "model")) { + } else if (xmlStrEqual(cur->name, BAD_CAST "model")) { model = virXMLPropString(cur, "type"); - } else if (xmlStrEqual (cur->name, BAD_CAST "driver")) { + } else if (xmlStrEqual(cur->name, BAD_CAST "driver")) { backend = virXMLPropString(cur, "name"); txmode = virXMLPropString(cur, "txmode"); ioeventfd = virXMLPropString(cur, "ioeventfd"); event_idx = virXMLPropString(cur, "event_idx"); - } else if (xmlStrEqual (cur->name, BAD_CAST "filterref")) { + } else if (xmlStrEqual(cur->name, BAD_CAST "filterref")) { if (filter) { virReportError(VIR_ERR_XML_ERROR, "%s", _("Invalid specification of multiple <filterref>s " @@ -6910,29 +6910,29 @@ virDomainWatchdogDefParseXML(const xmlNodePtr node, char *action = NULL; virDomainWatchdogDefPtr def; - if (VIR_ALLOC (def) < 0) { + if (VIR_ALLOC(def) < 0) { virReportOOMError(); return NULL; } - model = virXMLPropString (node, "model"); + model = virXMLPropString(node, "model"); if (model == NULL) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("watchdog must contain model name")); goto error; } - def->model = virDomainWatchdogModelTypeFromString (model); + def->model = virDomainWatchdogModelTypeFromString(model); if (def->model < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unknown watchdog model '%s'"), model); goto error; } - action = virXMLPropString (node, "action"); + action = virXMLPropString(node, "action"); if (action == NULL) def->action = VIR_DOMAIN_WATCHDOG_ACTION_RESET; else { - def->action = virDomainWatchdogActionTypeFromString (action); + def->action = virDomainWatchdogActionTypeFromString(action); if (def->action < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unknown watchdog action '%s'"), action); @@ -6944,13 +6944,13 @@ virDomainWatchdogDefParseXML(const xmlNodePtr node, goto error; cleanup: - VIR_FREE (action); - VIR_FREE (model); + VIR_FREE(action); + VIR_FREE(model); return def; error: - virDomainWatchdogDefFree (def); + virDomainWatchdogDefFree(def); def = NULL; goto cleanup; } @@ -12848,8 +12848,8 @@ virDomainWatchdogDefFormat(virBufferPtr buf, virDomainWatchdogDefPtr def, unsigned int flags) { - const char *model = virDomainWatchdogModelTypeToString (def->model); - const char *action = virDomainWatchdogActionTypeToString (def->action); + const char *model = virDomainWatchdogModelTypeToString(def->model); + const char *action = virDomainWatchdogActionTypeToString(def->action); if (!model) { virReportError(VIR_ERR_INTERNAL_ERROR, diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index 891d48c..1f06b81 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -3087,8 +3087,8 @@ void virNetworkObjUnlock(virNetworkObjPtr obj) #define MATCH(FLAG) (flags & (FLAG)) static bool -virNetworkMatch (virNetworkObjPtr netobj, - unsigned int flags) +virNetworkMatch(virNetworkObjPtr netobj, + unsigned int flags) { /* filter by active state */ if (MATCH(VIR_CONNECT_LIST_NETWORKS_FILTERS_ACTIVE) && diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 8d13829..b43fcae 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -3767,7 +3767,7 @@ esxDomainSetSchedulerParametersFlags(virDomainPtr domain, } spec->cpuAllocation->reservation->value = params[i].value.l; - } else if(STREQ (params[i].field, VIR_DOMAIN_SCHEDULER_LIMIT)) { + } else if (STREQ(params[i].field, VIR_DOMAIN_SCHEDULER_LIMIT)) { if (esxVI_Long_Alloc(&spec->cpuAllocation->limit) < 0) { goto cleanup; } @@ -3781,7 +3781,7 @@ esxDomainSetSchedulerParametersFlags(virDomainPtr domain, } spec->cpuAllocation->limit->value = params[i].value.l; - } else if(STREQ (params[i].field, VIR_DOMAIN_SCHEDULER_SHARES)) { + } else if (STREQ(params[i].field, VIR_DOMAIN_SCHEDULER_SHARES)) { if (esxVI_SharesInfo_Alloc(&sharesInfo) < 0 || esxVI_Int_Alloc(&sharesInfo->shares) < 0) { goto cleanup; diff --git a/src/interface/interface_backend_netcf.c b/src/interface/interface_backend_netcf.c index 55abbad..226e020 100644 --- a/src/interface/interface_backend_netcf.c +++ b/src/interface/interface_backend_netcf.c @@ -152,7 +152,7 @@ netcf_error: { ncf_close(driverState->netcf); } - virMutexDestroy (&driverState->lock); + virMutexDestroy(&driverState->lock); mutex_error: VIR_FREE(driverState); alloc_error: diff --git a/src/libvirt.c b/src/libvirt.c index e3ddf27..f539356 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -256,7 +256,7 @@ virConnectAuthPtr virConnectAuthPtrDefault = &virConnectAuthDefault; #if HAVE_WINSOCK2_H static int -winsock_init (void) +winsock_init(void) { WORD winsock_version, err; WSADATA winsock_data; @@ -268,8 +268,8 @@ winsock_init (void) } #endif -static int virTLSMutexInit (void **priv) -{ \ +static int virTLSMutexInit(void **priv) +{ virMutexPtr lock = NULL; if (VIR_ALLOC(lock) < 0) @@ -417,7 +417,7 @@ virGlobalInit(void) VIR_DEBUG("register drivers"); #if HAVE_WINSOCK2_H - if (winsock_init () == -1) + if (winsock_init() == -1) goto error; #endif @@ -465,7 +465,7 @@ virGlobalInit(void) goto error; #endif #ifdef WITH_REMOTE - if (remoteRegister () == -1) + if (remoteRegister() == -1) goto error; #endif @@ -503,12 +503,12 @@ virInitialize(void) #ifdef WIN32 BOOL WINAPI -DllMain (HINSTANCE instance, DWORD reason, LPVOID ignore); +DllMain(HINSTANCE instance, DWORD reason, LPVOID ignore); BOOL WINAPI -DllMain (HINSTANCE instance ATTRIBUTE_UNUSED, - DWORD reason, - LPVOID ignore ATTRIBUTE_UNUSED) +DllMain(HINSTANCE instance ATTRIBUTE_UNUSED, + DWORD reason, + LPVOID ignore ATTRIBUTE_UNUSED) { switch (reason) { case DLL_PROCESS_ATTACH: @@ -590,7 +590,7 @@ virRegisterNetworkDriver(virNetworkDriverPtr driver) return -1; } - VIR_DEBUG ("registering %s as network driver %d", + VIR_DEBUG("registering %s as network driver %d", driver->name, virNetworkDriverTabCount); virNetworkDriverTab[virNetworkDriverTabCount] = driver; @@ -617,7 +617,7 @@ virRegisterInterfaceDriver(virInterfaceDriverPtr driver) return -1; } - VIR_DEBUG ("registering %s as interface driver %d", + VIR_DEBUG("registering %s as interface driver %d", driver->name, virInterfaceDriverTabCount); virInterfaceDriverTab[virInterfaceDriverTabCount] = driver; @@ -644,7 +644,7 @@ virRegisterStorageDriver(virStorageDriverPtr driver) return -1; } - VIR_DEBUG ("registering %s as storage driver %d", + VIR_DEBUG("registering %s as storage driver %d", driver->name, virStorageDriverTabCount); virStorageDriverTab[virStorageDriverTabCount] = driver; @@ -671,7 +671,7 @@ virRegisterDeviceMonitor(virDeviceMonitorPtr driver) return -1; } - VIR_DEBUG ("registering %s as device driver %d", + VIR_DEBUG("registering %s as device driver %d", driver->name, virDeviceMonitorTabCount); virDeviceMonitorTab[virDeviceMonitorTabCount] = driver; @@ -698,7 +698,7 @@ virRegisterSecretDriver(virSecretDriverPtr driver) return -1; } - VIR_DEBUG ("registering %s as secret driver %d", + VIR_DEBUG("registering %s as secret driver %d", driver->name, virSecretDriverTabCount); virSecretDriverTab[virSecretDriverTabCount] = driver; @@ -725,7 +725,7 @@ virRegisterNWFilterDriver(virNWFilterDriverPtr driver) return -1; } - VIR_DEBUG ("registering %s as network filter driver %d", + VIR_DEBUG("registering %s as network filter driver %d", driver->name, virNWFilterDriverTabCount); virNWFilterDriverTab[virNWFilterDriverTabCount] = driver; @@ -755,7 +755,7 @@ virRegisterDriver(virDriverPtr driver) return -1; } - VIR_DEBUG ("registering %s as driver %d", + VIR_DEBUG("registering %s as driver %d", driver->name, virDriverTabCount); virDriverTab[virDriverTabCount] = driver; @@ -1076,9 +1076,9 @@ cleanup: } static virConnectPtr -do_open (const char *name, - virConnectAuthPtr auth, - unsigned int flags) +do_open(const char *name, + virConnectAuthPtr auth, + unsigned int flags) { int i, res; virConnectPtr ret; @@ -1114,14 +1114,14 @@ do_open (const char *name, /* Convert xen:// -> xen:/// because xmlParseURI cannot parse the * former. This allows URIs such as xen://localhost to work. */ - if (STREQ (name, "xen://")) + if (STREQ(name, "xen://")) name = "xen:///"; if (!(flags & VIR_CONNECT_NO_ALIASES) && virConnectOpenResolveURIAlias(conf, name, &alias) < 0) goto failed; - if (!(ret->uri = virURIParse (alias ? alias : name))) { + if (!(ret->uri = virURIParse(alias ? alias : name))) { VIR_FREE(alias); goto failed; } @@ -1183,7 +1183,7 @@ do_open (const char *name, VIR_DEBUG("trying driver %d (%s) ...", i, virDriverTab[i]->name); - res = virDriverTab[i]->open (ret, auth, flags); + res = virDriverTab[i]->open(ret, auth, flags); VIR_DEBUG("driver %d %s returned %s", i, virDriverTab[i]->name, res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" : @@ -1205,7 +1205,7 @@ do_open (const char *name, } for (i = 0; i < virNetworkDriverTabCount; i++) { - res = virNetworkDriverTab[i]->open (ret, auth, flags); + res = virNetworkDriverTab[i]->open(ret, auth, flags); VIR_DEBUG("network driver %d %s returned %s", i, virNetworkDriverTab[i]->name, res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" : @@ -1220,7 +1220,7 @@ do_open (const char *name, } for (i = 0; i < virInterfaceDriverTabCount; i++) { - res = virInterfaceDriverTab[i]->open (ret, auth, flags); + res = virInterfaceDriverTab[i]->open(ret, auth, flags); VIR_DEBUG("interface driver %d %s returned %s", i, virInterfaceDriverTab[i]->name, res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" : @@ -1236,7 +1236,7 @@ do_open (const char *name, /* Secondary driver for storage. Optional */ for (i = 0; i < virStorageDriverTabCount; i++) { - res = virStorageDriverTab[i]->open (ret, auth, flags); + res = virStorageDriverTab[i]->open(ret, auth, flags); VIR_DEBUG("storage driver %d %s returned %s", i, virStorageDriverTab[i]->name, res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" : @@ -1252,7 +1252,7 @@ do_open (const char *name, /* Node driver (optional) */ for (i = 0; i < virDeviceMonitorTabCount; i++) { - res = virDeviceMonitorTab[i]->open (ret, auth, flags); + res = virDeviceMonitorTab[i]->open(ret, auth, flags); VIR_DEBUG("node driver %d %s returned %s", i, virDeviceMonitorTab[i]->name, res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" : @@ -1268,7 +1268,7 @@ do_open (const char *name, /* Secret manipulation driver. Optional */ for (i = 0; i < virSecretDriverTabCount; i++) { - res = virSecretDriverTab[i]->open (ret, auth, flags); + res = virSecretDriverTab[i]->open(ret, auth, flags); VIR_DEBUG("secret driver %d %s returned %s", i, virSecretDriverTab[i]->name, res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" : @@ -1284,7 +1284,7 @@ do_open (const char *name, /* Network filter driver. Optional */ for (i = 0; i < virNWFilterDriverTabCount; i++) { - res = virNWFilterDriverTab[i]->open (ret, auth, flags); + res = virNWFilterDriverTab[i]->open(ret, auth, flags); VIR_DEBUG("nwfilter driver %d %s returned %s", i, virNWFilterDriverTab[i]->name, res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" : @@ -1332,7 +1332,7 @@ failed: * URIs are documented at http://libvirt.org/uri.html */ virConnectPtr -virConnectOpen (const char *name) +virConnectOpen(const char *name) { virConnectPtr ret = NULL; @@ -1341,7 +1341,7 @@ virConnectOpen (const char *name) VIR_DEBUG("name=%s", name); virResetLastError(); - ret = do_open (name, NULL, 0); + ret = do_open(name, NULL, 0); if (!ret) goto error; return ret; @@ -1376,7 +1376,7 @@ virConnectOpenReadOnly(const char *name) VIR_DEBUG("name=%s", name); virResetLastError(); - ret = do_open (name, NULL, VIR_CONNECT_RO); + ret = do_open(name, NULL, VIR_CONNECT_RO); if (!ret) goto error; return ret; @@ -1415,7 +1415,7 @@ virConnectOpenAuth(const char *name, VIR_DEBUG("name=%s, auth=%p, flags=%x", NULLSTR(name), auth, flags); virResetLastError(); - ret = do_open (name, auth, flags); + ret = do_open(name, auth, flags); if (!ret) goto error; return ret; @@ -1510,7 +1510,7 @@ virConnectRef(virConnectPtr conn) * implementation of driver features in the remote case. */ int -virDrvSupportsFeature (virConnectPtr conn, int feature) +virDrvSupportsFeature(virConnectPtr conn, int feature) { int ret; VIR_DEBUG("conn=%p, feature=%d", conn, feature); @@ -1560,7 +1560,7 @@ virConnectGetType(virConnectPtr conn) } if (conn->driver->type) { - ret = conn->driver->type (conn); + ret = conn->driver->type(conn); if (ret) return ret; } return conn->driver->name; @@ -1595,7 +1595,7 @@ virConnectGetVersion(virConnectPtr conn, unsigned long *hvVer) virCheckNonNullArgGoto(hvVer, error); if (conn->driver->version) { - int ret = conn->driver->version (conn, hvVer); + int ret = conn->driver->version(conn, hvVer); if (ret < 0) goto error; return ret; @@ -1663,7 +1663,7 @@ error: * NULL if there was an error. */ char * -virConnectGetHostname (virConnectPtr conn) +virConnectGetHostname(virConnectPtr conn) { VIR_DEBUG("conn=%p", conn); @@ -1676,7 +1676,7 @@ virConnectGetHostname (virConnectPtr conn) } if (conn->driver->getHostname) { - char *ret = conn->driver->getHostname (conn); + char *ret = conn->driver->getHostname(conn); if (!ret) goto error; return ret; @@ -1705,7 +1705,7 @@ error: * NULL if there was an error. */ char * -virConnectGetURI (virConnectPtr conn) +virConnectGetURI(virConnectPtr conn) { char *name; VIR_DEBUG("conn=%p", conn); @@ -1742,7 +1742,7 @@ error: * NULL if there was an error. */ char * -virConnectGetSysinfo (virConnectPtr conn, unsigned int flags) +virConnectGetSysinfo(virConnectPtr conn, unsigned int flags) { VIR_DEBUG("conn=%p, flags=%x", conn, flags); @@ -1755,7 +1755,7 @@ virConnectGetSysinfo (virConnectPtr conn, unsigned int flags) } if (conn->driver->getSysinfo) { - char *ret = conn->driver->getSysinfo (conn, flags); + char *ret = conn->driver->getSysinfo(conn, flags); if (!ret) goto error; return ret; @@ -1794,7 +1794,7 @@ virConnectGetMaxVcpus(virConnectPtr conn, } if (conn->driver->getMaxVcpus) { - int ret = conn->driver->getMaxVcpus (conn, type); + int ret = conn->driver->getMaxVcpus(conn, type); if (ret < 0) goto error; return ret; @@ -1840,7 +1840,7 @@ virConnectListDomains(virConnectPtr conn, int *ids, int maxids) virCheckNonNegativeArgGoto(maxids, error); if (conn->driver->listDomains) { - int ret = conn->driver->listDomains (conn, ids, maxids); + int ret = conn->driver->listDomains(conn, ids, maxids); if (ret < 0) goto error; return ret; @@ -1874,7 +1874,7 @@ virConnectNumOfDomains(virConnectPtr conn) } if (conn->driver->numOfDomains) { - int ret = conn->driver->numOfDomains (conn); + int ret = conn->driver->numOfDomains(conn); if (ret < 0) goto error; return ret; @@ -1901,13 +1901,13 @@ error: * Returns the virConnectPtr or NULL in case of failure. */ virConnectPtr -virDomainGetConnect (virDomainPtr dom) +virDomainGetConnect(virDomainPtr dom) { VIR_DOMAIN_DEBUG(dom); virResetLastError(); - if (!VIR_IS_CONNECTED_DOMAIN (dom)) { + if (!VIR_IS_CONNECTED_DOMAIN(dom)) { virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__); virDispatchError(NULL); return NULL; @@ -1962,7 +1962,7 @@ virDomainCreateXML(virConnectPtr conn, const char *xmlDesc, if (conn->driver->domainCreateXML) { virDomainPtr ret; - ret = conn->driver->domainCreateXML (conn, xmlDesc, flags); + ret = conn->driver->domainCreateXML(conn, xmlDesc, flags); if (!ret) goto error; return ret; @@ -2021,7 +2021,7 @@ virDomainLookupByID(virConnectPtr conn, int id) if (conn->driver->domainLookupByID) { virDomainPtr ret; - ret = conn->driver->domainLookupByID (conn, id); + ret = conn->driver->domainLookupByID(conn, id); if (!ret) goto error; return ret; @@ -2060,7 +2060,7 @@ virDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid) if (conn->driver->domainLookupByUUID) { virDomainPtr ret; - ret = conn->driver->domainLookupByUUID (conn, uuid); + ret = conn->driver->domainLookupByUUID(conn, uuid); if (!ret) goto error; return ret; @@ -2138,7 +2138,7 @@ virDomainLookupByName(virConnectPtr conn, const char *name) if (conn->driver->domainLookupByName) { virDomainPtr dom; - dom = conn->driver->domainLookupByName (conn, name); + dom = conn->driver->domainLookupByName(conn, name); if (!dom) goto error; return dom; @@ -2198,7 +2198,7 @@ virDomainDestroy(virDomainPtr domain) if (conn->driver->domainDestroy) { int ret; - ret = conn->driver->domainDestroy (domain); + ret = conn->driver->domainDestroy(domain); if (ret < 0) goto error; return ret; @@ -2371,7 +2371,7 @@ virDomainSuspend(virDomainPtr domain) if (conn->driver->domainSuspend) { int ret; - ret = conn->driver->domainSuspend (domain); + ret = conn->driver->domainSuspend(domain); if (ret < 0) goto error; return ret; @@ -2419,7 +2419,7 @@ virDomainResume(virDomainPtr domain) if (conn->driver->domainResume) { int ret; - ret = conn->driver->domainResume (domain); + ret = conn->driver->domainResume(domain); if (ret < 0) goto error; return ret; @@ -3187,7 +3187,7 @@ virDomainShutdown(virDomainPtr domain) if (conn->driver->domainShutdown) { int ret; - ret = conn->driver->domainShutdown (domain); + ret = conn->driver->domainShutdown(domain); if (ret < 0) goto error; return ret; @@ -3316,7 +3316,7 @@ virDomainReboot(virDomainPtr domain, unsigned int flags) if (conn->driver->domainReboot) { int ret; - ret = conn->driver->domainReboot (domain, flags); + ret = conn->driver->domainReboot(domain, flags); if (ret < 0) goto error; return ret; @@ -3366,7 +3366,7 @@ virDomainReset(virDomainPtr domain, unsigned int flags) if (conn->driver->domainReset) { int ret; - ret = conn->driver->domainReset (domain, flags); + ret = conn->driver->domainReset(domain, flags); if (ret < 0) goto error; return ret; @@ -3519,7 +3519,7 @@ virDomainGetOSType(virDomainPtr domain) if (conn->driver->domainGetOSType) { char *ret; - ret = conn->driver->domainGetOSType (domain); + ret = conn->driver->domainGetOSType(domain); if (!ret) goto error; return ret; @@ -3562,7 +3562,7 @@ virDomainGetMaxMemory(virDomainPtr domain) if (conn->driver->domainGetMaxMemory) { unsigned long long ret; - ret = conn->driver->domainGetMaxMemory (domain); + ret = conn->driver->domainGetMaxMemory(domain); if (ret == 0) goto error; if ((unsigned long) ret != ret) { @@ -3620,7 +3620,7 @@ virDomainSetMaxMemory(virDomainPtr domain, unsigned long memory) if (conn->driver->domainSetMaxMemory) { int ret; - ret = conn->driver->domainSetMaxMemory (domain, memory); + ret = conn->driver->domainSetMaxMemory(domain, memory); if (ret < 0) goto error; return ret; @@ -3672,7 +3672,7 @@ virDomainSetMemory(virDomainPtr domain, unsigned long memory) if (conn->driver->domainSetMemory) { int ret; - ret = conn->driver->domainSetMemory (domain, memory); + ret = conn->driver->domainSetMemory(domain, memory); if (ret < 0) goto error; return ret; @@ -3835,7 +3835,7 @@ virDomainSetMemoryParameters(virDomainPtr domain, if (conn->driver->domainSetMemoryParameters) { int ret; - ret = conn->driver->domainSetMemoryParameters (domain, params, nparams, flags); + ret = conn->driver->domainSetMemoryParameters(domain, params, nparams, flags); if (ret < 0) goto error; return ret; @@ -3921,7 +3921,7 @@ virDomainGetMemoryParameters(virDomainPtr domain, if (conn->driver->domainGetMemoryParameters) { int ret; - ret = conn->driver->domainGetMemoryParameters (domain, params, nparams, flags); + ret = conn->driver->domainGetMemoryParameters(domain, params, nparams, flags); if (ret < 0) goto error; return ret; @@ -4104,7 +4104,7 @@ virDomainSetBlkioParameters(virDomainPtr domain, if (conn->driver->domainSetBlkioParameters) { int ret; - ret = conn->driver->domainSetBlkioParameters (domain, params, nparams, flags); + ret = conn->driver->domainSetBlkioParameters(domain, params, nparams, flags); if (ret < 0) goto error; return ret; @@ -4181,12 +4181,12 @@ virDomainGetBlkioParameters(virDomainPtr domain, if (conn->driver->domainGetBlkioParameters) { int ret; - ret = conn->driver->domainGetBlkioParameters (domain, params, nparams, flags); + ret = conn->driver->domainGetBlkioParameters(domain, params, nparams, flags); if (ret < 0) goto error; return ret; } - virLibConnError (VIR_ERR_NO_SUPPORT, __FUNCTION__); + virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__); error: virDispatchError(domain->conn); @@ -4226,7 +4226,7 @@ virDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info) if (conn->driver->domainGetInfo) { int ret; - ret = conn->driver->domainGetInfo (domain, info); + ret = conn->driver->domainGetInfo(domain, info); if (ret < 0) goto error; return ret; @@ -4427,10 +4427,10 @@ char *virConnectDomainXMLFromNative(virConnectPtr conn, if (conn->driver->domainXMLFromNative) { char *ret; - ret = conn->driver->domainXMLFromNative (conn, - nativeFormat, - nativeConfig, - flags); + ret = conn->driver->domainXMLFromNative(conn, + nativeFormat, + nativeConfig, + flags); if (!ret) goto error; return ret; @@ -4516,12 +4516,12 @@ error: * */ static virDomainPtr -virDomainMigrateVersion1 (virDomainPtr domain, - virConnectPtr dconn, - unsigned long flags, - const char *dname, - const char *uri, - unsigned long bandwidth) +virDomainMigrateVersion1(virDomainPtr domain, + virConnectPtr dconn, + unsigned long flags, + const char *dname, + const char *uri, + unsigned long bandwidth) { virDomainPtr ddomain = NULL; char *uri_out = NULL; @@ -4532,7 +4532,7 @@ virDomainMigrateVersion1 (virDomainPtr domain, "dconn=%p, flags=%lx, dname=%s, uri=%s, bandwidth=%lu", dconn, flags, NULLSTR(dname), NULLSTR(uri), bandwidth); - ret = virDomainGetInfo (domain, &info); + ret = virDomainGetInfo(domain, &info); if (ret == 0 && info.state == VIR_DOMAIN_PAUSED) { flags |= VIR_MIGRATE_PAUSED; } @@ -4578,11 +4578,11 @@ virDomainMigrateVersion1 (virDomainPtr domain, ddomain = dconn->driver->domainMigrateFinish (dconn, dname, cookie, cookielen, uri, flags); else - ddomain = virDomainLookupByName (dconn, dname); + ddomain = virDomainLookupByName(dconn, dname); done: - VIR_FREE (uri_out); - VIR_FREE (cookie); + VIR_FREE(uri_out); + VIR_FREE(cookie); return ddomain; } @@ -4606,12 +4606,12 @@ virDomainMigrateVersion1 (virDomainPtr domain, * */ static virDomainPtr -virDomainMigrateVersion2 (virDomainPtr domain, - virConnectPtr dconn, - unsigned long flags, - const char *dname, - const char *uri, - unsigned long bandwidth) +virDomainMigrateVersion2(virDomainPtr domain, + virConnectPtr dconn, + unsigned long flags, + const char *dname, + const char *uri, + unsigned long bandwidth) { virDomainPtr ddomain = NULL; char *uri_out = NULL; @@ -4652,7 +4652,7 @@ virDomainMigrateVersion2 (virDomainPtr domain, if (!dom_xml) return NULL; - ret = virDomainGetInfo (domain, &info); + ret = virDomainGetInfo(domain, &info); if (ret == 0 && info.state == VIR_DOMAIN_PAUSED) { flags |= VIR_MIGRATE_PAUSED; } @@ -4661,7 +4661,7 @@ virDomainMigrateVersion2 (virDomainPtr domain, ret = dconn->driver->domainMigratePrepare2 (dconn, &cookie, &cookielen, uri, &uri_out, flags, dname, bandwidth, dom_xml); - VIR_FREE (dom_xml); + VIR_FREE(dom_xml); if (ret == -1) goto done; @@ -4706,8 +4706,8 @@ finish: virSetError(orig_err); virFreeError(orig_err); } - VIR_FREE (uri_out); - VIR_FREE (cookie); + VIR_FREE(uri_out); + VIR_FREE(cookie); return ddomain; } @@ -4785,7 +4785,7 @@ virDomainMigrateVersion3(virDomainPtr domain, if (!dom_xml) goto done; - ret = virDomainGetInfo (domain, &info); + ret = virDomainGetInfo(domain, &info); if (ret == 0 && info.state == VIR_DOMAIN_PAUSED) { flags |= VIR_MIGRATE_PAUSED; } @@ -4798,7 +4798,7 @@ virDomainMigrateVersion3(virDomainPtr domain, ret = dconn->driver->domainMigratePrepare3 (dconn, cookiein, cookieinlen, &cookieout, &cookieoutlen, uri, &uri_out, flags, dname, bandwidth, dom_xml); - VIR_FREE (dom_xml); + VIR_FREE(dom_xml); if (ret == -1) { if (protection) { /* Begin already started a migration job so we need to cancel it by @@ -4933,13 +4933,13 @@ confirm: * migration itself. */ static int -virDomainMigratePeer2Peer (virDomainPtr domain, - const char *xmlin, - unsigned long flags, - const char *dname, - const char *dconnuri, - const char *uri, - unsigned long bandwidth) +virDomainMigratePeer2Peer(virDomainPtr domain, + const char *xmlin, + unsigned long flags, + const char *dname, + const char *dconnuri, + const char *uri, + unsigned long bandwidth) { virURIPtr tempuri = NULL; VIR_DOMAIN_DEBUG(domain, "xmlin=%s, flags=%lx, dname=%s, " @@ -5028,12 +5028,12 @@ virDomainMigratePeer2Peer (virDomainPtr domain, * need to be involved at all, or even running */ static int -virDomainMigrateDirect (virDomainPtr domain, - const char *xmlin, - unsigned long flags, - const char *dname, - const char *uri, - unsigned long bandwidth) +virDomainMigrateDirect(virDomainPtr domain, + const char *xmlin, + unsigned long flags, + const char *dname, + const char *uri, + unsigned long bandwidth) { VIR_DOMAIN_DEBUG(domain, "xmlin=%s, flags=%lx, dname=%s, uri=%s, bandwidth=%lu", @@ -5153,12 +5153,12 @@ virDomainMigrateDirect (virDomainPtr domain, * exists in the scope of the destination connection (dconn). */ virDomainPtr -virDomainMigrate (virDomainPtr domain, - virConnectPtr dconn, - unsigned long flags, - const char *dname, - const char *uri, - unsigned long bandwidth) +virDomainMigrate(virDomainPtr domain, + virConnectPtr dconn, + unsigned long flags, + const char *dname, + const char *uri, + unsigned long bandwidth) { virDomainPtr ddomain = NULL; @@ -5169,7 +5169,7 @@ virDomainMigrate (virDomainPtr domain, virResetLastError(); /* First checkout the source */ - if (!VIR_IS_CONNECTED_DOMAIN (domain)) { + if (!VIR_IS_CONNECTED_DOMAIN(domain)) { virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__); virDispatchError(NULL); return NULL; @@ -5191,8 +5191,8 @@ virDomainMigrate (virDomainPtr domain, } if (flags & VIR_MIGRATE_PEER2PEER) { - if (VIR_DRV_SUPPORTS_FEATURE (domain->conn->driver, domain->conn, - VIR_DRV_FEATURE_MIGRATION_P2P)) { + if (VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn, + VIR_DRV_FEATURE_MIGRATION_P2P)) { char *dstURI = NULL; if (uri == NULL) { dstURI = virConnectGetURI(dconn); @@ -5208,7 +5208,7 @@ virDomainMigrate (virDomainPtr domain, } VIR_FREE(dstURI); - ddomain = virDomainLookupByName (dconn, dname ? dname : domain->name); + ddomain = virDomainLookupByName(dconn, dname ? dname : domain->name); } else { /* This driver does not support peer to peer migration */ virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__); @@ -5374,7 +5374,7 @@ virDomainMigrate2(virDomainPtr domain, virResetLastError(); /* First checkout the source */ - if (!VIR_IS_CONNECTED_DOMAIN (domain)) { + if (!VIR_IS_CONNECTED_DOMAIN(domain)) { virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__); virDispatchError(NULL); return NULL; @@ -5396,8 +5396,8 @@ virDomainMigrate2(virDomainPtr domain, } if (flags & VIR_MIGRATE_PEER2PEER) { - if (VIR_DRV_SUPPORTS_FEATURE (domain->conn->driver, domain->conn, - VIR_DRV_FEATURE_MIGRATION_P2P)) { + if (VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn, + VIR_DRV_FEATURE_MIGRATION_P2P)) { char *dstURI = virConnectGetURI(dconn); if (!dstURI) return NULL; @@ -5410,7 +5410,7 @@ virDomainMigrate2(virDomainPtr domain, } VIR_FREE(dstURI); - ddomain = virDomainLookupByName (dconn, dname ? dname : domain->name); + ddomain = virDomainLookupByName(dconn, dname ? dname : domain->name); } else { /* This driver does not support peer to peer migration */ virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__); @@ -5548,11 +5548,11 @@ error: * Returns 0 if the migration succeeded, -1 upon error. */ int -virDomainMigrateToURI (virDomainPtr domain, - const char *duri, - unsigned long flags, - const char *dname, - unsigned long bandwidth) +virDomainMigrateToURI(virDomainPtr domain, + const char *duri, + unsigned long flags, + const char *dname, + unsigned long bandwidth) { VIR_DOMAIN_DEBUG(domain, "duri=%p, flags=%lx, dname=%s, bandwidth=%lu", NULLSTR(duri), flags, NULLSTR(dname), bandwidth); @@ -5560,7 +5560,7 @@ virDomainMigrateToURI (virDomainPtr domain, virResetLastError(); /* First checkout the source */ - if (!VIR_IS_CONNECTED_DOMAIN (domain)) { + if (!VIR_IS_CONNECTED_DOMAIN(domain)) { virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__); virDispatchError(NULL); return -1; @@ -5573,8 +5573,8 @@ virDomainMigrateToURI (virDomainPtr domain, virCheckNonNullArgGoto(duri, error); if (flags & VIR_MIGRATE_PEER2PEER) { - if (VIR_DRV_SUPPORTS_FEATURE (domain->conn->driver, domain->conn, - VIR_DRV_FEATURE_MIGRATION_P2P)) { + if (VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn, + VIR_DRV_FEATURE_MIGRATION_P2P)) { VIR_DEBUG("Using peer2peer migration"); if (virDomainMigratePeer2Peer(domain, NULL, flags, dname, duri, NULL, bandwidth) < 0) @@ -5585,8 +5585,8 @@ virDomainMigrateToURI (virDomainPtr domain, goto error; } } else { - if (VIR_DRV_SUPPORTS_FEATURE (domain->conn->driver, domain->conn, - VIR_DRV_FEATURE_MIGRATION_DIRECT)) { + if (VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn, + VIR_DRV_FEATURE_MIGRATION_DIRECT)) { VIR_DEBUG("Using direct migration"); if (virDomainMigrateDirect(domain, NULL, flags, dname, duri, bandwidth) < 0) @@ -5698,7 +5698,7 @@ virDomainMigrateToURI2(virDomainPtr domain, virResetLastError(); /* First checkout the source */ - if (!VIR_IS_CONNECTED_DOMAIN (domain)) { + if (!VIR_IS_CONNECTED_DOMAIN(domain)) { virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__); virDispatchError(NULL); return -1; @@ -5709,8 +5709,8 @@ virDomainMigrateToURI2(virDomainPtr domain, } if (flags & VIR_MIGRATE_PEER2PEER) { - if (VIR_DRV_SUPPORTS_FEATURE (domain->conn->driver, domain->conn, - VIR_DRV_FEATURE_MIGRATION_P2P)) { + if (VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn, + VIR_DRV_FEATURE_MIGRATION_P2P)) { VIR_DEBUG("Using peer2peer migration"); if (virDomainMigratePeer2Peer(domain, dxml, flags, dname, dconnuri, miguri, bandwidth) < 0) @@ -5721,8 +5721,8 @@ virDomainMigrateToURI2(virDomainPtr domain, goto error; } } else { - if (VIR_DRV_SUPPORTS_FEATURE (domain->conn->driver, domain->conn, - VIR_DRV_FEATURE_MIGRATION_DIRECT)) { + if (VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn, + VIR_DRV_FEATURE_MIGRATION_DIRECT)) { VIR_DEBUG("Using direct migration"); if (virDomainMigrateDirect(domain, dxml, flags, dname, miguri, bandwidth) < 0) @@ -5749,14 +5749,14 @@ error: * implementation of migration in the remote case. */ int -virDomainMigratePrepare (virConnectPtr dconn, - char **cookie, - int *cookielen, - const char *uri_in, - char **uri_out, - unsigned long flags, - const char *dname, - unsigned long bandwidth) +virDomainMigratePrepare(virConnectPtr dconn, + char **cookie, + int *cookielen, + const char *uri_in, + char **uri_out, + unsigned long flags, + const char *dname, + unsigned long bandwidth) { VIR_DEBUG("dconn=%p, cookie=%p, cookielen=%p, uri_in=%s, uri_out=%p, " "flags=%lx, dname=%s, bandwidth=%lu", dconn, cookie, cookielen, @@ -5764,7 +5764,7 @@ virDomainMigratePrepare (virConnectPtr dconn, virResetLastError(); - if (!VIR_IS_CONNECT (dconn)) { + if (!VIR_IS_CONNECT(dconn)) { virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__); virDispatchError(NULL); return -1; @@ -5777,9 +5777,9 @@ virDomainMigratePrepare (virConnectPtr dconn, if (dconn->driver->domainMigratePrepare) { int ret; - ret = dconn->driver->domainMigratePrepare (dconn, cookie, cookielen, - uri_in, uri_out, - flags, dname, bandwidth); + ret = dconn->driver->domainMigratePrepare(dconn, cookie, cookielen, + uri_in, uri_out, + flags, dname, bandwidth); if (ret < 0) goto error; return ret; @@ -5797,13 +5797,13 @@ error: * implementation of migration in the remote case. */ int -virDomainMigratePerform (virDomainPtr domain, - const char *cookie, - int cookielen, - const char *uri, - unsigned long flags, - const char *dname, - unsigned long bandwidth) +virDomainMigratePerform(virDomainPtr domain, + const char *cookie, + int cookielen, + const char *uri, + unsigned long flags, + const char *dname, + unsigned long bandwidth) { virConnectPtr conn; @@ -5813,7 +5813,7 @@ virDomainMigratePerform (virDomainPtr domain, virResetLastError(); - if (!VIR_IS_CONNECTED_DOMAIN (domain)) { + if (!VIR_IS_CONNECTED_DOMAIN(domain)) { virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__); virDispatchError(NULL); return -1; @@ -5827,9 +5827,9 @@ virDomainMigratePerform (virDomainPtr domain, if (conn->driver->domainMigratePerform) { int ret; - ret = conn->driver->domainMigratePerform (domain, cookie, cookielen, - uri, - flags, dname, bandwidth); + ret = conn->driver->domainMigratePerform(domain, cookie, cookielen, + uri, + flags, dname, bandwidth); if (ret < 0) goto error; return ret; @@ -5847,12 +5847,12 @@ error: * implementation of migration in the remote case. */ virDomainPtr -virDomainMigrateFinish (virConnectPtr dconn, - const char *dname, - const char *cookie, - int cookielen, - const char *uri, - unsigned long flags) +virDomainMigrateFinish(virConnectPtr dconn, + const char *dname, + const char *cookie, + int cookielen, + const char *uri, + unsigned long flags) { VIR_DEBUG("dconn=%p, dname=%s, cookie=%p, cookielen=%d, uri=%s, " "flags=%lx", dconn, NULLSTR(dname), cookie, cookielen, @@ -5860,7 +5860,7 @@ virDomainMigrateFinish (virConnectPtr dconn, virResetLastError(); - if (!VIR_IS_CONNECT (dconn)) { + if (!VIR_IS_CONNECT(dconn)) { virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__); virDispatchError(NULL); return NULL; @@ -5873,9 +5873,9 @@ virDomainMigrateFinish (virConnectPtr dconn, if (dconn->driver->domainMigrateFinish) { virDomainPtr ret; - ret = dconn->driver->domainMigrateFinish (dconn, dname, - cookie, cookielen, - uri, flags); + ret = dconn->driver->domainMigrateFinish(dconn, dname, + cookie, cookielen, + uri, flags); if (!ret) goto error; return ret; @@ -5894,15 +5894,15 @@ error: * implementation of migration in the remote case. */ int -virDomainMigratePrepare2 (virConnectPtr dconn, - char **cookie, - int *cookielen, - const char *uri_in, - char **uri_out, - unsigned long flags, - const char *dname, - unsigned long bandwidth, - const char *dom_xml) +virDomainMigratePrepare2(virConnectPtr dconn, + char **cookie, + int *cookielen, + const char *uri_in, + char **uri_out, + unsigned long flags, + const char *dname, + unsigned long bandwidth, + const char *dom_xml) { VIR_DEBUG("dconn=%p, cookie=%p, cookielen=%p, uri_in=%s, uri_out=%p," "flags=%lx, dname=%s, bandwidth=%lu, dom_xml=%s", dconn, @@ -5911,7 +5911,7 @@ virDomainMigratePrepare2 (virConnectPtr dconn, virResetLastError(); - if (!VIR_IS_CONNECT (dconn)) { + if (!VIR_IS_CONNECT(dconn)) { virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__); virDispatchError(NULL); return -1; @@ -5924,10 +5924,10 @@ virDomainMigratePrepare2 (virConnectPtr dconn, if (dconn->driver->domainMigratePrepare2) { int ret; - ret = dconn->driver->domainMigratePrepare2 (dconn, cookie, cookielen, - uri_in, uri_out, - flags, dname, bandwidth, - dom_xml); + ret = dconn->driver->domainMigratePrepare2(dconn, cookie, cookielen, + uri_in, uri_out, + flags, dname, bandwidth, + dom_xml); if (ret < 0) goto error; return ret; @@ -5945,13 +5945,13 @@ error: * implementation of migration in the remote case. */ virDomainPtr -virDomainMigrateFinish2 (virConnectPtr dconn, - const char *dname, - const char *cookie, - int cookielen, - const char *uri, - unsigned long flags, - int retcode) +virDomainMigrateFinish2(virConnectPtr dconn, + const char *dname, + const char *cookie, + int cookielen, + const char *uri, + unsigned long flags, + int retcode) { VIR_DEBUG("dconn=%p, dname=%s, cookie=%p, cookielen=%d, uri=%s, " "flags=%lx, retcode=%d", dconn, NULLSTR(dname), cookie, @@ -5959,7 +5959,7 @@ virDomainMigrateFinish2 (virConnectPtr dconn, virResetLastError(); - if (!VIR_IS_CONNECT (dconn)) { + if (!VIR_IS_CONNECT(dconn)) { virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__); virDispatchError(NULL); return NULL; @@ -5972,10 +5972,10 @@ virDomainMigrateFinish2 (virConnectPtr dconn, if (dconn->driver->domainMigrateFinish2) { virDomainPtr ret; - ret = dconn->driver->domainMigrateFinish2 (dconn, dname, - cookie, cookielen, - uri, flags, - retcode); + ret = dconn->driver->domainMigrateFinish2(dconn, dname, + cookie, cookielen, + uri, flags, + retcode); if (!ret) goto error; return ret; @@ -6063,7 +6063,7 @@ virDomainMigrateBegin3(virDomainPtr domain, virResetLastError(); - if (!VIR_IS_CONNECTED_DOMAIN (domain)) { + if (!VIR_IS_CONNECTED_DOMAIN(domain)) { virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__); virDispatchError(NULL); return NULL; @@ -6119,7 +6119,7 @@ virDomainMigratePrepare3(virConnectPtr dconn, virResetLastError(); - if (!VIR_IS_CONNECT (dconn)) { + if (!VIR_IS_CONNECT(dconn)) { virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__); virDispatchError(NULL); return -1; @@ -6240,7 +6240,7 @@ virDomainMigratePerform3(virDomainPtr domain, virResetLastError(); - if (!VIR_IS_CONNECTED_DOMAIN (domain)) { + if (!VIR_IS_CONNECTED_DOMAIN(domain)) { virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__); virDispatchError(NULL); return -1; @@ -6295,7 +6295,7 @@ virDomainMigrateFinish3(virConnectPtr dconn, virResetLastError(); - if (!VIR_IS_CONNECT (dconn)) { + if (!VIR_IS_CONNECT(dconn)) { virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__); virDispatchError(NULL); return NULL; @@ -6345,7 +6345,7 @@ virDomainMigrateConfirm3(virDomainPtr domain, virResetLastError(); - if (!VIR_IS_CONNECTED_DOMAIN (domain)) { + if (!VIR_IS_CONNECTED_DOMAIN(domain)) { virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__); virDispatchError(NULL); return -1; @@ -6400,7 +6400,7 @@ virNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info) if (conn->driver->nodeGetInfo) { int ret; - ret = conn->driver->nodeGetInfo (conn, info); + ret = conn->driver->nodeGetInfo(conn, info); if (ret < 0) goto error; return ret; @@ -6424,13 +6424,13 @@ error: * The client must free the returned string after use. */ char * -virConnectGetCapabilities (virConnectPtr conn) +virConnectGetCapabilities(virConnectPtr conn) { VIR_DEBUG("conn=%p", conn); virResetLastError(); - if (!VIR_IS_CONNECT (conn)) { + if (!VIR_IS_CONNECT(conn)) { virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__); virDispatchError(NULL); return NULL; @@ -6438,7 +6438,7 @@ virConnectGetCapabilities (virConnectPtr conn) if (conn->driver->getCapabilities) { char *ret; - ret = conn->driver->getCapabilities (conn); + ret = conn->driver->getCapabilities(conn); if (!ret) goto error; VIR_DEBUG("conn=%p ret=%s", conn, ret); @@ -6506,10 +6506,10 @@ error: * * Returns -1 in case of error, 0 in case of success. */ -int virNodeGetCPUStats (virConnectPtr conn, - int cpuNum, - virNodeCPUStatsPtr params, - int *nparams, unsigned int flags) +int virNodeGetCPUStats(virConnectPtr conn, + int cpuNum, + virNodeCPUStatsPtr params, + int *nparams, unsigned int flags) { VIR_DEBUG("conn=%p, cpuNum=%d, params=%p, nparams=%d, flags=%x", conn, cpuNum, params, nparams ? *nparams : -1, flags); @@ -6533,7 +6533,7 @@ int virNodeGetCPUStats (virConnectPtr conn, if (conn->driver->nodeGetCPUStats) { int ret; - ret = conn->driver->nodeGetCPUStats (conn, cpuNum, params, nparams, flags); + ret = conn->driver->nodeGetCPUStats(conn, cpuNum, params, nparams, flags); if (ret < 0) goto error; return ret; @@ -6595,10 +6595,10 @@ error: * * Returns -1 in case of error, 0 in case of success. */ -int virNodeGetMemoryStats (virConnectPtr conn, - int cellNum, - virNodeMemoryStatsPtr params, - int *nparams, unsigned int flags) +int virNodeGetMemoryStats(virConnectPtr conn, + int cellNum, + virNodeMemoryStatsPtr params, + int *nparams, unsigned int flags) { VIR_DEBUG("conn=%p, cellNum=%d, params=%p, nparams=%d, flags=%x", conn, cellNum, params, nparams ? *nparams : -1, flags); @@ -6622,7 +6622,7 @@ int virNodeGetMemoryStats (virConnectPtr conn, if (conn->driver->nodeGetMemoryStats) { int ret; - ret = conn->driver->nodeGetMemoryStats (conn, cellNum, params, nparams, flags); + ret = conn->driver->nodeGetMemoryStats(conn, cellNum, params, nparams, flags); if (ret < 0) goto error; return ret; @@ -6651,7 +6651,7 @@ virNodeGetFreeMemory(virConnectPtr conn) virResetLastError(); - if (!VIR_IS_CONNECT (conn)) { + if (!VIR_IS_CONNECT(conn)) { virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__); virDispatchError(NULL); return 0; @@ -6659,7 +6659,7 @@ virNodeGetFreeMemory(virConnectPtr conn) if (conn->driver->nodeGetFreeMemory) { unsigned long long ret; - ret = conn->driver->nodeGetFreeMemory (conn); + ret = conn->driver->nodeGetFreeMemory(conn); if (ret == 0) goto error; return ret; @@ -6887,7 +6887,7 @@ virDomainGetSchedulerType(virDomainPtr domain, int *nparams) conn = domain->conn; if (conn->driver->domainGetSchedulerType){ - schedtype = conn->driver->domainGetSchedulerType (domain, nparams); + schedtype = conn->driver->domainGetSchedulerType(domain, nparams); if (!schedtype) goto error; return schedtype; @@ -6945,7 +6945,7 @@ virDomainGetSchedulerParameters(virDomainPtr domain, if (conn->driver->domainGetSchedulerParameters) { int ret; - ret = conn->driver->domainGetSchedulerParameters (domain, params, nparams); + ret = conn->driver->domainGetSchedulerParameters(domain, params, nparams); if (ret < 0) goto error; return ret; @@ -7027,8 +7027,8 @@ virDomainGetSchedulerParametersFlags(virDomainPtr domain, if (conn->driver->domainGetSchedulerParametersFlags) { int ret; - ret = conn->driver->domainGetSchedulerParametersFlags (domain, params, - nparams, flags); + ret = conn->driver->domainGetSchedulerParametersFlags(domain, params, + nparams, flags); if (ret < 0) goto error; return ret; @@ -7086,7 +7086,7 @@ virDomainSetSchedulerParameters(virDomainPtr domain, if (conn->driver->domainSetSchedulerParameters) { int ret; - ret = conn->driver->domainSetSchedulerParameters (domain, params, nparams); + ret = conn->driver->domainSetSchedulerParameters(domain, params, nparams); if (ret < 0) goto error; return ret; @@ -7204,7 +7204,7 @@ virDomainBlockStats(virDomainPtr dom, const char *disk, virResetLastError(); - if (!VIR_IS_CONNECTED_DOMAIN (dom)) { + if (!VIR_IS_CONNECTED_DOMAIN(dom)) { virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__); virDispatchError(NULL); return -1; @@ -7220,10 +7220,10 @@ virDomainBlockStats(virDomainPtr dom, const char *disk, conn = dom->conn; if (conn->driver->domainBlockStats) { - if (conn->driver->domainBlockStats (dom, disk, &stats2) == -1) + if (conn->driver->domainBlockStats(dom, disk, &stats2) == -1) goto error; - memcpy (stats, &stats2, size); + memcpy(stats, &stats2, size); return 0; } @@ -7284,7 +7284,7 @@ int virDomainBlockStatsFlags(virDomainPtr dom, virResetLastError(); - if (!VIR_IS_CONNECTED_DOMAIN (dom)) { + if (!VIR_IS_CONNECTED_DOMAIN(dom)) { virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__); virDispatchError(NULL); return -1; @@ -7337,8 +7337,8 @@ error: * Returns: 0 in case of success or -1 in case of failure. */ int -virDomainInterfaceStats (virDomainPtr dom, const char *path, - virDomainInterfaceStatsPtr stats, size_t size) +virDomainInterfaceStats(virDomainPtr dom, const char *path, + virDomainInterfaceStatsPtr stats, size_t size) { virConnectPtr conn; struct _virDomainInterfaceStats stats2 = { -1, -1, -1, -1, @@ -7349,7 +7349,7 @@ virDomainInterfaceStats (virDomainPtr dom, const char *path, virResetLastError(); - if (!VIR_IS_CONNECTED_DOMAIN (dom)) { + if (!VIR_IS_CONNECTED_DOMAIN(dom)) { virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__); virDispatchError(NULL); return -1; @@ -7366,10 +7366,10 @@ virDomainInterfaceStats (virDomainPtr dom, const char *path, conn = dom->conn; if (conn->driver->domainInterfaceStats) { - if (conn->driver->domainInterfaceStats (dom, path, &stats2) == -1) + if (conn->driver->domainInterfaceStats(dom, path, &stats2) == -1) goto error; - memcpy (stats, &stats2, size); + memcpy(stats, &stats2, size); return 0; } @@ -7550,8 +7550,8 @@ error: * * Returns: The number of stats provided or -1 in case of failure. */ -int virDomainMemoryStats (virDomainPtr dom, virDomainMemoryStatPtr stats, - unsigned int nr_stats, unsigned int flags) +int virDomainMemoryStats(virDomainPtr dom, virDomainMemoryStatPtr stats, + unsigned int nr_stats, unsigned int flags) { virConnectPtr conn; unsigned long nr_stats_ret = 0; @@ -7561,7 +7561,7 @@ int virDomainMemoryStats (virDomainPtr dom, virDomainMemoryStatPtr stats, virResetLastError(); - if (!VIR_IS_CONNECTED_DOMAIN (dom)) { + if (!VIR_IS_CONNECTED_DOMAIN(dom)) { virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__); virDispatchError(NULL); return -1; @@ -7575,8 +7575,8 @@ int virDomainMemoryStats (virDomainPtr dom, virDomainMemoryStatPtr stats, conn = dom->conn; if (conn->driver->domainMemoryStats) { - nr_stats_ret = conn->driver->domainMemoryStats (dom, stats, nr_stats, - flags); + nr_stats_ret = conn->driver->domainMemoryStats(dom, stats, nr_stats, + flags); if (nr_stats_ret == -1) goto error; return nr_stats_ret; @@ -7632,12 +7632,12 @@ error: * Returns: 0 in case of success or -1 in case of failure. */ int -virDomainBlockPeek (virDomainPtr dom, - const char *disk, - unsigned long long offset /* really 64 bits */, - size_t size, - void *buffer, - unsigned int flags) +virDomainBlockPeek(virDomainPtr dom, + const char *disk, + unsigned long long offset /* really 64 bits */, + size_t size, + void *buffer, + unsigned int flags) { virConnectPtr conn; @@ -7646,7 +7646,7 @@ virDomainBlockPeek (virDomainPtr dom, virResetLastError(); - if (!VIR_IS_CONNECTED_DOMAIN (dom)) { + if (!VIR_IS_CONNECTED_DOMAIN(dom)) { virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__); virDispatchError(NULL); return -1; @@ -7709,10 +7709,10 @@ error: */ int -virDomainBlockResize (virDomainPtr dom, - const char *disk, - unsigned long long size, - unsigned int flags) +virDomainBlockResize(virDomainPtr dom, + const char *disk, + unsigned long long size, + unsigned int flags) { virConnectPtr conn; @@ -7720,7 +7720,7 @@ virDomainBlockResize (virDomainPtr dom, virResetLastError(); - if (!VIR_IS_CONNECTED_DOMAIN (dom)) { + if (!VIR_IS_CONNECTED_DOMAIN(dom)) { virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__); virDispatchError(NULL); return -1; @@ -7782,11 +7782,11 @@ error: * Returns: 0 in case of success or -1 in case of failure. */ int -virDomainMemoryPeek (virDomainPtr dom, - unsigned long long start /* really 64 bits */, - size_t size, - void *buffer, - unsigned int flags) +virDomainMemoryPeek(virDomainPtr dom, + unsigned long long start /* really 64 bits */, + size_t size, + void *buffer, + unsigned int flags) { virConnectPtr conn; @@ -7795,7 +7795,7 @@ virDomainMemoryPeek (virDomainPtr dom, virResetLastError(); - if (!VIR_IS_CONNECTED_DOMAIN (dom)) { + if (!VIR_IS_CONNECTED_DOMAIN(dom)) { virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__); virDispatchError(NULL); return -1; @@ -7844,8 +7844,8 @@ virDomainMemoryPeek (virDomainPtr dom, if (conn->driver->domainMemoryPeek) { int ret; - ret = conn->driver->domainMemoryPeek (dom, start, size, - buffer, flags); + ret = conn->driver->domainMemoryPeek(dom, start, size, + buffer, flags); if (ret < 0) goto error; return ret; @@ -7901,7 +7901,7 @@ virDomainGetBlockInfo(virDomainPtr domain, const char *disk, if (conn->driver->domainGetBlockInfo) { int ret; - ret = conn->driver->domainGetBlockInfo (domain, disk, info, flags); + ret = conn->driver->domainGetBlockInfo(domain, disk, info, flags); if (ret < 0) goto error; return ret; @@ -7957,7 +7957,7 @@ virDomainDefineXML(virConnectPtr conn, const char *xml) { if (conn->driver->domainDefineXML) { virDomainPtr ret; - ret = conn->driver->domainDefineXML (conn, xml); + ret = conn->driver->domainDefineXML(conn, xml); if (!ret) goto error; return ret; @@ -8006,7 +8006,7 @@ virDomainUndefine(virDomainPtr domain) { if (conn->driver->domainUndefine) { int ret; - ret = conn->driver->domainUndefine (domain); + ret = conn->driver->domainUndefine(domain); if (ret < 0) goto error; return ret; @@ -8066,7 +8066,7 @@ virDomainUndefineFlags(virDomainPtr domain, if (conn->driver->domainUndefineFlags) { int ret; - ret = conn->driver->domainUndefineFlags (domain, flags); + ret = conn->driver->domainUndefineFlags(domain, flags); if (ret < 0) goto error; return ret; @@ -8103,7 +8103,7 @@ virConnectNumOfDefinedDomains(virConnectPtr conn) if (conn->driver->numOfDefinedDomains) { int ret; - ret = conn->driver->numOfDefinedDomains (conn); + ret = conn->driver->numOfDefinedDomains(conn); if (ret < 0) goto error; return ret; @@ -8152,7 +8152,7 @@ virConnectListDefinedDomains(virConnectPtr conn, char **const names, if (conn->driver->listDefinedDomains) { int ret; - ret = conn->driver->listDefinedDomains (conn, names, maxnames); + ret = conn->driver->listDefinedDomains(conn, names, maxnames); if (ret < 0) goto error; return ret; @@ -8303,7 +8303,7 @@ virDomainCreate(virDomainPtr domain) { if (conn->driver->domainCreate) { int ret; - ret = conn->driver->domainCreate (domain); + ret = conn->driver->domainCreate(domain); if (ret < 0) goto error; return ret; @@ -8370,7 +8370,7 @@ virDomainCreateWithFlags(virDomainPtr domain, unsigned int flags) { if (conn->driver->domainCreateWithFlags) { int ret; - ret = conn->driver->domainCreateWithFlags (domain, flags); + ret = conn->driver->domainCreateWithFlags(domain, flags); if (ret < 0) goto error; return ret; @@ -8415,7 +8415,7 @@ virDomainGetAutostart(virDomainPtr domain, if (conn->driver->domainGetAutostart) { int ret; - ret = conn->driver->domainGetAutostart (domain, autostart); + ret = conn->driver->domainGetAutostart(domain, autostart); if (ret < 0) goto error; return ret; @@ -8463,7 +8463,7 @@ virDomainSetAutostart(virDomainPtr domain, if (conn->driver->domainSetAutostart) { int ret; - ret = conn->driver->domainSetAutostart (domain, autostart); + ret = conn->driver->domainSetAutostart(domain, autostart); if (ret < 0) goto error; return ret; @@ -8513,7 +8513,7 @@ int virDomainInjectNMI(virDomainPtr domain, unsigned int flags) return ret; } - virLibConnError (VIR_ERR_NO_SUPPORT, __FUNCTION__); + virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__); error: virDispatchError(domain->conn); @@ -8575,7 +8575,7 @@ int virDomainSendKey(virDomainPtr domain, return ret; } - virLibConnError (VIR_ERR_NO_SUPPORT, __FUNCTION__); + virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__); error: virDispatchError(domain->conn); @@ -8625,7 +8625,7 @@ virDomainSetVcpus(virDomainPtr domain, unsigned int nvcpus) if (conn->driver->domainSetVcpus) { int ret; - ret = conn->driver->domainSetVcpus (domain, nvcpus); + ret = conn->driver->domainSetVcpus(domain, nvcpus); if (ret < 0) goto error; return ret; @@ -8699,7 +8699,7 @@ virDomainSetVcpusFlags(virDomainPtr domain, unsigned int nvcpus, if (conn->driver->domainSetVcpusFlags) { int ret; - ret = conn->driver->domainSetVcpusFlags (domain, nvcpus, flags); + ret = conn->driver->domainSetVcpusFlags(domain, nvcpus, flags); if (ret < 0) goto error; return ret; @@ -8764,7 +8764,7 @@ virDomainGetVcpusFlags(virDomainPtr domain, unsigned int flags) if (conn->driver->domainGetVcpusFlags) { int ret; - ret = conn->driver->domainGetVcpusFlags (domain, flags); + ret = conn->driver->domainGetVcpusFlags(domain, flags); if (ret < 0) goto error; return ret; @@ -8831,7 +8831,7 @@ virDomainPinVcpu(virDomainPtr domain, unsigned int vcpu, if (conn->driver->domainPinVcpu) { int ret; - ret = conn->driver->domainPinVcpu (domain, vcpu, cpumap, maplen); + ret = conn->driver->domainPinVcpu(domain, vcpu, cpumap, maplen); if (ret < 0) goto error; return ret; @@ -8911,7 +8911,7 @@ virDomainPinVcpuFlags(virDomainPtr domain, unsigned int vcpu, if (conn->driver->domainPinVcpuFlags) { int ret; - ret = conn->driver->domainPinVcpuFlags (domain, vcpu, cpumap, maplen, flags); + ret = conn->driver->domainPinVcpuFlags(domain, vcpu, cpumap, maplen, flags); if (ret < 0) goto error; return ret; @@ -8988,8 +8988,8 @@ virDomainGetVcpuPinInfo(virDomainPtr domain, int ncpumaps, if (conn->driver->domainGetVcpuPinInfo) { int ret; - ret = conn->driver->domainGetVcpuPinInfo (domain, ncpumaps, - cpumaps, maplen, flags); + ret = conn->driver->domainGetVcpuPinInfo(domain, ncpumaps, + cpumaps, maplen, flags); if (ret < 0) goto error; return ret; @@ -9065,7 +9065,7 @@ virDomainPinEmulator(virDomainPtr domain, unsigned char *cpumap, if (conn->driver->domainPinEmulator) { int ret; - ret = conn->driver->domainPinEmulator (domain, cpumap, maplen, flags); + ret = conn->driver->domainPinEmulator(domain, cpumap, maplen, flags); if (ret < 0) goto error; return ret; @@ -9206,8 +9206,8 @@ virDomainGetVcpus(virDomainPtr domain, virVcpuInfoPtr info, int maxinfo, if (conn->driver->domainGetVcpus) { int ret; - ret = conn->driver->domainGetVcpus (domain, info, maxinfo, - cpumaps, maplen); + ret = conn->driver->domainGetVcpus(domain, info, maxinfo, + cpumaps, maplen); if (ret < 0) goto error; return ret; @@ -9251,7 +9251,7 @@ virDomainGetMaxVcpus(virDomainPtr domain) if (conn->driver->domainGetMaxVcpus) { int ret; - ret = conn->driver->domainGetMaxVcpus (domain); + ret = conn->driver->domainGetMaxVcpus(domain); if (ret < 0) goto error; return ret; @@ -9603,7 +9603,7 @@ virDomainAttachDevice(virDomainPtr domain, const char *xml) if (conn->driver->domainAttachDevice) { int ret; - ret = conn->driver->domainAttachDevice (domain, xml); + ret = conn->driver->domainAttachDevice(domain, xml); if (ret < 0) goto error; return ret; @@ -9714,7 +9714,7 @@ virDomainDetachDevice(virDomainPtr domain, const char *xml) if (conn->driver->domainDetachDevice) { int ret; - ret = conn->driver->domainDetachDevice (domain, xml); + ret = conn->driver->domainDetachDevice(domain, xml); if (ret < 0) goto error; return ret; @@ -9892,7 +9892,7 @@ virNodeGetCellsFreeMemory(virConnectPtr conn, unsigned long long *freeMems, if (conn->driver->nodeGetCellsFreeMemory) { int ret; - ret = conn->driver->nodeGetCellsFreeMemory (conn, freeMems, startCell, maxCells); + ret = conn->driver->nodeGetCellsFreeMemory(conn, freeMems, startCell, maxCells); if (ret < 0) goto error; return ret; @@ -9920,13 +9920,13 @@ error: * Returns the virConnectPtr or NULL in case of failure. */ virConnectPtr -virNetworkGetConnect (virNetworkPtr net) +virNetworkGetConnect(virNetworkPtr net) { VIR_DEBUG("net=%p", net); virResetLastError(); - if (!VIR_IS_CONNECTED_NETWORK (net)) { + if (!VIR_IS_CONNECTED_NETWORK(net)) { virLibNetworkError(VIR_ERR_INVALID_NETWORK, __FUNCTION__); virDispatchError(NULL); return NULL; @@ -10027,7 +10027,7 @@ virConnectNumOfNetworks(virConnectPtr conn) if (conn->networkDriver && conn->networkDriver->numOfNetworks) { int ret; - ret = conn->networkDriver->numOfNetworks (conn); + ret = conn->networkDriver->numOfNetworks(conn); if (ret < 0) goto error; return ret; @@ -10074,7 +10074,7 @@ virConnectListNetworks(virConnectPtr conn, char **const names, int maxnames) if (conn->networkDriver && conn->networkDriver->listNetworks) { int ret; - ret = conn->networkDriver->listNetworks (conn, names, maxnames); + ret = conn->networkDriver->listNetworks(conn, names, maxnames); if (ret < 0) goto error; return ret; @@ -10110,7 +10110,7 @@ virConnectNumOfDefinedNetworks(virConnectPtr conn) if (conn->networkDriver && conn->networkDriver->numOfDefinedNetworks) { int ret; - ret = conn->networkDriver->numOfDefinedNetworks (conn); + ret = conn->networkDriver->numOfDefinedNetworks(conn); if (ret < 0) goto error; return ret; @@ -10158,8 +10158,8 @@ virConnectListDefinedNetworks(virConnectPtr conn, char **const names, if (conn->networkDriver && conn->networkDriver->listDefinedNetworks) { int ret; - ret = conn->networkDriver->listDefinedNetworks (conn, - names, maxnames); + ret = conn->networkDriver->listDefinedNetworks(conn, + names, maxnames); if (ret < 0) goto error; return ret; @@ -10198,7 +10198,7 @@ virNetworkLookupByName(virConnectPtr conn, const char *name) if (conn->networkDriver && conn->networkDriver->networkLookupByName) { virNetworkPtr ret; - ret = conn->networkDriver->networkLookupByName (conn, name); + ret = conn->networkDriver->networkLookupByName(conn, name); if (!ret) goto error; return ret; @@ -10238,7 +10238,7 @@ virNetworkLookupByUUID(virConnectPtr conn, const unsigned char *uuid) if (conn->networkDriver && conn->networkDriver->networkLookupByUUID){ virNetworkPtr ret; - ret = conn->networkDriver->networkLookupByUUID (conn, uuid); + ret = conn->networkDriver->networkLookupByUUID(conn, uuid); if (!ret) goto error; return ret; @@ -10322,7 +10322,7 @@ virNetworkCreateXML(virConnectPtr conn, const char *xmlDesc) if (conn->networkDriver && conn->networkDriver->networkCreateXML) { virNetworkPtr ret; - ret = conn->networkDriver->networkCreateXML (conn, xmlDesc); + ret = conn->networkDriver->networkCreateXML(conn, xmlDesc); if (!ret) goto error; return ret; @@ -10364,7 +10364,7 @@ virNetworkDefineXML(virConnectPtr conn, const char *xml) if (conn->networkDriver && conn->networkDriver->networkDefineXML) { virNetworkPtr ret; - ret = conn->networkDriver->networkDefineXML (conn, xml); + ret = conn->networkDriver->networkDefineXML(conn, xml); if (!ret) goto error; return ret; @@ -10405,7 +10405,7 @@ virNetworkUndefine(virNetworkPtr network) { if (conn->networkDriver && conn->networkDriver->networkUndefine) { int ret; - ret = conn->networkDriver->networkUndefine (network); + ret = conn->networkDriver->networkUndefine(network); if (ret < 0) goto error; return ret; @@ -10510,7 +10510,7 @@ virNetworkCreate(virNetworkPtr network) if (conn->networkDriver && conn->networkDriver->networkCreate) { int ret; - ret = conn->networkDriver->networkCreate (network); + ret = conn->networkDriver->networkCreate(network); if (ret < 0) goto error; return ret; @@ -10556,7 +10556,7 @@ virNetworkDestroy(virNetworkPtr network) if (conn->networkDriver && conn->networkDriver->networkDestroy) { int ret; - ret = conn->networkDriver->networkDestroy (network); + ret = conn->networkDriver->networkDestroy(network); if (ret < 0) goto error; return ret; @@ -10791,7 +10791,7 @@ virNetworkGetBridgeName(virNetworkPtr network) if (conn->networkDriver && conn->networkDriver->networkGetBridgeName) { char *ret; - ret = conn->networkDriver->networkGetBridgeName (network); + ret = conn->networkDriver->networkGetBridgeName(network); if (!ret) goto error; return ret; @@ -10835,7 +10835,7 @@ virNetworkGetAutostart(virNetworkPtr network, if (conn->networkDriver && conn->networkDriver->networkGetAutostart) { int ret; - ret = conn->networkDriver->networkGetAutostart (network, autostart); + ret = conn->networkDriver->networkGetAutostart(network, autostart); if (ret < 0) goto error; return ret; @@ -10882,7 +10882,7 @@ virNetworkSetAutostart(virNetworkPtr network, if (conn->networkDriver && conn->networkDriver->networkSetAutostart) { int ret; - ret = conn->networkDriver->networkSetAutostart (network, autostart); + ret = conn->networkDriver->networkSetAutostart(network, autostart); if (ret < 0) goto error; return ret; @@ -10910,13 +10910,13 @@ error: * Returns the virConnectPtr or NULL in case of failure. */ virConnectPtr -virInterfaceGetConnect (virInterfacePtr iface) +virInterfaceGetConnect(virInterfacePtr iface) { VIR_DEBUG("iface=%p", iface); virResetLastError(); - if (!VIR_IS_CONNECTED_INTERFACE (iface)) { + if (!VIR_IS_CONNECTED_INTERFACE(iface)) { virLibInterfaceError(VIR_ERR_INVALID_INTERFACE, __FUNCTION__); virDispatchError(NULL); return NULL; @@ -11008,7 +11008,7 @@ virConnectNumOfInterfaces(virConnectPtr conn) if (conn->interfaceDriver && conn->interfaceDriver->numOfInterfaces) { int ret; - ret = conn->interfaceDriver->numOfInterfaces (conn); + ret = conn->interfaceDriver->numOfInterfaces(conn); if (ret < 0) goto error; return ret; @@ -11056,7 +11056,7 @@ virConnectListInterfaces(virConnectPtr conn, char **const names, int maxnames) if (conn->interfaceDriver && conn->interfaceDriver->listInterfaces) { int ret; - ret = conn->interfaceDriver->listInterfaces (conn, names, maxnames); + ret = conn->interfaceDriver->listInterfaces(conn, names, maxnames); if (ret < 0) goto error; return ret; @@ -11092,7 +11092,7 @@ virConnectNumOfDefinedInterfaces(virConnectPtr conn) if (conn->interfaceDriver && conn->interfaceDriver->numOfDefinedInterfaces) { int ret; - ret = conn->interfaceDriver->numOfDefinedInterfaces (conn); + ret = conn->interfaceDriver->numOfDefinedInterfaces(conn); if (ret < 0) goto error; return ret; @@ -11142,7 +11142,7 @@ virConnectListDefinedInterfaces(virConnectPtr conn, if (conn->interfaceDriver && conn->interfaceDriver->listDefinedInterfaces) { int ret; - ret = conn->interfaceDriver->listDefinedInterfaces (conn, names, maxnames); + ret = conn->interfaceDriver->listDefinedInterfaces(conn, names, maxnames); if (ret < 0) goto error; return ret; @@ -11181,7 +11181,7 @@ virInterfaceLookupByName(virConnectPtr conn, const char *name) if (conn->interfaceDriver && conn->interfaceDriver->interfaceLookupByName) { virInterfacePtr ret; - ret = conn->interfaceDriver->interfaceLookupByName (conn, name); + ret = conn->interfaceDriver->interfaceLookupByName(conn, name); if (!ret) goto error; return ret; @@ -11220,7 +11220,7 @@ virInterfaceLookupByMACString(virConnectPtr conn, const char *macstr) if (conn->interfaceDriver && conn->interfaceDriver->interfaceLookupByMACString) { virInterfacePtr ret; - ret = conn->interfaceDriver->interfaceLookupByMACString (conn, macstr); + ret = conn->interfaceDriver->interfaceLookupByMACString(conn, macstr); if (!ret) goto error; return ret; @@ -11319,7 +11319,7 @@ virInterfaceGetXMLDesc(virInterfacePtr iface, unsigned int flags) if (conn->interfaceDriver && conn->interfaceDriver->interfaceGetXMLDesc) { char *ret; - ret = conn->interfaceDriver->interfaceGetXMLDesc (iface, flags); + ret = conn->interfaceDriver->interfaceGetXMLDesc(iface, flags); if (!ret) goto error; return ret; @@ -11372,7 +11372,7 @@ virInterfaceDefineXML(virConnectPtr conn, const char *xml, unsigned int flags) if (conn->interfaceDriver && conn->interfaceDriver->interfaceDefineXML) { virInterfacePtr ret; - ret = conn->interfaceDriver->interfaceDefineXML (conn, xml, flags); + ret = conn->interfaceDriver->interfaceDefineXML(conn, xml, flags); if (!ret) goto error; return ret; @@ -11424,7 +11424,7 @@ virInterfaceUndefine(virInterfacePtr iface) { if (conn->interfaceDriver && conn->interfaceDriver->interfaceUndefine) { int ret; - ret = conn->interfaceDriver->interfaceUndefine (iface); + ret = conn->interfaceDriver->interfaceUndefine(iface); if (ret < 0) goto error; return ret; @@ -11472,7 +11472,7 @@ virInterfaceCreate(virInterfacePtr iface, unsigned int flags) if (conn->interfaceDriver && conn->interfaceDriver->interfaceCreate) { int ret; - ret = conn->interfaceDriver->interfaceCreate (iface, flags); + ret = conn->interfaceDriver->interfaceCreate(iface, flags); if (ret < 0) goto error; return ret; @@ -11525,7 +11525,7 @@ virInterfaceDestroy(virInterfacePtr iface, unsigned int flags) if (conn->interfaceDriver && conn->interfaceDriver->interfaceDestroy) { int ret; - ret = conn->interfaceDriver->interfaceDestroy (iface, flags); + ret = conn->interfaceDriver->interfaceDestroy(iface, flags); if (ret < 0) goto error; return ret; @@ -11754,13 +11754,13 @@ error: * Returns the virConnectPtr or NULL in case of failure. */ virConnectPtr -virStoragePoolGetConnect (virStoragePoolPtr pool) +virStoragePoolGetConnect(virStoragePoolPtr pool) { VIR_DEBUG("pool=%p", pool); virResetLastError(); - if (!VIR_IS_CONNECTED_STORAGE_POOL (pool)) { + if (!VIR_IS_CONNECTED_STORAGE_POOL(pool)) { virLibStoragePoolError(VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__); virDispatchError(NULL); return NULL; @@ -11875,7 +11875,7 @@ virConnectNumOfStoragePools(virConnectPtr conn) if (conn->storageDriver && conn->storageDriver->numOfPools) { int ret; - ret = conn->storageDriver->numOfPools (conn); + ret = conn->storageDriver->numOfPools(conn); if (ret < 0) goto error; return ret; @@ -11926,7 +11926,7 @@ virConnectListStoragePools(virConnectPtr conn, if (conn->storageDriver && conn->storageDriver->listPools) { int ret; - ret = conn->storageDriver->listPools (conn, names, maxnames); + ret = conn->storageDriver->listPools(conn, names, maxnames); if (ret < 0) goto error; return ret; @@ -11963,7 +11963,7 @@ virConnectNumOfDefinedStoragePools(virConnectPtr conn) if (conn->storageDriver && conn->storageDriver->numOfDefinedPools) { int ret; - ret = conn->storageDriver->numOfDefinedPools (conn); + ret = conn->storageDriver->numOfDefinedPools(conn); if (ret < 0) goto error; return ret; @@ -12015,7 +12015,7 @@ virConnectListDefinedStoragePools(virConnectPtr conn, if (conn->storageDriver && conn->storageDriver->listDefinedPools) { int ret; - ret = conn->storageDriver->listDefinedPools (conn, names, maxnames); + ret = conn->storageDriver->listDefinedPools(conn, names, maxnames); if (ret < 0) goto error; return ret; @@ -12115,7 +12115,7 @@ virStoragePoolLookupByName(virConnectPtr conn, if (conn->storageDriver && conn->storageDriver->poolLookupByName) { virStoragePoolPtr ret; - ret = conn->storageDriver->poolLookupByName (conn, name); + ret = conn->storageDriver->poolLookupByName(conn, name); if (!ret) goto error; return ret; @@ -12155,7 +12155,7 @@ virStoragePoolLookupByUUID(virConnectPtr conn, if (conn->storageDriver && conn->storageDriver->poolLookupByUUID) { virStoragePoolPtr ret; - ret = conn->storageDriver->poolLookupByUUID (conn, uuid); + ret = conn->storageDriver->poolLookupByUUID(conn, uuid); if (!ret) goto error; return ret; @@ -12232,7 +12232,7 @@ virStoragePoolLookupByVolume(virStorageVolPtr vol) if (vol->conn->storageDriver && vol->conn->storageDriver->poolLookupByVolume) { virStoragePoolPtr ret; - ret = vol->conn->storageDriver->poolLookupByVolume (vol); + ret = vol->conn->storageDriver->poolLookupByVolume(vol); if (!ret) goto error; return ret; @@ -12280,7 +12280,7 @@ virStoragePoolCreateXML(virConnectPtr conn, if (conn->storageDriver && conn->storageDriver->poolCreateXML) { virStoragePoolPtr ret; - ret = conn->storageDriver->poolCreateXML (conn, xmlDesc, flags); + ret = conn->storageDriver->poolCreateXML(conn, xmlDesc, flags); if (!ret) goto error; return ret; @@ -12326,7 +12326,7 @@ virStoragePoolDefineXML(virConnectPtr conn, if (conn->storageDriver && conn->storageDriver->poolDefineXML) { virStoragePoolPtr ret; - ret = conn->storageDriver->poolDefineXML (conn, xml, flags); + ret = conn->storageDriver->poolDefineXML(conn, xml, flags); if (!ret) goto error; return ret; @@ -12373,7 +12373,7 @@ virStoragePoolBuild(virStoragePoolPtr pool, if (conn->storageDriver && conn->storageDriver->poolBuild) { int ret; - ret = conn->storageDriver->poolBuild (pool, flags); + ret = conn->storageDriver->poolBuild(pool, flags); if (ret < 0) goto error; return ret; @@ -12416,7 +12416,7 @@ virStoragePoolUndefine(virStoragePoolPtr pool) if (conn->storageDriver && conn->storageDriver->poolUndefine) { int ret; - ret = conn->storageDriver->poolUndefine (pool); + ret = conn->storageDriver->poolUndefine(pool); if (ret < 0) goto error; return ret; @@ -12461,7 +12461,7 @@ virStoragePoolCreate(virStoragePoolPtr pool, if (conn->storageDriver && conn->storageDriver->poolCreate) { int ret; - ret = conn->storageDriver->poolCreate (pool, flags); + ret = conn->storageDriver->poolCreate(pool, flags); if (ret < 0) goto error; return ret; @@ -12509,7 +12509,7 @@ virStoragePoolDestroy(virStoragePoolPtr pool) if (conn->storageDriver && conn->storageDriver->poolDestroy) { int ret; - ret = conn->storageDriver->poolDestroy (pool); + ret = conn->storageDriver->poolDestroy(pool); if (ret < 0) goto error; return ret; @@ -12556,7 +12556,7 @@ virStoragePoolDelete(virStoragePoolPtr pool, if (conn->storageDriver && conn->storageDriver->poolDelete) { int ret; - ret = conn->storageDriver->poolDelete (pool, flags); + ret = conn->storageDriver->poolDelete(pool, flags); if (ret < 0) goto error; return ret; @@ -12661,7 +12661,7 @@ virStoragePoolRefresh(virStoragePoolPtr pool, if (conn->storageDriver && conn->storageDriver->poolRefresh) { int ret; - ret = conn->storageDriver->poolRefresh (pool, flags); + ret = conn->storageDriver->poolRefresh(pool, flags); if (ret < 0) goto error; return ret; @@ -12801,7 +12801,7 @@ virStoragePoolGetInfo(virStoragePoolPtr pool, if (conn->storageDriver->poolGetInfo) { int ret; - ret = conn->storageDriver->poolGetInfo (pool, info); + ret = conn->storageDriver->poolGetInfo(pool, info); if (ret < 0) goto error; return ret; @@ -12845,7 +12845,7 @@ virStoragePoolGetXMLDesc(virStoragePoolPtr pool, if (conn->storageDriver && conn->storageDriver->poolGetXMLDesc) { char *ret; - ret = conn->storageDriver->poolGetXMLDesc (pool, flags); + ret = conn->storageDriver->poolGetXMLDesc(pool, flags); if (!ret) goto error; return ret; @@ -12889,7 +12889,7 @@ virStoragePoolGetAutostart(virStoragePoolPtr pool, if (conn->storageDriver && conn->storageDriver->poolGetAutostart) { int ret; - ret = conn->storageDriver->poolGetAutostart (pool, autostart); + ret = conn->storageDriver->poolGetAutostart(pool, autostart); if (ret < 0) goto error; return ret; @@ -12936,7 +12936,7 @@ virStoragePoolSetAutostart(virStoragePoolPtr pool, if (conn->storageDriver && conn->storageDriver->poolSetAutostart) { int ret; - ret = conn->storageDriver->poolSetAutostart (pool, autostart); + ret = conn->storageDriver->poolSetAutostart(pool, autostart); if (ret < 0) goto error; return ret; @@ -13021,7 +13021,7 @@ virStoragePoolNumOfVolumes(virStoragePoolPtr pool) if (pool->conn->storageDriver && pool->conn->storageDriver->poolNumOfVolumes) { int ret; - ret = pool->conn->storageDriver->poolNumOfVolumes (pool); + ret = pool->conn->storageDriver->poolNumOfVolumes(pool); if (ret < 0) goto error; return ret; @@ -13068,7 +13068,7 @@ virStoragePoolListVolumes(virStoragePoolPtr pool, if (pool->conn->storageDriver && pool->conn->storageDriver->poolListVolumes) { int ret; - ret = pool->conn->storageDriver->poolListVolumes (pool, names, maxnames); + ret = pool->conn->storageDriver->poolListVolumes(pool, names, maxnames); if (ret < 0) goto error; return ret; @@ -13097,13 +13097,13 @@ error: * Returns the virConnectPtr or NULL in case of failure. */ virConnectPtr -virStorageVolGetConnect (virStorageVolPtr vol) +virStorageVolGetConnect(virStorageVolPtr vol) { VIR_DEBUG("vol=%p", vol); virResetLastError(); - if (!VIR_IS_STORAGE_VOL (vol)) { + if (!VIR_IS_STORAGE_VOL(vol)) { virLibStorageVolError(VIR_ERR_INVALID_STORAGE_VOL, __FUNCTION__); virDispatchError(NULL); return NULL; @@ -13140,7 +13140,7 @@ virStorageVolLookupByName(virStoragePoolPtr pool, if (pool->conn->storageDriver && pool->conn->storageDriver->volLookupByName) { virStorageVolPtr ret; - ret = pool->conn->storageDriver->volLookupByName (pool, name); + ret = pool->conn->storageDriver->volLookupByName(pool, name); if (!ret) goto error; return ret; @@ -13183,7 +13183,7 @@ virStorageVolLookupByKey(virConnectPtr conn, if (conn->storageDriver && conn->storageDriver->volLookupByKey) { virStorageVolPtr ret; - ret = conn->storageDriver->volLookupByKey (conn, key); + ret = conn->storageDriver->volLookupByKey(conn, key); if (!ret) goto error; return ret; @@ -13223,7 +13223,7 @@ virStorageVolLookupByPath(virConnectPtr conn, if (conn->storageDriver && conn->storageDriver->volLookupByPath) { virStorageVolPtr ret; - ret = conn->storageDriver->volLookupByPath (conn, path); + ret = conn->storageDriver->volLookupByPath(conn, path); if (!ret) goto error; return ret; @@ -13324,7 +13324,7 @@ virStorageVolCreateXML(virStoragePoolPtr pool, if (pool->conn->storageDriver && pool->conn->storageDriver->volCreateXML) { virStorageVolPtr ret; - ret = pool->conn->storageDriver->volCreateXML (pool, xmldesc, flags); + ret = pool->conn->storageDriver->volCreateXML(pool, xmldesc, flags); if (!ret) goto error; return ret; @@ -13384,8 +13384,8 @@ virStorageVolCreateXMLFrom(virStoragePoolPtr pool, if (pool->conn->storageDriver && pool->conn->storageDriver->volCreateXMLFrom) { virStorageVolPtr ret; - ret = pool->conn->storageDriver->volCreateXMLFrom (pool, xmldesc, - clonevol, flags); + ret = pool->conn->storageDriver->volCreateXMLFrom(pool, xmldesc, + clonevol, flags); if (!ret) goto error; return ret; @@ -13571,7 +13571,7 @@ virStorageVolDelete(virStorageVolPtr vol, if (conn->storageDriver && conn->storageDriver->volDelete) { int ret; - ret = conn->storageDriver->volDelete (vol, flags); + ret = conn->storageDriver->volDelete(vol, flags); if (ret < 0) goto error; return ret; @@ -13769,7 +13769,7 @@ virStorageVolGetInfo(virStorageVolPtr vol, if (conn->storageDriver->volGetInfo){ int ret; - ret = conn->storageDriver->volGetInfo (vol, info); + ret = conn->storageDriver->volGetInfo(vol, info); if (ret < 0) goto error; return ret; @@ -13812,7 +13812,7 @@ virStorageVolGetXMLDesc(virStorageVolPtr vol, if (conn->storageDriver && conn->storageDriver->volGetXMLDesc) { char *ret; - ret = conn->storageDriver->volGetXMLDesc (vol, flags); + ret = conn->storageDriver->volGetXMLDesc(vol, flags); if (!ret) goto error; return ret; @@ -13857,7 +13857,7 @@ virStorageVolGetPath(virStorageVolPtr vol) if (conn->storageDriver && conn->storageDriver->volGetPath) { char *ret; - ret = conn->storageDriver->volGetPath (vol); + ret = conn->storageDriver->volGetPath(vol); if (!ret) goto error; return ret; @@ -13978,7 +13978,7 @@ virNodeNumOfDevices(virConnectPtr conn, const char *cap, unsigned int flags) if (conn->deviceMonitor && conn->deviceMonitor->numOfDevices) { int ret; - ret = conn->deviceMonitor->numOfDevices (conn, cap, flags); + ret = conn->deviceMonitor->numOfDevices(conn, cap, flags); if (ret < 0) goto error; return ret; @@ -14099,7 +14099,7 @@ virNodeListDevices(virConnectPtr conn, if (conn->deviceMonitor && conn->deviceMonitor->listDevices) { int ret; - ret = conn->deviceMonitor->listDevices (conn, cap, names, maxnames, flags); + ret = conn->deviceMonitor->listDevices(conn, cap, names, maxnames, flags); if (ret < 0) goto error; return ret; @@ -14138,7 +14138,7 @@ virNodeDevicePtr virNodeDeviceLookupByName(virConnectPtr conn, const char *name) if (conn->deviceMonitor && conn->deviceMonitor->deviceLookupByName) { virNodeDevicePtr ret; - ret = conn->deviceMonitor->deviceLookupByName (conn, name); + ret = conn->deviceMonitor->deviceLookupByName(conn, name); if (!ret) goto error; return ret; @@ -14234,7 +14234,7 @@ const char *virNodeDeviceGetParent(virNodeDevicePtr dev) if (!dev->parent) { if (dev->conn->deviceMonitor && dev->conn->deviceMonitor->deviceGetParent) { - dev->parent = dev->conn->deviceMonitor->deviceGetParent (dev); + dev->parent = dev->conn->deviceMonitor->deviceGetParent(dev); } else { virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__); virDispatchError(dev->conn); @@ -14266,7 +14266,7 @@ int virNodeDeviceNumOfCaps(virNodeDevicePtr dev) if (dev->conn->deviceMonitor && dev->conn->deviceMonitor->deviceNumOfCaps) { int ret; - ret = dev->conn->deviceMonitor->deviceNumOfCaps (dev); + ret = dev->conn->deviceMonitor->deviceNumOfCaps(dev); if (ret < 0) goto error; return ret; @@ -14309,7 +14309,7 @@ int virNodeDeviceListCaps(virNodeDevicePtr dev, if (dev->conn->deviceMonitor && dev->conn->deviceMonitor->deviceListCaps) { int ret; - ret = dev->conn->deviceMonitor->deviceListCaps (dev, names, maxnames); + ret = dev->conn->deviceMonitor->deviceListCaps(dev, names, maxnames); if (ret < 0) goto error; return ret; @@ -14417,7 +14417,7 @@ virNodeDeviceDettach(virNodeDevicePtr dev) if (dev->conn->driver->nodeDeviceDettach) { int ret; - ret = dev->conn->driver->nodeDeviceDettach (dev); + ret = dev->conn->driver->nodeDeviceDettach(dev); if (ret < 0) goto error; return ret; @@ -14465,7 +14465,7 @@ virNodeDeviceReAttach(virNodeDevicePtr dev) if (dev->conn->driver->nodeDeviceReAttach) { int ret; - ret = dev->conn->driver->nodeDeviceReAttach (dev); + ret = dev->conn->driver->nodeDeviceReAttach(dev); if (ret < 0) goto error; return ret; @@ -14515,7 +14515,7 @@ virNodeDeviceReset(virNodeDevicePtr dev) if (dev->conn->driver->nodeDeviceReset) { int ret; - ret = dev->conn->driver->nodeDeviceReset (dev); + ret = dev->conn->driver->nodeDeviceReset(dev); if (ret < 0) goto error; return ret; @@ -14668,7 +14668,7 @@ virConnectDomainEventRegister(virConnectPtr conn, if ((conn->driver) && (conn->driver->domainEventRegister)) { int ret; - ret = conn->driver->domainEventRegister (conn, cb, opaque, freecb); + ret = conn->driver->domainEventRegister(conn, cb, opaque, freecb); if (ret < 0) goto error; return ret; @@ -14711,7 +14711,7 @@ virConnectDomainEventDeregister(virConnectPtr conn, if ((conn->driver) && (conn->driver->domainEventDeregister)) { int ret; - ret = conn->driver->domainEventDeregister (conn, cb); + ret = conn->driver->domainEventDeregister(conn, cb); if (ret < 0) goto error; return ret; @@ -14736,13 +14736,13 @@ error: * Returns the virConnectPtr or NULL in case of failure. */ virConnectPtr -virSecretGetConnect (virSecretPtr secret) +virSecretGetConnect(virSecretPtr secret) { VIR_DEBUG("secret=%p", secret); virResetLastError(); - if (!VIR_IS_CONNECTED_SECRET (secret)) { + if (!VIR_IS_CONNECTED_SECRET(secret)) { virLibSecretError(VIR_ERR_INVALID_SECRET, __FUNCTION__); virDispatchError(NULL); return NULL; @@ -14924,7 +14924,7 @@ virSecretLookupByUUID(virConnectPtr conn, const unsigned char *uuid) if (conn->secretDriver && conn->secretDriver->lookupByUUID) { virSecretPtr ret; - ret = conn->secretDriver->lookupByUUID (conn, uuid); + ret = conn->secretDriver->lookupByUUID(conn, uuid); if (!ret) goto error; return ret; @@ -15010,7 +15010,7 @@ virSecretLookupByUsage(virConnectPtr conn, if (conn->secretDriver && conn->secretDriver->lookupByUsage) { virSecretPtr ret; - ret = conn->secretDriver->lookupByUsage (conn, usageType, usageID); + ret = conn->secretDriver->lookupByUsage(conn, usageType, usageID); if (!ret) goto error; return ret; @@ -16414,7 +16414,7 @@ virConnectNumOfNWFilters(virConnectPtr conn) if (conn->nwfilterDriver && conn->nwfilterDriver->numOfNWFilters) { int ret; - ret = conn->nwfilterDriver->numOfNWFilters (conn); + ret = conn->nwfilterDriver->numOfNWFilters(conn); if (ret < 0) goto error; return ret; @@ -16506,7 +16506,7 @@ virConnectListNWFilters(virConnectPtr conn, char **const names, int maxnames) if (conn->nwfilterDriver && conn->nwfilterDriver->listNWFilters) { int ret; - ret = conn->nwfilterDriver->listNWFilters (conn, names, maxnames); + ret = conn->nwfilterDriver->listNWFilters(conn, names, maxnames); if (ret < 0) goto error; return ret; @@ -16546,7 +16546,7 @@ virNWFilterLookupByName(virConnectPtr conn, const char *name) if (conn->nwfilterDriver && conn->nwfilterDriver->nwfilterLookupByName) { virNWFilterPtr ret; - ret = conn->nwfilterDriver->nwfilterLookupByName (conn, name); + ret = conn->nwfilterDriver->nwfilterLookupByName(conn, name); if (!ret) goto error; return ret; @@ -16585,7 +16585,7 @@ virNWFilterLookupByUUID(virConnectPtr conn, const unsigned char *uuid) if (conn->nwfilterDriver && conn->nwfilterDriver->nwfilterLookupByUUID){ virNWFilterPtr ret; - ret = conn->nwfilterDriver->nwfilterLookupByUUID (conn, uuid); + ret = conn->nwfilterDriver->nwfilterLookupByUUID(conn, uuid); if (!ret) goto error; return ret; @@ -16787,7 +16787,7 @@ virNWFilterDefineXML(virConnectPtr conn, const char *xmlDesc) if (conn->nwfilterDriver && conn->nwfilterDriver->defineXML) { virNWFilterPtr ret; - ret = conn->nwfilterDriver->defineXML (conn, xmlDesc); + ret = conn->nwfilterDriver->defineXML(conn, xmlDesc); if (!ret) goto error; return ret; @@ -16833,7 +16833,7 @@ virNWFilterUndefine(virNWFilterPtr nwfilter) if (conn->nwfilterDriver && conn->nwfilterDriver->undefine) { int ret; - ret = conn->nwfilterDriver->undefine (nwfilter); + ret = conn->nwfilterDriver->undefine(nwfilter); if (ret < 0) goto error; return ret; @@ -16876,7 +16876,7 @@ virNWFilterGetXMLDesc(virNWFilterPtr nwfilter, unsigned int flags) if (conn->nwfilterDriver && conn->nwfilterDriver->getXMLDesc) { char *ret; - ret = conn->nwfilterDriver->getXMLDesc (nwfilter, flags); + ret = conn->nwfilterDriver->getXMLDesc(nwfilter, flags); if (!ret) goto error; return ret; @@ -17155,7 +17155,7 @@ virDomainGetJobInfo(virDomainPtr domain, virDomainJobInfoPtr info) if (conn->driver->domainGetJobInfo) { int ret; - ret = conn->driver->domainGetJobInfo (domain, info); + ret = conn->driver->domainGetJobInfo(domain, info); if (ret < 0) goto error; return ret; @@ -18949,7 +18949,7 @@ int virDomainBlockJobAbort(virDomainPtr dom, const char *disk, virResetLastError(); - if (!VIR_IS_CONNECTED_DOMAIN (dom)) { + if (!VIR_IS_CONNECTED_DOMAIN(dom)) { virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__); virDispatchError(NULL); return -1; @@ -19006,7 +19006,7 @@ int virDomainGetBlockJobInfo(virDomainPtr dom, const char *disk, virResetLastError(); - if (!VIR_IS_CONNECTED_DOMAIN (dom)) { + if (!VIR_IS_CONNECTED_DOMAIN(dom)) { virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__); virDispatchError(NULL); return -1; @@ -19060,7 +19060,7 @@ int virDomainBlockJobSetSpeed(virDomainPtr dom, const char *disk, virResetLastError(); - if (!VIR_IS_CONNECTED_DOMAIN (dom)) { + if (!VIR_IS_CONNECTED_DOMAIN(dom)) { virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__); virDispatchError(NULL); return -1; @@ -19132,7 +19132,7 @@ int virDomainBlockPull(virDomainPtr dom, const char *disk, virResetLastError(); - if (!VIR_IS_CONNECTED_DOMAIN (dom)) { + if (!VIR_IS_CONNECTED_DOMAIN(dom)) { virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__); virDispatchError(NULL); return -1; @@ -19250,7 +19250,7 @@ int virDomainBlockRebase(virDomainPtr dom, const char *disk, virResetLastError(); - if (!VIR_IS_CONNECTED_DOMAIN (dom)) { + if (!VIR_IS_CONNECTED_DOMAIN(dom)) { virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__); virDispatchError(NULL); return -1; @@ -19805,7 +19805,7 @@ int virDomainGetBlockIoTune(virDomainPtr dom, virResetLastError(); - if (!VIR_IS_CONNECTED_DOMAIN (dom)) { + if (!VIR_IS_CONNECTED_DOMAIN(dom)) { virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__); virDispatchError(NULL); return -1; @@ -20089,7 +20089,7 @@ virDomainGetHostname(virDomainPtr domain, unsigned int flags) if (conn->driver->domainGetHostname) { char *ret; - ret = conn->driver->domainGetHostname (domain, flags); + ret = conn->driver->domainGetHostname(domain, flags); if (!ret) goto error; return ret; diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index b988fa7..d04e6c6 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -914,7 +914,7 @@ libxlMakeCapabilities(libxl_ctx *ctx) const libxl_version_info *ver_info; struct utsname utsname; - regcomp (&xen_cap_rec, xen_cap_re, REG_EXTENDED); + regcomp(&xen_cap_rec, xen_cap_re, REG_EXTENDED); if (libxl_get_physinfo(ctx, &phy_info) != 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", diff --git a/src/lxc/lxc_conf.c b/src/lxc/lxc_conf.c index 47dc7f1..138b697 100644 --- a/src/lxc/lxc_conf.c +++ b/src/lxc/lxc_conf.c @@ -184,7 +184,7 @@ int lxcLoadDriverConfig(virLXCDriverPtr driver) goto no_memory; /* Avoid error from non-existant or unreadable file. */ - if (access (filename, R_OK) == -1) + if (access(filename, R_OK) == -1) goto done; conf = virConfReadFile(filename, 0); if (!conf) @@ -199,11 +199,11 @@ int lxcLoadDriverConfig(virLXCDriverPtr driver) } p = virConfGetValue(conf, "log_with_libvirtd"); - CHECK_TYPE ("log_with_libvirtd", VIR_CONF_LONG); + CHECK_TYPE("log_with_libvirtd", VIR_CONF_LONG); if (p) driver->log_libvirtd = p->l; - p = virConfGetValue (conf, "security_driver"); - CHECK_TYPE ("security_driver", VIR_CONF_STRING); + p = virConfGetValue(conf, "security_driver"); + CHECK_TYPE("security_driver", VIR_CONF_STRING); if (p && p->str) { if (!(driver->securityDriverName = strdup(p->str))) { virReportOOMError(); @@ -212,12 +212,12 @@ int lxcLoadDriverConfig(virLXCDriverPtr driver) } } - p = virConfGetValue (conf, "security_default_confined"); - CHECK_TYPE ("security_default_confined", VIR_CONF_LONG); + p = virConfGetValue(conf, "security_default_confined"); + CHECK_TYPE("security_default_confined", VIR_CONF_LONG); if (p) driver->securityDefaultConfined = p->l; - p = virConfGetValue (conf, "security_require_confined"); - CHECK_TYPE ("security_require_confined", VIR_CONF_LONG); + p = virConfGetValue(conf, "security_require_confined"); + CHECK_TYPE("security_require_confined", VIR_CONF_LONG); if (p) driver->securityRequireConfined = p->l; diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index 2789c17..6751e1a 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -240,7 +240,7 @@ static int lxcContainerSetStdio(int control, int ttyfd, int handshakefd) /* Just in case someone forget to set FD_CLOEXEC, explicitly * close all FDs before executing the container */ - open_max = sysconf (_SC_OPEN_MAX); + open_max = sysconf(_SC_OPEN_MAX); for (i = 0; i < open_max; i++) if (i != ttyfd && i != control && i != handshakefd) { int tmpfd = i; diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 5578373..90fc2eb 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -299,7 +299,7 @@ networkStartup(int privileged) { "%s/log/libvirt/qemu", LOCALSTATEDIR) == -1) goto out_of_memory; - if ((base = strdup (SYSCONFDIR "/libvirt")) == NULL) + if ((base = strdup(SYSCONFDIR "/libvirt")) == NULL) goto out_of_memory; } else { char *userdir = virGetUserCacheDirectory(); @@ -1963,7 +1963,7 @@ networkCheckRouteCollision(virNetworkObjPtr network) VIR_DEBUG("%s output:\n%s", PROC_NET_ROUTE, buf); - if (!STRPREFIX (buf, "Iface")) + if (!STRPREFIX(buf, "Iface")) goto out; /* First line is just headings, skip it */ diff --git a/src/nodeinfo.c b/src/nodeinfo.c index 8f96b8b..44098da 100644 --- a/src/nodeinfo.c +++ b/src/nodeinfo.c @@ -818,7 +818,7 @@ int nodeGetInfo(virConnectPtr conn ATTRIBUTE_UNUSED, virNodeInfoPtr nodeinfo) { goto cleanup; /* Convert to KB. */ - nodeinfo->memory = physmem_total () / 1024; + nodeinfo->memory = physmem_total() / 1024; cleanup: VIR_FORCE_FCLOSE(cpuinfo); diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c index a80bb66..12f47ef 100644 --- a/src/nwfilter/nwfilter_driver.c +++ b/src/nwfilter/nwfilter_driver.c @@ -216,7 +216,7 @@ nwfilterDriverStartup(int privileged) } if (privileged) { - if ((base = strdup (SYSCONFDIR "/libvirt")) == NULL) + if ((base = strdup(SYSCONFDIR "/libvirt")) == NULL) goto out_of_memory; } else { base = virGetUserConfigDirectory(); diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfilter_ebiptables_driver.c index 9bff8f1..e0e968a 100644 --- a/src/nwfilter/nwfilter_ebiptables_driver.c +++ b/src/nwfilter/nwfilter_ebiptables_driver.c @@ -3686,7 +3686,7 @@ ebiptablesApplyNewRules(const char *ifname, /* scan the rules to see which chains need to be created */ for (i = 0; i < nruleInstances; i++) { - sa_assert (inst); + sa_assert(inst); if (inst[i]->ruleType == RT_EBTABLES) { const char *name = inst[i]->neededProtocolChain; if (inst[i]->chainprefix == CHAINPREFIX_HOST_IN_TEMP) { @@ -3743,7 +3743,7 @@ ebiptablesApplyNewRules(const char *ifname, commands for creating and connecting ebtables chains */ j = 0; for (i = 0; i < nruleInstances; i++) { - sa_assert (inst); + sa_assert(inst); switch (inst[i]->ruleType) { case RT_EBTABLES: while (j < nEbtChains && @@ -3801,7 +3801,7 @@ ebiptablesApplyNewRules(const char *ifname, NWFILTER_SET_IPTABLES_SHELLVAR(&buf); for (i = 0; i < nruleInstances; i++) { - sa_assert (inst); + sa_assert(inst); if (inst[i]->ruleType == RT_IPTABLES) iptablesInstCommand(&buf, inst[i]->commandTemplate, @@ -4079,7 +4079,7 @@ ebiptablesAllTeardown(const char *ifname) NWFILTER_SET_IPTABLES_SHELLVAR(&buf); iptablesUnlinkRootChains(&buf, ifname); - iptablesClearVirtInPost (&buf, ifname); + iptablesClearVirtInPost(&buf, ifname); iptablesRemoveRootChains(&buf, ifname); } @@ -4087,7 +4087,7 @@ ebiptablesAllTeardown(const char *ifname) NWFILTER_SET_IP6TABLES_SHELLVAR(&buf); iptablesUnlinkRootChains(&buf, ifname); - iptablesClearVirtInPost (&buf, ifname); + iptablesClearVirtInPost(&buf, ifname); iptablesRemoveRootChains(&buf, ifname); } diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c index b9f85a8..b3cb99e 100644 --- a/src/openvz/openvz_conf.c +++ b/src/openvz/openvz_conf.c @@ -285,7 +285,7 @@ openvzReadNetworkConf(virDomainDefPtr def, /*parse string*/ do { - char *next = strchrnul (p, ','); + char *next = strchrnul(p, ','); if (STRPREFIX(p, "ifname=")) { /* skip in libvirt */ } else if (STRPREFIX(p, "host_ifname=")) { diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index 2f51c1c..3e43228 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -1403,7 +1403,7 @@ static virDrvOpenStatus openvzOpen(virConnectPtr conn, } else { /* If scheme isn't 'openvz', then its for another driver */ if (conn->uri->scheme == NULL || - STRNEQ (conn->uri->scheme, "openvz")) + STRNEQ(conn->uri->scheme, "openvz")) return VIR_DRV_OPEN_DECLINED; /* If server name is given, its for remote driver */ @@ -1412,7 +1412,7 @@ static virDrvOpenStatus openvzOpen(virConnectPtr conn, /* If path isn't /system, then they typoed, so tell them correct path */ if (conn->uri->path == NULL || - STRNEQ (conn->uri->path, "/system")) { + STRNEQ(conn->uri->path, "/system")) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unexpected OpenVZ URI path '%s', try openvz:///system"), conn->uri->path); @@ -1636,8 +1636,8 @@ Version: 2.2 break; } - if (sscanf (line, "%d %llu %llu %llu", - &readvps, &usertime, &nicetime, &systime) == 4 + if (sscanf(line, "%d %llu %llu %llu", + &readvps, &usertime, &nicetime, &systime) == 4 && readvps == vpsid) { /*found vpsid*/ /* convert jiffies to nanoseconds */ *cpuTime = (1000ull * 1000ull * 1000ull @@ -1942,9 +1942,9 @@ cleanup: } static int -openvzDomainInterfaceStats (virDomainPtr dom, - const char *path, - struct _virDomainInterfaceStats *stats) +openvzDomainInterfaceStats(virDomainPtr dom, + const char *path, + struct _virDomainInterfaceStats *stats) { struct openvz_driver *driver = dom->conn->privateData; virDomainObjPtr vm; @@ -1972,7 +1972,7 @@ openvzDomainInterfaceStats (virDomainPtr dom, /* Check the path is one of the domain's network interfaces. */ for (i = 0 ; i < vm->def->nnets ; i++) { if (vm->def->nets[i]->ifname && - STREQ (vm->def->nets[i]->ifname, path)) { + STREQ(vm->def->nets[i]->ifname, path)) { ret = 0; break; } diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index fb0fe54..7df2d74 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -821,7 +821,7 @@ virCapsPtr qemuCapsInit(qemuCapsCachePtr cache) }; /* Really, this never fails - look at the man-page. */ - uname (&utsname); + uname(&utsname); if ((caps = virCapabilitiesNew(utsname.machine, 1, 1)) == NULL) @@ -1552,7 +1552,7 @@ cleanup: static void -uname_normalize (struct utsname *ut) +uname_normalize(struct utsname *ut) { uname(ut); diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 239592c..b5daba3 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -121,7 +121,7 @@ VIR_ENUM_IMPL(qemuDomainFSDriver, VIR_DOMAIN_FS_DRIVER_TYPE_LAST, static void -uname_normalize (struct utsname *ut) +uname_normalize(struct utsname *ut) { uname(ut); @@ -1822,7 +1822,7 @@ qemuBuildIoEventFdStr(virBufferPtr buf, static int qemuSafeSerialParamValue(const char *value) { - if (strspn(value, QEMU_SERIAL_PARAM_ACCEPTED_CHARS) != strlen (value)) { + if (strspn(value, QEMU_SERIAL_PARAM_ACCEPTED_CHARS) != strlen(value)) { virReportError(VIR_ERR_INTERNAL_ERROR, _("driver serial '%s' contains unsafe characters"), value); @@ -8507,7 +8507,7 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps, } } else if (STREQ(arg, "-watchdog")) { WANT_VALUE(); - int model = virDomainWatchdogModelTypeFromString (val); + int model = virDomainWatchdogModelTypeFromString(val); if (model != -1) { virDomainWatchdogDefPtr wd; @@ -8519,7 +8519,7 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps, } } else if (STREQ(arg, "-watchdog-action") && def->watchdog) { WANT_VALUE(); - int action = virDomainWatchdogActionTypeFromString (val); + int action = virDomainWatchdogActionTypeFromString(val); if (action != -1) def->watchdog->action = action; diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 8f3922f..dc4d680 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -134,12 +134,12 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, /* Just check the file is readable before opening it, otherwise * libvirt emits an error. */ - if (access (filename, R_OK) == -1) { + if (access(filename, R_OK) == -1) { VIR_INFO("Could not read qemu config file %s", filename); return 0; } - conf = virConfReadFile (filename, 0); + conf = virConfReadFile(filename, 0); if (!conf) { return -1; } @@ -153,20 +153,20 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, return -1; \ } - p = virConfGetValue (conf, "vnc_auto_unix_socket"); - CHECK_TYPE ("vnc_auto_unix_socket", VIR_CONF_LONG); + p = virConfGetValue(conf, "vnc_auto_unix_socket"); + CHECK_TYPE("vnc_auto_unix_socket", VIR_CONF_LONG); if (p) driver->vncAutoUnixSocket = p->l; - p = virConfGetValue (conf, "vnc_tls"); - CHECK_TYPE ("vnc_tls", VIR_CONF_LONG); + p = virConfGetValue(conf, "vnc_tls"); + CHECK_TYPE("vnc_tls", VIR_CONF_LONG); if (p) driver->vncTLS = p->l; - p = virConfGetValue (conf, "vnc_tls_x509_verify"); - CHECK_TYPE ("vnc_tls_x509_verify", VIR_CONF_LONG); + p = virConfGetValue(conf, "vnc_tls_x509_verify"); + CHECK_TYPE("vnc_tls_x509_verify", VIR_CONF_LONG); if (p) driver->vncTLSx509verify = p->l; - p = virConfGetValue (conf, "vnc_tls_x509_cert_dir"); - CHECK_TYPE ("vnc_tls_x509_cert_dir", VIR_CONF_STRING); + p = virConfGetValue(conf, "vnc_tls_x509_cert_dir"); + CHECK_TYPE("vnc_tls_x509_cert_dir", VIR_CONF_STRING); if (p && p->str) { VIR_FREE(driver->vncTLSx509certdir); if (!(driver->vncTLSx509certdir = strdup(p->str))) { @@ -176,8 +176,8 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, } } - p = virConfGetValue (conf, "vnc_listen"); - CHECK_TYPE ("vnc_listen", VIR_CONF_STRING); + p = virConfGetValue(conf, "vnc_listen"); + CHECK_TYPE("vnc_listen", VIR_CONF_STRING); if (p && p->str) { VIR_FREE(driver->vncListen); if (!(driver->vncListen = strdup(p->str))) { @@ -187,8 +187,8 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, } } - p = virConfGetValue (conf, "vnc_password"); - CHECK_TYPE ("vnc_password", VIR_CONF_STRING); + p = virConfGetValue(conf, "vnc_password"); + CHECK_TYPE("vnc_password", VIR_CONF_STRING); if (p && p->str) { VIR_FREE(driver->vncPassword); if (!(driver->vncPassword = strdup(p->str))) { @@ -198,7 +198,7 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, } } - p = virConfGetValue (conf, "security_driver"); + p = virConfGetValue(conf, "security_driver"); if (p && p->type == VIR_CONF_LIST) { size_t len; virConfValuePtr pp; @@ -228,7 +228,7 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, } driver->securityDriverNames[len] = NULL; } else { - CHECK_TYPE ("security_driver", VIR_CONF_STRING); + CHECK_TYPE("security_driver", VIR_CONF_STRING); if (p && p->str) { if (VIR_ALLOC_N(driver->securityDriverNames, 2) < 0 || !(driver->securityDriverNames[0] = strdup(p->str))) { @@ -240,21 +240,21 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, } } - p = virConfGetValue (conf, "security_default_confined"); - CHECK_TYPE ("security_default_confined", VIR_CONF_LONG); + p = virConfGetValue(conf, "security_default_confined"); + CHECK_TYPE("security_default_confined", VIR_CONF_LONG); if (p) driver->securityDefaultConfined = p->l; - p = virConfGetValue (conf, "security_require_confined"); - CHECK_TYPE ("security_require_confined", VIR_CONF_LONG); + p = virConfGetValue(conf, "security_require_confined"); + CHECK_TYPE("security_require_confined", VIR_CONF_LONG); if (p) driver->securityRequireConfined = p->l; - p = virConfGetValue (conf, "vnc_sasl"); - CHECK_TYPE ("vnc_sasl", VIR_CONF_LONG); + p = virConfGetValue(conf, "vnc_sasl"); + CHECK_TYPE("vnc_sasl", VIR_CONF_LONG); if (p) driver->vncSASL = p->l; - p = virConfGetValue (conf, "vnc_sasl_dir"); - CHECK_TYPE ("vnc_sasl_dir", VIR_CONF_STRING); + p = virConfGetValue(conf, "vnc_sasl_dir"); + CHECK_TYPE("vnc_sasl_dir", VIR_CONF_STRING); if (p && p->str) { VIR_FREE(driver->vncSASLdir); if (!(driver->vncSASLdir = strdup(p->str))) { @@ -264,12 +264,12 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, } } - p = virConfGetValue (conf, "spice_tls"); - CHECK_TYPE ("spice_tls", VIR_CONF_LONG); + p = virConfGetValue(conf, "spice_tls"); + CHECK_TYPE("spice_tls", VIR_CONF_LONG); if (p) driver->spiceTLS = p->l; - p = virConfGetValue (conf, "spice_tls_x509_cert_dir"); - CHECK_TYPE ("spice_tls_x509_cert_dir", VIR_CONF_STRING); + p = virConfGetValue(conf, "spice_tls_x509_cert_dir"); + CHECK_TYPE("spice_tls_x509_cert_dir", VIR_CONF_STRING); if (p && p->str) { VIR_FREE(driver->spiceTLSx509certdir); if (!(driver->spiceTLSx509certdir = strdup(p->str))) { @@ -279,8 +279,8 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, } } - p = virConfGetValue (conf, "spice_listen"); - CHECK_TYPE ("spice_listen", VIR_CONF_STRING); + p = virConfGetValue(conf, "spice_listen"); + CHECK_TYPE("spice_listen", VIR_CONF_STRING); if (p && p->str) { VIR_FREE(driver->spiceListen); if (!(driver->spiceListen = strdup(p->str))) { @@ -290,8 +290,8 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, } } - p = virConfGetValue (conf, "spice_password"); - CHECK_TYPE ("spice_password", VIR_CONF_STRING); + p = virConfGetValue(conf, "spice_password"); + CHECK_TYPE("spice_password", VIR_CONF_STRING); if (p && p->str) { VIR_FREE(driver->spicePassword); if (!(driver->spicePassword = strdup(p->str))) { @@ -301,8 +301,8 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, } } - p = virConfGetValue (conf, "remote_display_port_min"); - CHECK_TYPE ("remote_display_port_min", VIR_CONF_LONG); + p = virConfGetValue(conf, "remote_display_port_min"); + CHECK_TYPE("remote_display_port_min", VIR_CONF_LONG); if (p) { if (p->l < QEMU_REMOTE_PORT_MIN) { /* if the port is too low, we can't get the display name @@ -317,8 +317,8 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, driver->remotePortMin = p->l; } - p = virConfGetValue (conf, "remote_display_port_max"); - CHECK_TYPE ("remote_display_port_max", VIR_CONF_LONG); + p = virConfGetValue(conf, "remote_display_port_max"); + CHECK_TYPE("remote_display_port_max", VIR_CONF_LONG); if (p) { if (p->l > QEMU_REMOTE_PORT_MAX || p->l < driver->remotePortMin) { @@ -342,8 +342,8 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, return -1; } - p = virConfGetValue (conf, "user"); - CHECK_TYPE ("user", VIR_CONF_STRING); + p = virConfGetValue(conf, "user"); + CHECK_TYPE("user", VIR_CONF_STRING); if (!(user = strdup(p && p->str ? p->str : QEMU_USER))) { virReportOOMError(); virConfFree(conf); @@ -357,8 +357,8 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, VIR_FREE(user); - p = virConfGetValue (conf, "group"); - CHECK_TYPE ("group", VIR_CONF_STRING); + p = virConfGetValue(conf, "group"); + CHECK_TYPE("group", VIR_CONF_STRING); if (!(group = strdup(p && p->str ? p->str : QEMU_GROUP))) { virReportOOMError(); virConfFree(conf); @@ -372,13 +372,13 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, VIR_FREE(group); - p = virConfGetValue (conf, "dynamic_ownership"); - CHECK_TYPE ("dynamic_ownership", VIR_CONF_LONG); + p = virConfGetValue(conf, "dynamic_ownership"); + CHECK_TYPE("dynamic_ownership", VIR_CONF_LONG); if (p) driver->dynamicOwnership = p->l; - p = virConfGetValue (conf, "cgroup_controllers"); - CHECK_TYPE ("cgroup_controllers", VIR_CONF_LIST); + p = virConfGetValue(conf, "cgroup_controllers"); + CHECK_TYPE("cgroup_controllers", VIR_CONF_LIST); if (p) { virConfValuePtr pp; for (i = 0, pp = p->list; pp; ++i, pp = pp->next) { @@ -412,8 +412,8 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, } } - p = virConfGetValue (conf, "cgroup_device_acl"); - CHECK_TYPE ("cgroup_device_acl", VIR_CONF_LIST); + p = virConfGetValue(conf, "cgroup_device_acl"); + CHECK_TYPE("cgroup_device_acl", VIR_CONF_LIST); if (p) { int len = 0; virConfValuePtr pp; @@ -430,7 +430,7 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, virConfFree(conf); return -1; } - driver->cgroupDeviceACL[i] = strdup (pp->str); + driver->cgroupDeviceACL[i] = strdup(pp->str); if (driver->cgroupDeviceACL[i] == NULL) { virReportOOMError(); virConfFree(conf); @@ -441,8 +441,8 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, driver->cgroupDeviceACL[i] = NULL; } - p = virConfGetValue (conf, "save_image_format"); - CHECK_TYPE ("save_image_format", VIR_CONF_STRING); + p = virConfGetValue(conf, "save_image_format"); + CHECK_TYPE("save_image_format", VIR_CONF_STRING); if (p && p->str) { VIR_FREE(driver->saveImageFormat); if (!(driver->saveImageFormat = strdup(p->str))) { @@ -452,8 +452,8 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, } } - p = virConfGetValue (conf, "dump_image_format"); - CHECK_TYPE ("dump_image_format", VIR_CONF_STRING); + p = virConfGetValue(conf, "dump_image_format"); + CHECK_TYPE("dump_image_format", VIR_CONF_STRING); if (p && p->str) { VIR_FREE(driver->dumpImageFormat); if (!(driver->dumpImageFormat = strdup(p->str))) { @@ -463,8 +463,8 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, } } - p = virConfGetValue (conf, "auto_dump_path"); - CHECK_TYPE ("auto_dump_path", VIR_CONF_STRING); + p = virConfGetValue(conf, "auto_dump_path"); + CHECK_TYPE("auto_dump_path", VIR_CONF_STRING); if (p && p->str) { VIR_FREE(driver->autoDumpPath); if (!(driver->autoDumpPath = strdup(p->str))) { @@ -474,16 +474,16 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, } } - p = virConfGetValue (conf, "auto_dump_bypass_cache"); - CHECK_TYPE ("auto_dump_bypass_cache", VIR_CONF_LONG); + p = virConfGetValue(conf, "auto_dump_bypass_cache"); + CHECK_TYPE("auto_dump_bypass_cache", VIR_CONF_LONG); if (p) driver->autoDumpBypassCache = true; - p = virConfGetValue (conf, "auto_start_bypass_cache"); - CHECK_TYPE ("auto_start_bypass_cache", VIR_CONF_LONG); + p = virConfGetValue(conf, "auto_start_bypass_cache"); + CHECK_TYPE("auto_start_bypass_cache", VIR_CONF_LONG); if (p) driver->autoStartBypassCache = true; - p = virConfGetValue (conf, "hugetlbfs_mount"); - CHECK_TYPE ("hugetlbfs_mount", VIR_CONF_STRING); + p = virConfGetValue(conf, "hugetlbfs_mount"); + CHECK_TYPE("hugetlbfs_mount", VIR_CONF_STRING); if (p && p->str) { VIR_FREE(driver->hugetlbfs_mount); if (!(driver->hugetlbfs_mount = strdup(p->str))) { @@ -493,8 +493,8 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, } } - p = virConfGetValue (conf, "mac_filter"); - CHECK_TYPE ("mac_filter", VIR_CONF_LONG); + p = virConfGetValue(conf, "mac_filter"); + CHECK_TYPE("mac_filter", VIR_CONF_LONG); if (p && p->l) { driver->macFilter = p->l; if (!(driver->ebtables = ebtablesContextNew("qemu"))) { @@ -515,24 +515,24 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, } } - p = virConfGetValue (conf, "relaxed_acs_check"); - CHECK_TYPE ("relaxed_acs_check", VIR_CONF_LONG); + p = virConfGetValue(conf, "relaxed_acs_check"); + CHECK_TYPE("relaxed_acs_check", VIR_CONF_LONG); if (p) driver->relaxedACS = p->l; - p = virConfGetValue (conf, "vnc_allow_host_audio"); - CHECK_TYPE ("vnc_allow_host_audio", VIR_CONF_LONG); + p = virConfGetValue(conf, "vnc_allow_host_audio"); + CHECK_TYPE("vnc_allow_host_audio", VIR_CONF_LONG); if (p) driver->vncAllowHostAudio = p->l; - p = virConfGetValue (conf, "clear_emulator_capabilities"); - CHECK_TYPE ("clear_emulator_capabilities", VIR_CONF_LONG); + p = virConfGetValue(conf, "clear_emulator_capabilities"); + CHECK_TYPE("clear_emulator_capabilities", VIR_CONF_LONG); if (p) driver->clearEmulatorCapabilities = p->l; - p = virConfGetValue (conf, "allow_disk_format_probing"); - CHECK_TYPE ("allow_disk_format_probing", VIR_CONF_LONG); + p = virConfGetValue(conf, "allow_disk_format_probing"); + CHECK_TYPE("allow_disk_format_probing", VIR_CONF_LONG); if (p) driver->allowDiskFormatProbing = p->l; - p = virConfGetValue (conf, "set_process_name"); - CHECK_TYPE ("set_process_name", VIR_CONF_LONG); + p = virConfGetValue(conf, "set_process_name"); + CHECK_TYPE("set_process_name", VIR_CONF_LONG); if (p) driver->setProcessName = p->l; p = virConfGetValue(conf, "max_processes"); @@ -543,8 +543,8 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, CHECK_TYPE("max_files", VIR_CONF_LONG); if (p) driver->maxFiles = p->l; - p = virConfGetValue (conf, "lock_manager"); - CHECK_TYPE ("lock_manager", VIR_CONF_STRING); + p = virConfGetValue(conf, "lock_manager"); + CHECK_TYPE("lock_manager", VIR_CONF_STRING); if (p && p->str) { char *lockConf; virLockManagerPluginUnref(driver->lockManager); @@ -575,7 +575,7 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, CHECK_TYPE("seccomp_sandbox", VIR_CONF_LONG); if (p) driver->seccompSandbox = p->l; - virConfFree (conf); + virConfFree(conf); return 0; } diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index fa37bfd..82dc2d8 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -635,7 +635,7 @@ qemudStartup(int privileged) { "%s/log/libvirt/qemu", LOCALSTATEDIR) == -1) goto out_of_memory; - if ((base = strdup (SYSCONFDIR "/libvirt")) == NULL) + if ((base = strdup(SYSCONFDIR "/libvirt")) == NULL) goto out_of_memory; if (virAsprintf(&qemu_driver->stateDir, @@ -1085,15 +1085,15 @@ static virDrvOpenStatus qemudOpen(virConnectPtr conn, } if (qemu_driver->privileged) { - if (STRNEQ (conn->uri->path, "/system") && - STRNEQ (conn->uri->path, "/session")) { + if (STRNEQ(conn->uri->path, "/system") && + STRNEQ(conn->uri->path, "/session")) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unexpected QEMU URI path '%s', try qemu:///system"), conn->uri->path); return VIR_DRV_OPEN_ERROR; } } else { - if (STRNEQ (conn->uri->path, "/session")) { + if (STRNEQ(conn->uri->path, "/session")) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unexpected QEMU URI path '%s', try qemu:///session"), conn->uri->path); @@ -1121,7 +1121,7 @@ static int qemudClose(virConnectPtr conn) { /* Which features are supported by this driver? */ static int -qemudSupportsFeature (virConnectPtr conn ATTRIBUTE_UNUSED, int feature) +qemudSupportsFeature(virConnectPtr conn ATTRIBUTE_UNUSED, int feature) { switch (feature) { case VIR_DRV_FEATURE_MIGRATION_V2: @@ -8666,9 +8666,9 @@ cleanup: #ifdef __linux__ static int -qemudDomainInterfaceStats (virDomainPtr dom, - const char *path, - struct _virDomainInterfaceStats *stats) +qemudDomainInterfaceStats(virDomainPtr dom, + const char *path, + struct _virDomainInterfaceStats *stats) { struct qemud_driver *driver = dom->conn->privateData; virDomainObjPtr vm; @@ -8696,7 +8696,7 @@ qemudDomainInterfaceStats (virDomainPtr dom, /* Check the path is one of the domain's network interfaces. */ for (i = 0 ; i < vm->def->nnets ; i++) { if (vm->def->nets[i]->ifname && - STREQ (vm->def->nets[i]->ifname, path)) { + STREQ(vm->def->nets[i]->ifname, path)) { ret = 0; break; } @@ -8715,9 +8715,9 @@ cleanup: } #else static int -qemudDomainInterfaceStats (virDomainPtr dom, - const char *path ATTRIBUTE_UNUSED, - struct _virDomainInterfaceStats *stats ATTRIBUTE_UNUSED) +qemudDomainInterfaceStats(virDomainPtr dom, + const char *path ATTRIBUTE_UNUSED, + struct _virDomainInterfaceStats *stats ATTRIBUTE_UNUSED) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("interface stats not implemented on this platform")); @@ -9022,10 +9022,10 @@ cleanup: } static int -qemudDomainMemoryStats (virDomainPtr dom, - struct _virDomainMemoryStat *stats, - unsigned int nr_stats, - unsigned int flags) +qemudDomainMemoryStats(virDomainPtr dom, + struct _virDomainMemoryStat *stats, + unsigned int nr_stats, + unsigned int flags) { struct qemud_driver *driver = dom->conn->privateData; virDomainObjPtr vm; @@ -9081,11 +9081,11 @@ cleanup: } static int -qemudDomainBlockPeek (virDomainPtr dom, - const char *path, - unsigned long long offset, size_t size, - void *buffer, - unsigned int flags) +qemudDomainBlockPeek(virDomainPtr dom, + const char *path, + unsigned long long offset, size_t size, + void *buffer, + unsigned int flags) { struct qemud_driver *driver = dom->conn->privateData; virDomainObjPtr vm; @@ -9149,10 +9149,10 @@ cleanup: } static int -qemudDomainMemoryPeek (virDomainPtr dom, - unsigned long long offset, size_t size, - void *buffer, - unsigned int flags) +qemudDomainMemoryPeek(virDomainPtr dom, + unsigned long long offset, size_t size, + void *buffer, + unsigned int flags) { struct qemud_driver *driver = dom->conn->privateData; virDomainObjPtr vm; @@ -9195,7 +9195,7 @@ qemudDomainMemoryPeek (virDomainPtr dom, } /* Create a temporary filename. */ - if ((fd = mkstemp (tmp)) == -1) { + if ((fd = mkstemp(tmp)) == -1) { virReportSystemError(errno, _("mkstemp(\"%s\") failed"), tmp); goto endjob; @@ -9543,16 +9543,16 @@ cleanup: * * This starts an empty VM listening on a TCP port. */ -static int ATTRIBUTE_NONNULL (5) -qemudDomainMigratePrepare2 (virConnectPtr dconn, - char **cookie ATTRIBUTE_UNUSED, - int *cookielen ATTRIBUTE_UNUSED, - const char *uri_in, - char **uri_out, - unsigned long flags, - const char *dname, - unsigned long resource ATTRIBUTE_UNUSED, - const char *dom_xml) +static int ATTRIBUTE_NONNULL(5) +qemudDomainMigratePrepare2(virConnectPtr dconn, + char **cookie ATTRIBUTE_UNUSED, + int *cookielen ATTRIBUTE_UNUSED, + const char *uri_in, + char **uri_out, + unsigned long flags, + const char *dname, + unsigned long resource ATTRIBUTE_UNUSED, + const char *dom_xml) { struct qemud_driver *driver = dconn->privateData; int ret = -1; @@ -9602,13 +9602,13 @@ cleanup: /* Perform is the second step, and it runs on the source host. */ static int -qemudDomainMigratePerform (virDomainPtr dom, - const char *cookie, - int cookielen, - const char *uri, - unsigned long flags, - const char *dname, - unsigned long resource) +qemudDomainMigratePerform(virDomainPtr dom, + const char *cookie, + int cookielen, + const char *uri, + unsigned long flags, + const char *dname, + unsigned long resource) { struct qemud_driver *driver = dom->conn->privateData; virDomainObjPtr vm; @@ -9658,13 +9658,13 @@ cleanup: /* Finish is the third and final step, and it runs on the destination host. */ static virDomainPtr -qemudDomainMigrateFinish2 (virConnectPtr dconn, - const char *dname, - const char *cookie ATTRIBUTE_UNUSED, - int cookielen ATTRIBUTE_UNUSED, - const char *uri ATTRIBUTE_UNUSED, - unsigned long flags, - int retcode) +qemudDomainMigrateFinish2(virConnectPtr dconn, + const char *dname, + const char *cookie ATTRIBUTE_UNUSED, + int cookielen ATTRIBUTE_UNUSED, + const char *uri ATTRIBUTE_UNUSED, + unsigned long flags, + int retcode) { struct qemud_driver *driver = dconn->privateData; virDomainObjPtr vm; @@ -10016,11 +10016,11 @@ cleanup: static int -qemudNodeDeviceGetPciInfo (virNodeDevicePtr dev, - unsigned *domain, - unsigned *bus, - unsigned *slot, - unsigned *function) +qemudNodeDeviceGetPciInfo(virNodeDevicePtr dev, + unsigned *domain, + unsigned *bus, + unsigned *slot, + unsigned *function) { virNodeDeviceDefPtr def = NULL; virNodeDevCapsDefPtr cap; @@ -10062,7 +10062,7 @@ out: } static int -qemudNodeDeviceDettach (virNodeDevicePtr dev) +qemudNodeDeviceDettach(virNodeDevicePtr dev) { struct qemud_driver *driver = dev->conn->privateData; pciDevice *pci; @@ -10093,7 +10093,7 @@ out: } static int -qemudNodeDeviceReAttach (virNodeDevicePtr dev) +qemudNodeDeviceReAttach(virNodeDevicePtr dev) { struct qemud_driver *driver = dev->conn->privateData; pciDevice *pci; @@ -10137,7 +10137,7 @@ out: } static int -qemudNodeDeviceReset (virNodeDevicePtr dev) +qemudNodeDeviceReset(virNodeDevicePtr dev) { struct qemud_driver *driver = dev->conn->privateData; pciDevice *pci; diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 25540bd..b42ca98 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -490,7 +490,7 @@ int qemuDomainAttachSCSIDisk(virConnectPtr conn, /* Tell clang that "cont" is non-NULL. This is because disk->info.addr.driver.controller is unsigned, and hence the above loop must iterate at least once. */ - sa_assert (cont); + sa_assert(cont); if (cont->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -714,7 +714,7 @@ int qemuDomainAttachNetDevice(virConnectPtr conn, */ if (actualType == VIR_DOMAIN_NET_TYPE_NETWORK || driver->privileged || - (!qemuCapsGet (priv->caps, QEMU_CAPS_NETDEV_BRIDGE))) { + (!qemuCapsGet(priv->caps, QEMU_CAPS_NETDEV_BRIDGE))) { if ((tapfd = qemuNetworkIfaceConnect(vm->def, conn, driver, net, priv->caps)) < 0) goto cleanup; diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 68d614d..88a8bfd 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1519,7 +1519,7 @@ qemuMigrationPrepareDirect(struct qemud_driver *driver, * URI when passing it to the qemu monitor, so bad * characters in hostname part don't matter. */ - if (!STRPREFIX (uri_in, "tcp:")) { + if (!STRPREFIX(uri_in, "tcp:")) { virReportError(VIR_ERR_INVALID_ARG, "%s", _("only tcp URIs are supported for KVM/QEMU" " migrations")); @@ -1527,7 +1527,7 @@ qemuMigrationPrepareDirect(struct qemud_driver *driver, } /* Get the port number. */ - p = strrchr (uri_in, ':'); + p = strrchr(uri_in, ':'); if (p == strchr(uri_in, ':')) { /* Generate a port */ this_port = QEMUD_MIGRATION_FIRST_PORT + port++; @@ -1542,8 +1542,8 @@ qemuMigrationPrepareDirect(struct qemud_driver *driver, } else { p++; /* definitely has a ':' in it, see above */ - this_port = virParseNumber (&p); - if (this_port == -1 || p-uri_in != strlen (uri_in)) { + this_port = virParseNumber(&p); + if (this_port == -1 || p-uri_in != strlen(uri_in)) { virReportError(VIR_ERR_INVALID_ARG, "%s", _("URI ended with incorrect ':port'")); goto cleanup; @@ -3056,7 +3056,7 @@ qemuMigrationFinish(struct qemud_driver *driver, } } - dom = virGetDomain (dconn, vm->def->name, vm->def->uuid); + dom = virGetDomain(dconn, vm->def->name, vm->def->uuid); event = virDomainEventNewFromObj(vm, VIR_DOMAIN_EVENT_RESUMED, diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c index 09f2a92..dc8d1bd 100644 --- a/src/qemu/qemu_monitor_text.c +++ b/src/qemu/qemu_monitor_text.c @@ -609,10 +609,10 @@ static int parseMemoryStat(char **text, unsigned int tag, char *dummy; unsigned long long value; - if (STRPREFIX (*text, search)) { + if (STRPREFIX(*text, search)) { *text += strlen(search); if (virStrToLong_ull (*text, &dummy, 10, &value)) { - VIR_DEBUG ("error reading %s: %s", search, *text); + VIR_DEBUG("error reading %s: %s", search, *text); return 0; } @@ -675,7 +675,7 @@ static int qemuMonitorParseBalloonInfo(char *text, */ if (*p == ',') p++; - p = strchr (p, ','); + p = strchr(p, ','); if (!p) break; } return nr_stats_found; @@ -877,7 +877,7 @@ int qemuMonitorTextGetBlockStatsInfo(qemuMonitorPtr mon, const char *p, *eol; int devnamelen = strlen(dev_name); - if (qemuMonitorHMPCommand (mon, "info blockstats", &info) < 0) + if (qemuMonitorHMPCommand(mon, "info blockstats", &info) < 0) goto cleanup; /* If the command isn't supported then qemu prints the supported @@ -919,58 +919,58 @@ int qemuMonitorTextGetBlockStatsInfo(qemuMonitorPtr mon, if (STRPREFIX(p, QEMU_DRIVE_HOST_PREFIX)) p += strlen(QEMU_DRIVE_HOST_PREFIX); - if (STREQLEN (p, dev_name, devnamelen) + if (STREQLEN(p, dev_name, devnamelen) && p[devnamelen] == ':' && p[devnamelen+1] == ' ') { - eol = strchr (p, '\n'); + eol = strchr(p, '\n'); if (!eol) - eol = p + strlen (p); + eol = p + strlen(p); p += devnamelen+2; /* Skip to first label. */ while (*p) { - if (STRPREFIX (p, "rd_bytes=")) { + if (STRPREFIX(p, "rd_bytes=")) { p += strlen("rd_bytes="); - if (virStrToLong_ll (p, &dummy, 10, rd_bytes) == -1) - VIR_DEBUG ("error reading rd_bytes: %s", p); - } else if (STRPREFIX (p, "wr_bytes=")) { + if (virStrToLong_ll(p, &dummy, 10, rd_bytes) == -1) + VIR_DEBUG("error reading rd_bytes: %s", p); + } else if (STRPREFIX(p, "wr_bytes=")) { p += strlen("wr_bytes="); - if (virStrToLong_ll (p, &dummy, 10, wr_bytes) == -1) - VIR_DEBUG ("error reading wr_bytes: %s", p); - } else if (STRPREFIX (p, "rd_operations=")) { + if (virStrToLong_ll(p, &dummy, 10, wr_bytes) == -1) + VIR_DEBUG("error reading wr_bytes: %s", p); + } else if (STRPREFIX(p, "rd_operations=")) { p += strlen("rd_operations="); - if (virStrToLong_ll (p, &dummy, 10, rd_req) == -1) - VIR_DEBUG ("error reading rd_req: %s", p); - } else if (STRPREFIX (p, "wr_operations=")) { + if (virStrToLong_ll(p, &dummy, 10, rd_req) == -1) + VIR_DEBUG("error reading rd_req: %s", p); + } else if (STRPREFIX(p, "wr_operations=")) { p += strlen("wr_operations="); - if (virStrToLong_ll (p, &dummy, 10, wr_req) == -1) - VIR_DEBUG ("error reading wr_req: %s", p); + if (virStrToLong_ll(p, &dummy, 10, wr_req) == -1) + VIR_DEBUG("error reading wr_req: %s", p); } else if (rd_total_times && - STRPREFIX (p, "rd_total_time_ns=")) { + STRPREFIX(p, "rd_total_time_ns=")) { p += strlen("rd_total_time_ns="); - if (virStrToLong_ll (p, &dummy, 10, rd_total_times) == -1) - VIR_DEBUG ("error reading rd_total_times: %s", p); + if (virStrToLong_ll(p, &dummy, 10, rd_total_times) == -1) + VIR_DEBUG("error reading rd_total_times: %s", p); } else if (wr_total_times && - STRPREFIX (p, "wr_total_time_ns=")) { + STRPREFIX(p, "wr_total_time_ns=")) { p += strlen("wr_total_time_ns="); - if (virStrToLong_ll (p, &dummy, 10, wr_total_times) == -1) - VIR_DEBUG ("error reading wr_total_times: %s", p); + if (virStrToLong_ll(p, &dummy, 10, wr_total_times) == -1) + VIR_DEBUG("error reading wr_total_times: %s", p); } else if (flush_req && - STRPREFIX (p, "flush_operations=")) { + STRPREFIX(p, "flush_operations=")) { p += strlen("flush_operations="); - if (virStrToLong_ll (p, &dummy, 10, flush_req) == -1) - VIR_DEBUG ("error reading flush_req: %s", p); + if (virStrToLong_ll(p, &dummy, 10, flush_req) == -1) + VIR_DEBUG("error reading flush_req: %s", p); } else if (flush_total_times && - STRPREFIX (p, "flush_total_time_ns=")) { + STRPREFIX(p, "flush_total_time_ns=")) { p += strlen("flush_total_time_ns="); - if (virStrToLong_ll (p, &dummy, 10, flush_total_times) == -1) - VIR_DEBUG ("error reading flush_total_times: %s", p); + if (virStrToLong_ll(p, &dummy, 10, flush_total_times) == -1) + VIR_DEBUG("error reading flush_total_times: %s", p); } else { - VIR_DEBUG ("unknown block stat near %s", p); + VIR_DEBUG("unknown block stat near %s", p); } /* Skip to next label. */ - p = strchr (p, ' '); + p = strchr(p, ' '); if (!p || p >= eol) break; p++; } @@ -979,14 +979,14 @@ int qemuMonitorTextGetBlockStatsInfo(qemuMonitorPtr mon, } /* Skip to next line. */ - p = strchr (p, '\n'); + p = strchr(p, '\n'); if (!p) break; p++; } /* If we reach here then the device was not found. */ - virReportError (VIR_ERR_INVALID_ARG, - _("no stats found for device %s"), dev_name); + virReportError(VIR_ERR_INVALID_ARG, + _("no stats found for device %s"), dev_name); cleanup: VIR_FREE(info); @@ -1001,7 +1001,7 @@ int qemuMonitorTextGetBlockStatsParamsNumber(qemuMonitorPtr mon, int num = 0; const char *p, *eol; - if (qemuMonitorHMPCommand (mon, "info blockstats", &info) < 0) + if (qemuMonitorHMPCommand(mon, "info blockstats", &info) < 0) goto cleanup; /* If the command isn't supported then qemu prints the supported @@ -1023,9 +1023,9 @@ int qemuMonitorTextGetBlockStatsParamsNumber(qemuMonitorPtr mon, */ p = info; - eol = strchr (p, '\n'); + eol = strchr(p, '\n'); if (!eol) - eol = p + strlen (p); + eol = p + strlen(p); /* Skip the device name and following ":", and spaces (e.g. * "floppy0: ") @@ -1033,17 +1033,17 @@ int qemuMonitorTextGetBlockStatsParamsNumber(qemuMonitorPtr mon, p = strchr(p, ' '); while (p && p < eol) { - if (STRPREFIX (p, " rd_bytes=") || - STRPREFIX (p, " wr_bytes=") || - STRPREFIX (p, " rd_operations=") || - STRPREFIX (p, " wr_operations=") || - STRPREFIX (p, " rd_total_time_ns=") || - STRPREFIX (p, " wr_total_time_ns=") || - STRPREFIX (p, " flush_operations=") || - STRPREFIX (p, " flush_total_time_ns=")) { + if (STRPREFIX(p, " rd_bytes=") || + STRPREFIX(p, " wr_bytes=") || + STRPREFIX(p, " rd_operations=") || + STRPREFIX(p, " wr_operations=") || + STRPREFIX(p, " rd_total_time_ns=") || + STRPREFIX(p, " wr_total_time_ns=") || + STRPREFIX(p, " flush_operations=") || + STRPREFIX(p, " flush_total_time_ns=")) { num++; } else { - VIR_DEBUG ("unknown block stat near %s", p); + VIR_DEBUG("unknown block stat near %s", p); } /* Skip to next label. */ @@ -3235,7 +3235,7 @@ qemuMonitorTextParseBlockIoThrottle(const char *result, } /* Skip to next label. */ - p = strchr (p, ' '); + p = strchr(p, ' '); if (!p || p >= eol) break; p++; @@ -3245,7 +3245,7 @@ qemuMonitorTextParseBlockIoThrottle(const char *result, } /* Skip to next line. */ - p = strchr (p, '\n'); + p = strchr(p, '\n'); if (!p) break; p++; diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 3253de7..21a5aa4 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -114,39 +114,39 @@ static int callWithFD(virConnectPtr conn, struct private_data *priv, unsigned int flags, int fd, int proc_nr, xdrproc_t args_filter, char *args, xdrproc_t ret_filter, char *ret); -static int remoteAuthenticate (virConnectPtr conn, struct private_data *priv, - virConnectAuthPtr auth, const char *authtype); +static int remoteAuthenticate(virConnectPtr conn, struct private_data *priv, + virConnectAuthPtr auth, const char *authtype); #if HAVE_SASL -static int remoteAuthSASL (virConnectPtr conn, struct private_data *priv, - virConnectAuthPtr auth, const char *mech); +static int remoteAuthSASL(virConnectPtr conn, struct private_data *priv, + virConnectAuthPtr auth, const char *mech); #endif #if HAVE_POLKIT -static int remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, - virConnectAuthPtr auth); +static int remoteAuthPolkit(virConnectPtr conn, struct private_data *priv, + virConnectAuthPtr auth); #endif /* HAVE_POLKIT */ -static virDomainPtr get_nonnull_domain (virConnectPtr conn, remote_nonnull_domain domain); -static virNetworkPtr get_nonnull_network (virConnectPtr conn, remote_nonnull_network network); -static virNWFilterPtr get_nonnull_nwfilter (virConnectPtr conn, remote_nonnull_nwfilter nwfilter); -static virInterfacePtr get_nonnull_interface (virConnectPtr conn, remote_nonnull_interface iface); -static virStoragePoolPtr get_nonnull_storage_pool (virConnectPtr conn, remote_nonnull_storage_pool pool); -static virStorageVolPtr get_nonnull_storage_vol (virConnectPtr conn, remote_nonnull_storage_vol vol); -static virNodeDevicePtr get_nonnull_node_device (virConnectPtr conn, remote_nonnull_node_device dev); -static virSecretPtr get_nonnull_secret (virConnectPtr conn, remote_nonnull_secret secret); -static virDomainSnapshotPtr get_nonnull_domain_snapshot (virDomainPtr domain, remote_nonnull_domain_snapshot snapshot); -static void make_nonnull_domain (remote_nonnull_domain *dom_dst, virDomainPtr dom_src); -static void make_nonnull_network (remote_nonnull_network *net_dst, virNetworkPtr net_src); -static void make_nonnull_interface (remote_nonnull_interface *interface_dst, virInterfacePtr interface_src); -static void make_nonnull_storage_pool (remote_nonnull_storage_pool *pool_dst, virStoragePoolPtr vol_src); -static void make_nonnull_storage_vol (remote_nonnull_storage_vol *vol_dst, virStorageVolPtr vol_src); -static void make_nonnull_secret (remote_nonnull_secret *secret_dst, virSecretPtr secret_src); -static void make_nonnull_nwfilter (remote_nonnull_nwfilter *nwfilter_dst, virNWFilterPtr nwfilter_src); -static void make_nonnull_domain_snapshot (remote_nonnull_domain_snapshot *snapshot_dst, virDomainSnapshotPtr snapshot_src); +static virDomainPtr get_nonnull_domain(virConnectPtr conn, remote_nonnull_domain domain); +static virNetworkPtr get_nonnull_network(virConnectPtr conn, remote_nonnull_network network); +static virNWFilterPtr get_nonnull_nwfilter(virConnectPtr conn, remote_nonnull_nwfilter nwfilter); +static virInterfacePtr get_nonnull_interface(virConnectPtr conn, remote_nonnull_interface iface); +static virStoragePoolPtr get_nonnull_storage_pool(virConnectPtr conn, remote_nonnull_storage_pool pool); +static virStorageVolPtr get_nonnull_storage_vol(virConnectPtr conn, remote_nonnull_storage_vol vol); +static virNodeDevicePtr get_nonnull_node_device(virConnectPtr conn, remote_nonnull_node_device dev); +static virSecretPtr get_nonnull_secret(virConnectPtr conn, remote_nonnull_secret secret); +static virDomainSnapshotPtr get_nonnull_domain_snapshot(virDomainPtr domain, remote_nonnull_domain_snapshot snapshot); +static void make_nonnull_domain(remote_nonnull_domain *dom_dst, virDomainPtr dom_src); +static void make_nonnull_network(remote_nonnull_network *net_dst, virNetworkPtr net_src); +static void make_nonnull_interface(remote_nonnull_interface *interface_dst, virInterfacePtr interface_src); +static void make_nonnull_storage_pool(remote_nonnull_storage_pool *pool_dst, virStoragePoolPtr vol_src); +static void make_nonnull_storage_vol(remote_nonnull_storage_vol *vol_dst, virStorageVolPtr vol_src); +static void make_nonnull_secret(remote_nonnull_secret *secret_dst, virSecretPtr secret_src); +static void make_nonnull_nwfilter(remote_nonnull_nwfilter *nwfilter_dst, virNWFilterPtr nwfilter_src); +static void make_nonnull_domain_snapshot(remote_nonnull_domain_snapshot *snapshot_dst, virDomainSnapshotPtr snapshot_src); static void remoteDomainEventQueue(struct private_data *priv, virDomainEventPtr event); /*----------------------------------------------------------------------*/ /* Helper functions for remoteOpen. */ -static char *get_transport_from_scheme (char *scheme); +static char *get_transport_from_scheme(char *scheme); #ifdef WITH_LIBVIRTD static int @@ -503,7 +503,7 @@ doRemoteOpen(virConnectPtr conn, goto no_memory; if (conn->uri && conn->uri->user && - !(username = strdup (conn->uri->user))) + !(username = strdup(conn->uri->user))) goto no_memory; /* Get the variables from the query string. @@ -907,9 +907,9 @@ remoteOpenSecondaryDriver(virConnectPtr conn, } static virDrvOpenStatus -remoteOpen (virConnectPtr conn, - virConnectAuthPtr auth, - unsigned int flags) +remoteOpen(virConnectPtr conn, + virConnectAuthPtr auth, + unsigned int flags) { struct private_data *priv; int ret, rflags = 0; @@ -1033,7 +1033,7 @@ remoteClose(virConnectPtr conn) conn->privateData = NULL; remoteDriverUnlock(priv); virMutexDestroy(&priv->lock); - VIR_FREE (priv); + VIR_FREE(priv); } if (priv) remoteDriverUnlock(priv); @@ -1223,7 +1223,7 @@ remoteNodeGetMemoryStats(virConnectPtr conn, args.cellNum = cellNum; args.flags = flags; - memset (&ret, 0, sizeof(ret)); + memset(&ret, 0, sizeof(ret)); if (call(conn, priv, 0, REMOTE_PROC_NODE_GET_MEMORY_STATS, (xdrproc_t) xdr_remote_node_get_memory_stats_args, (char *) &args, (xdrproc_t) xdr_remote_node_get_memory_stats_ret, (char *) &ret) == -1) @@ -1456,7 +1456,7 @@ remoteSerializeTypedParameters(virTypedParameterPtr params, for (i = 0; i < nparams; ++i) { /* call() will free this: */ - val[i].field = strdup (params[i].field); + val[i].field = strdup(params[i].field); if (val[i].field == NULL) { virReportOOMError(); goto cleanup; @@ -1629,15 +1629,15 @@ remoteDomainBlockStatsFlags(virDomainPtr domain, remoteDriverLock(priv); - make_nonnull_domain (&args.dom, domain); + make_nonnull_domain(&args.dom, domain); args.nparams = *nparams; args.path = (char *) path; args.flags = flags; - memset (&ret, 0, sizeof(ret)); - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_BLOCK_STATS_FLAGS, - (xdrproc_t) xdr_remote_domain_block_stats_flags_args, (char *) &args, - (xdrproc_t) xdr_remote_domain_block_stats_flags_ret, (char *) &ret) == -1) + memset(&ret, 0, sizeof(ret)); + if (call(domain->conn, priv, 0, REMOTE_PROC_DOMAIN_BLOCK_STATS_FLAGS, + (xdrproc_t) xdr_remote_domain_block_stats_flags_args, (char *) &args, + (xdrproc_t) xdr_remote_domain_block_stats_flags_ret, (char *) &ret) == -1) goto done; /* Check the length of the returned list carefully. */ @@ -1671,17 +1671,17 @@ remoteDomainBlockStatsFlags(virDomainPtr domain, rv = 0; cleanup: - xdr_free ((xdrproc_t) xdr_remote_domain_block_stats_flags_ret, - (char *) &ret); + xdr_free((xdrproc_t) xdr_remote_domain_block_stats_flags_ret, + (char *) &ret); done: remoteDriverUnlock(priv); return rv; } static int -remoteDomainGetMemoryParameters (virDomainPtr domain, - virTypedParameterPtr params, int *nparams, - unsigned int flags) +remoteDomainGetMemoryParameters(virDomainPtr domain, + virTypedParameterPtr params, int *nparams, + unsigned int flags) { int rv = -1; remote_domain_get_memory_parameters_args args; @@ -1690,14 +1690,14 @@ remoteDomainGetMemoryParameters (virDomainPtr domain, remoteDriverLock(priv); - make_nonnull_domain (&args.dom, domain); + make_nonnull_domain(&args.dom, domain); args.nparams = *nparams; args.flags = flags; - memset (&ret, 0, sizeof(ret)); - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_MEMORY_PARAMETERS, - (xdrproc_t) xdr_remote_domain_get_memory_parameters_args, (char *) &args, - (xdrproc_t) xdr_remote_domain_get_memory_parameters_ret, (char *) &ret) == -1) + memset(&ret, 0, sizeof(ret)); + if (call(domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_MEMORY_PARAMETERS, + (xdrproc_t) xdr_remote_domain_get_memory_parameters_args, (char *) &args, + (xdrproc_t) xdr_remote_domain_get_memory_parameters_ret, (char *) &ret) == -1) goto done; /* Handle the case when the caller does not know the number of parameters @@ -1719,17 +1719,17 @@ remoteDomainGetMemoryParameters (virDomainPtr domain, rv = 0; cleanup: - xdr_free ((xdrproc_t) xdr_remote_domain_get_memory_parameters_ret, - (char *) &ret); + xdr_free((xdrproc_t) xdr_remote_domain_get_memory_parameters_ret, + (char *) &ret); done: remoteDriverUnlock(priv); return rv; } static int -remoteDomainGetNumaParameters (virDomainPtr domain, - virTypedParameterPtr params, int *nparams, - unsigned int flags) +remoteDomainGetNumaParameters(virDomainPtr domain, + virTypedParameterPtr params, int *nparams, + unsigned int flags) { int rv = -1; remote_domain_get_numa_parameters_args args; @@ -1738,14 +1738,14 @@ remoteDomainGetNumaParameters (virDomainPtr domain, remoteDriverLock(priv); - make_nonnull_domain (&args.dom, domain); + make_nonnull_domain(&args.dom, domain); args.nparams = *nparams; args.flags = flags; - memset (&ret, 0, sizeof(ret)); - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_NUMA_PARAMETERS, - (xdrproc_t) xdr_remote_domain_get_numa_parameters_args, (char *) &args, - (xdrproc_t) xdr_remote_domain_get_numa_parameters_ret, (char *) &ret) == -1) + memset(&ret, 0, sizeof(ret)); + if (call(domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_NUMA_PARAMETERS, + (xdrproc_t) xdr_remote_domain_get_numa_parameters_args, (char *) &args, + (xdrproc_t) xdr_remote_domain_get_numa_parameters_ret, (char *) &ret) == -1) goto done; /* Handle the case when the caller does not know the number of parameters @@ -1767,17 +1767,17 @@ remoteDomainGetNumaParameters (virDomainPtr domain, rv = 0; cleanup: - xdr_free ((xdrproc_t) xdr_remote_domain_get_numa_parameters_ret, - (char *) &ret); + xdr_free((xdrproc_t) xdr_remote_domain_get_numa_parameters_ret, + (char *) &ret); done: remoteDriverUnlock(priv); return rv; } static int -remoteDomainGetBlkioParameters (virDomainPtr domain, - virTypedParameterPtr params, int *nparams, - unsigned int flags) +remoteDomainGetBlkioParameters(virDomainPtr domain, + virTypedParameterPtr params, int *nparams, + unsigned int flags) { int rv = -1; remote_domain_get_blkio_parameters_args args; @@ -1786,14 +1786,14 @@ remoteDomainGetBlkioParameters (virDomainPtr domain, remoteDriverLock(priv); - make_nonnull_domain (&args.dom, domain); + make_nonnull_domain(&args.dom, domain); args.nparams = *nparams; args.flags = flags; - memset (&ret, 0, sizeof(ret)); - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_BLKIO_PARAMETERS, - (xdrproc_t) xdr_remote_domain_get_blkio_parameters_args, (char *) &args, - (xdrproc_t) xdr_remote_domain_get_blkio_parameters_ret, (char *) &ret) == -1) + memset(&ret, 0, sizeof(ret)); + if (call(domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_BLKIO_PARAMETERS, + (xdrproc_t) xdr_remote_domain_get_blkio_parameters_args, (char *) &args, + (xdrproc_t) xdr_remote_domain_get_blkio_parameters_ret, (char *) &ret) == -1) goto done; /* Handle the case when the caller does not know the number of parameters @@ -1815,19 +1815,19 @@ remoteDomainGetBlkioParameters (virDomainPtr domain, rv = 0; cleanup: - xdr_free ((xdrproc_t) xdr_remote_domain_get_blkio_parameters_ret, - (char *) &ret); + xdr_free((xdrproc_t) xdr_remote_domain_get_blkio_parameters_ret, + (char *) &ret); done: remoteDriverUnlock(priv); return rv; } static int -remoteDomainGetVcpuPinInfo (virDomainPtr domain, - int ncpumaps, - unsigned char *cpumaps, - int maplen, - unsigned int flags) +remoteDomainGetVcpuPinInfo(virDomainPtr domain, + int ncpumaps, + unsigned char *cpumaps, + int maplen, + unsigned int flags) { int rv = -1; int i; @@ -1852,18 +1852,18 @@ remoteDomainGetVcpuPinInfo (virDomainPtr domain, goto done; } - make_nonnull_domain (&args.dom, domain); + make_nonnull_domain(&args.dom, domain); args.ncpumaps = ncpumaps; args.maplen = maplen; args.flags = flags; - memset (&ret, 0, sizeof(ret)); + memset(&ret, 0, sizeof(ret)); - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_VCPU_PIN_INFO, - (xdrproc_t) xdr_remote_domain_get_vcpu_pin_info_args, - (char *) &args, - (xdrproc_t) xdr_remote_domain_get_vcpu_pin_info_ret, - (char *) &ret) == -1) + if (call(domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_VCPU_PIN_INFO, + (xdrproc_t) xdr_remote_domain_get_vcpu_pin_info_args, + (char *) &args, + (xdrproc_t) xdr_remote_domain_get_vcpu_pin_info_ret, + (char *) &ret) == -1) goto done; if (ret.num > ncpumaps) { @@ -1880,7 +1880,7 @@ remoteDomainGetVcpuPinInfo (virDomainPtr domain, goto cleanup; } - memset (cpumaps, 0, ncpumaps * maplen); + memset(cpumaps, 0, ncpumaps * maplen); for (i = 0; i < ret.cpumaps.cpumaps_len; ++i) cpumaps[i] = ret.cpumaps.cpumaps_val[i]; @@ -1888,7 +1888,7 @@ remoteDomainGetVcpuPinInfo (virDomainPtr domain, rv = ret.num; cleanup: - xdr_free ((xdrproc_t) xdr_remote_domain_get_vcpu_pin_info_ret, (char *) &ret); + xdr_free((xdrproc_t) xdr_remote_domain_get_vcpu_pin_info_ret, (char *) &ret); done: remoteDriverUnlock(priv); @@ -1896,10 +1896,10 @@ done: } static int -remoteDomainPinEmulator (virDomainPtr dom, - unsigned char *cpumap, - int cpumaplen, - unsigned int flags) +remoteDomainPinEmulator(virDomainPtr dom, + unsigned char *cpumap, + int cpumaplen, + unsigned int flags) { int rv = -1; struct private_data *priv = dom->conn->privateData; @@ -1935,10 +1935,10 @@ done: static int -remoteDomainGetEmulatorPinInfo (virDomainPtr domain, - unsigned char *cpumaps, - int maplen, - unsigned int flags) +remoteDomainGetEmulatorPinInfo(virDomainPtr domain, + unsigned char *cpumaps, + int maplen, + unsigned int flags) { int rv = -1; int i; @@ -1962,11 +1962,11 @@ remoteDomainGetEmulatorPinInfo (virDomainPtr domain, memset(&ret, 0, sizeof(ret)); - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_EMULATOR_PIN_INFO, - (xdrproc_t) xdr_remote_domain_get_emulator_pin_info_args, - (char *) &args, - (xdrproc_t) xdr_remote_domain_get_emulator_pin_info_ret, - (char *) &ret) == -1) + if (call(domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_EMULATOR_PIN_INFO, + (xdrproc_t) xdr_remote_domain_get_emulator_pin_info_args, + (char *) &args, + (xdrproc_t) xdr_remote_domain_get_emulator_pin_info_ret, + (char *) &ret) == -1) goto done; if (ret.cpumaps.cpumaps_len > maplen) { @@ -1984,8 +1984,8 @@ remoteDomainGetEmulatorPinInfo (virDomainPtr domain, rv = ret.ret; cleanup: - xdr_free ((xdrproc_t) xdr_remote_domain_get_emulator_pin_info_ret, - (char *) &ret); + xdr_free((xdrproc_t) xdr_remote_domain_get_emulator_pin_info_ret, + (char *) &ret); done: remoteDriverUnlock(priv); @@ -1993,11 +1993,11 @@ done: } static int -remoteDomainGetVcpus (virDomainPtr domain, - virVcpuInfoPtr info, - int maxinfo, - unsigned char *cpumaps, - int maplen) +remoteDomainGetVcpus(virDomainPtr domain, + virVcpuInfoPtr info, + int maxinfo, + unsigned char *cpumaps, + int maplen) { int rv = -1; int i; @@ -2021,14 +2021,14 @@ remoteDomainGetVcpus (virDomainPtr domain, goto done; } - make_nonnull_domain (&args.dom, domain); + make_nonnull_domain(&args.dom, domain); args.maxinfo = maxinfo; args.maplen = maplen; - memset (&ret, 0, sizeof(ret)); - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_VCPUS, - (xdrproc_t) xdr_remote_domain_get_vcpus_args, (char *) &args, - (xdrproc_t) xdr_remote_domain_get_vcpus_ret, (char *) &ret) == -1) + memset(&ret, 0, sizeof(ret)); + if (call(domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_VCPUS, + (xdrproc_t) xdr_remote_domain_get_vcpus_args, (char *) &args, + (xdrproc_t) xdr_remote_domain_get_vcpus_ret, (char *) &ret) == -1) goto done; if (ret.info.info_len > maxinfo) { @@ -2044,8 +2044,8 @@ remoteDomainGetVcpus (virDomainPtr domain, goto cleanup; } - memset (info, 0, sizeof(virVcpuInfo) * maxinfo); - memset (cpumaps, 0, maxinfo * maplen); + memset(info, 0, sizeof(virVcpuInfo) * maxinfo); + memset(cpumaps, 0, maxinfo * maplen); for (i = 0; i < ret.info.info_len; ++i) { info[i].number = ret.info.info_val[i].number; @@ -2060,7 +2060,7 @@ remoteDomainGetVcpus (virDomainPtr domain, rv = ret.info.info_len; cleanup: - xdr_free ((xdrproc_t) xdr_remote_domain_get_vcpus_ret, (char *) &ret); + xdr_free((xdrproc_t) xdr_remote_domain_get_vcpus_ret, (char *) &ret); done: remoteDriverUnlock(priv); @@ -2068,7 +2068,7 @@ done: } static int -remoteDomainGetSecurityLabel (virDomainPtr domain, virSecurityLabelPtr seclabel) +remoteDomainGetSecurityLabel(virDomainPtr domain, virSecurityLabelPtr seclabel) { remote_domain_get_security_label_args args; remote_domain_get_security_label_ret ret; @@ -2077,23 +2077,23 @@ remoteDomainGetSecurityLabel (virDomainPtr domain, virSecurityLabelPtr seclabel) remoteDriverLock(priv); - make_nonnull_domain (&args.dom, domain); - memset (&ret, 0, sizeof(ret)); - memset (seclabel, 0, sizeof(*seclabel)); + make_nonnull_domain(&args.dom, domain); + memset(&ret, 0, sizeof(ret)); + memset(seclabel, 0, sizeof(*seclabel)); - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_SECURITY_LABEL, - (xdrproc_t) xdr_remote_domain_get_security_label_args, (char *)&args, - (xdrproc_t) xdr_remote_domain_get_security_label_ret, (char *)&ret) == -1) { + if (call(domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_SECURITY_LABEL, + (xdrproc_t) xdr_remote_domain_get_security_label_args, (char *)&args, + (xdrproc_t) xdr_remote_domain_get_security_label_ret, (char *)&ret) == -1) { goto done; } if (ret.label.label_val != NULL) { - if (strlen (ret.label.label_val) >= sizeof(seclabel->label)) { + if (strlen(ret.label.label_val) >= sizeof(seclabel->label)) { virReportError(VIR_ERR_RPC, _("security label exceeds maximum: %zu"), sizeof(seclabel->label) - 1); goto cleanup; } - strcpy (seclabel->label, ret.label.label_val); + strcpy(seclabel->label, ret.label.label_val); seclabel->enforcing = ret.enforcing; } @@ -2108,7 +2108,7 @@ done: } static int -remoteDomainGetSecurityLabelList (virDomainPtr domain, virSecurityLabelPtr* seclabels) +remoteDomainGetSecurityLabelList(virDomainPtr domain, virSecurityLabelPtr* seclabels) { remote_domain_get_security_label_list_args args; remote_domain_get_security_label_list_ret ret; @@ -2117,12 +2117,12 @@ remoteDomainGetSecurityLabelList (virDomainPtr domain, virSecurityLabelPtr* secl remoteDriverLock(priv); - make_nonnull_domain (&args.dom, domain); + make_nonnull_domain(&args.dom, domain); memset(&ret, 0, sizeof(ret)); - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_SECURITY_LABEL_LIST, - (xdrproc_t) xdr_remote_domain_get_security_label_list_args, (char *)&args, - (xdrproc_t) xdr_remote_domain_get_security_label_list_ret, (char *)&ret) == -1) { + if (call(domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_SECURITY_LABEL_LIST, + (xdrproc_t) xdr_remote_domain_get_security_label_list_args, (char *)&args, + (xdrproc_t) xdr_remote_domain_get_security_label_list_ret, (char *)&ret) == -1) { goto done; } @@ -2186,7 +2186,7 @@ done: } static int -remoteNodeGetSecurityModel (virConnectPtr conn, virSecurityModelPtr secmodel) +remoteNodeGetSecurityModel(virConnectPtr conn, virSecurityModelPtr secmodel) { remote_node_get_security_model_ret ret; struct private_data *priv = conn->privateData; @@ -2194,31 +2194,31 @@ remoteNodeGetSecurityModel (virConnectPtr conn, virSecurityModelPtr secmodel) remoteDriverLock(priv); - memset (&ret, 0, sizeof(ret)); - memset (secmodel, 0, sizeof(*secmodel)); + memset(&ret, 0, sizeof(ret)); + memset(secmodel, 0, sizeof(*secmodel)); - if (call (conn, priv, 0, REMOTE_PROC_NODE_GET_SECURITY_MODEL, - (xdrproc_t) xdr_void, NULL, - (xdrproc_t) xdr_remote_node_get_security_model_ret, (char *)&ret) == -1) { + if (call(conn, priv, 0, REMOTE_PROC_NODE_GET_SECURITY_MODEL, + (xdrproc_t) xdr_void, NULL, + (xdrproc_t) xdr_remote_node_get_security_model_ret, (char *)&ret) == -1) { goto done; } if (ret.model.model_val != NULL) { - if (strlen (ret.model.model_val) >= sizeof(secmodel->model)) { + if (strlen(ret.model.model_val) >= sizeof(secmodel->model)) { virReportError(VIR_ERR_RPC, _("security model exceeds maximum: %zu"), sizeof(secmodel->model) - 1); goto cleanup; } - strcpy (secmodel->model, ret.model.model_val); + strcpy(secmodel->model, ret.model.model_val); } if (ret.doi.doi_val != NULL) { - if (strlen (ret.doi.doi_val) >= sizeof(secmodel->doi)) { + if (strlen(ret.doi.doi_val) >= sizeof(secmodel->doi)) { virReportError(VIR_ERR_RPC, _("security doi exceeds maximum: %zu"), sizeof(secmodel->doi) - 1); goto cleanup; } - strcpy (secmodel->doi, ret.doi.doi_val); + strcpy(secmodel->doi, ret.doi.doi_val); } rv = 0; @@ -2232,11 +2232,11 @@ done: } static int -remoteDomainMigratePrepare (virConnectPtr dconn, - char **cookie, int *cookielen, - const char *uri_in, char **uri_out, - unsigned long flags, const char *dname, - unsigned long resource) +remoteDomainMigratePrepare(virConnectPtr dconn, + char **cookie, int *cookielen, + const char *uri_in, char **uri_out, + unsigned long flags, const char *dname, + unsigned long resource) { int rv = -1; remote_domain_migrate_prepare_args args; @@ -2250,10 +2250,10 @@ remoteDomainMigratePrepare (virConnectPtr dconn, args.dname = dname == NULL ? NULL : (char **) &dname; args.resource = resource; - memset (&ret, 0, sizeof(ret)); - if (call (dconn, priv, 0, REMOTE_PROC_DOMAIN_MIGRATE_PREPARE, - (xdrproc_t) xdr_remote_domain_migrate_prepare_args, (char *) &args, - (xdrproc_t) xdr_remote_domain_migrate_prepare_ret, (char *) &ret) == -1) + memset(&ret, 0, sizeof(ret)); + if (call(dconn, priv, 0, REMOTE_PROC_DOMAIN_MIGRATE_PREPARE, + (xdrproc_t) xdr_remote_domain_migrate_prepare_args, (char *) &args, + (xdrproc_t) xdr_remote_domain_migrate_prepare_ret, (char *) &ret) == -1) goto done; if (ret.cookie.cookie_len > 0) { @@ -2272,12 +2272,12 @@ done: } static int -remoteDomainMigratePrepare2 (virConnectPtr dconn, - char **cookie, int *cookielen, - const char *uri_in, char **uri_out, - unsigned long flags, const char *dname, - unsigned long resource, - const char *dom_xml) +remoteDomainMigratePrepare2(virConnectPtr dconn, + char **cookie, int *cookielen, + const char *uri_in, char **uri_out, + unsigned long flags, const char *dname, + unsigned long resource, + const char *dom_xml) { int rv = -1; remote_domain_migrate_prepare2_args args; @@ -2292,10 +2292,10 @@ remoteDomainMigratePrepare2 (virConnectPtr dconn, args.resource = resource; args.dom_xml = (char *) dom_xml; - memset (&ret, 0, sizeof(ret)); - if (call (dconn, priv, 0, REMOTE_PROC_DOMAIN_MIGRATE_PREPARE2, - (xdrproc_t) xdr_remote_domain_migrate_prepare2_args, (char *) &args, - (xdrproc_t) xdr_remote_domain_migrate_prepare2_ret, (char *) &ret) == -1) + memset(&ret, 0, sizeof(ret)); + if (call(dconn, priv, 0, REMOTE_PROC_DOMAIN_MIGRATE_PREPARE2, + (xdrproc_t) xdr_remote_domain_migrate_prepare2_args, (char *) &args, + (xdrproc_t) xdr_remote_domain_migrate_prepare2_ret, (char *) &ret) == -1) goto done; if (ret.cookie.cookie_len > 0) { @@ -2331,7 +2331,7 @@ error: } static int -remoteDomainCreate (virDomainPtr domain) +remoteDomainCreate(virDomainPtr domain) { int rv = -1; remote_domain_create_args args; @@ -2341,26 +2341,26 @@ remoteDomainCreate (virDomainPtr domain) remoteDriverLock(priv); - make_nonnull_domain (&args.dom, domain); + make_nonnull_domain(&args.dom, domain); - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_CREATE, - (xdrproc_t) xdr_remote_domain_create_args, (char *) &args, - (xdrproc_t) xdr_void, (char *) NULL) == -1) + if (call(domain->conn, priv, 0, REMOTE_PROC_DOMAIN_CREATE, + (xdrproc_t) xdr_remote_domain_create_args, (char *) &args, + (xdrproc_t) xdr_void, (char *) NULL) == -1) goto done; /* Need to do a lookup figure out ID of newly started guest, because * bug in design of REMOTE_PROC_DOMAIN_CREATE means we aren't getting * it returned. */ - memcpy (args2.uuid, domain->uuid, VIR_UUID_BUFLEN); - memset (&ret2, 0, sizeof(ret2)); - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_LOOKUP_BY_UUID, - (xdrproc_t) xdr_remote_domain_lookup_by_uuid_args, (char *) &args2, - (xdrproc_t) xdr_remote_domain_lookup_by_uuid_ret, (char *) &ret2) == -1) + memcpy(args2.uuid, domain->uuid, VIR_UUID_BUFLEN); + memset(&ret2, 0, sizeof(ret2)); + if (call(domain->conn, priv, 0, REMOTE_PROC_DOMAIN_LOOKUP_BY_UUID, + (xdrproc_t) xdr_remote_domain_lookup_by_uuid_args, (char *) &args2, + (xdrproc_t) xdr_remote_domain_lookup_by_uuid_ret, (char *) &ret2) == -1) goto done; domain->id = ret2.dom.id; - xdr_free ((xdrproc_t) &xdr_remote_domain_lookup_by_uuid_ret, (char *) &ret2); + xdr_free((xdrproc_t) &xdr_remote_domain_lookup_by_uuid_ret, (char *) &ret2); rv = 0; @@ -2370,7 +2370,7 @@ done: } static char * -remoteDomainGetSchedulerType (virDomainPtr domain, int *nparams) +remoteDomainGetSchedulerType(virDomainPtr domain, int *nparams) { char *rv = NULL; remote_domain_get_scheduler_type_args args; @@ -2379,12 +2379,12 @@ remoteDomainGetSchedulerType (virDomainPtr domain, int *nparams) remoteDriverLock(priv); - make_nonnull_domain (&args.dom, domain); + make_nonnull_domain(&args.dom, domain); - memset (&ret, 0, sizeof(ret)); - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_SCHEDULER_TYPE, - (xdrproc_t) xdr_remote_domain_get_scheduler_type_args, (char *) &args, - (xdrproc_t) xdr_remote_domain_get_scheduler_type_ret, (char *) &ret) == -1) + memset(&ret, 0, sizeof(ret)); + if (call(domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_SCHEDULER_TYPE, + (xdrproc_t) xdr_remote_domain_get_scheduler_type_args, (char *) &args, + (xdrproc_t) xdr_remote_domain_get_scheduler_type_ret, (char *) &ret) == -1) goto done; if (nparams) *nparams = ret.nparams; @@ -2398,10 +2398,10 @@ done: } static int -remoteDomainMemoryStats (virDomainPtr domain, - struct _virDomainMemoryStat *stats, - unsigned int nr_stats, - unsigned int flags) +remoteDomainMemoryStats(virDomainPtr domain, + struct _virDomainMemoryStat *stats, + unsigned int nr_stats, + unsigned int flags) { int rv = -1; remote_domain_memory_stats_args args; @@ -2411,7 +2411,7 @@ remoteDomainMemoryStats (virDomainPtr domain, remoteDriverLock(priv); - make_nonnull_domain (&args.dom, domain); + make_nonnull_domain(&args.dom, domain); if (nr_stats > REMOTE_DOMAIN_MEMORY_STATS_MAX) { virReportError(VIR_ERR_RPC, _("too many memory stats requested: %d > %d"), nr_stats, @@ -2420,13 +2420,13 @@ remoteDomainMemoryStats (virDomainPtr domain, } args.maxStats = nr_stats; args.flags = flags; - memset (&ret, 0, sizeof(ret)); + memset(&ret, 0, sizeof(ret)); - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_MEMORY_STATS, - (xdrproc_t) xdr_remote_domain_memory_stats_args, - (char *) &args, - (xdrproc_t) xdr_remote_domain_memory_stats_ret, - (char *) &ret) == -1) + if (call(domain->conn, priv, 0, REMOTE_PROC_DOMAIN_MEMORY_STATS, + (xdrproc_t) xdr_remote_domain_memory_stats_args, + (char *) &args, + (xdrproc_t) xdr_remote_domain_memory_stats_ret, + (char *) &ret) == -1) goto done; for (i = 0; i < ret.stats.stats_len; i++) { @@ -2442,12 +2442,12 @@ done: } static int -remoteDomainBlockPeek (virDomainPtr domain, - const char *path, - unsigned long long offset, - size_t size, - void *buffer, - unsigned int flags) +remoteDomainBlockPeek(virDomainPtr domain, + const char *path, + unsigned long long offset, + size_t size, + void *buffer, + unsigned int flags) { int rv = -1; remote_domain_block_peek_args args; @@ -2463,18 +2463,18 @@ remoteDomainBlockPeek (virDomainPtr domain, goto done; } - make_nonnull_domain (&args.dom, domain); + make_nonnull_domain(&args.dom, domain); args.path = (char *) path; args.offset = offset; args.size = size; args.flags = flags; - memset (&ret, 0, sizeof(ret)); - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_BLOCK_PEEK, - (xdrproc_t) xdr_remote_domain_block_peek_args, - (char *) &args, - (xdrproc_t) xdr_remote_domain_block_peek_ret, - (char *) &ret) == -1) + memset(&ret, 0, sizeof(ret)); + if (call(domain->conn, priv, 0, REMOTE_PROC_DOMAIN_BLOCK_PEEK, + (xdrproc_t) xdr_remote_domain_block_peek_args, + (char *) &args, + (xdrproc_t) xdr_remote_domain_block_peek_ret, + (char *) &ret) == -1) goto done; if (ret.buffer.buffer_len != size) { @@ -2483,7 +2483,7 @@ remoteDomainBlockPeek (virDomainPtr domain, goto cleanup; } - memcpy (buffer, ret.buffer.buffer_val, size); + memcpy(buffer, ret.buffer.buffer_val, size); rv = 0; cleanup: @@ -2495,11 +2495,11 @@ done: } static int -remoteDomainMemoryPeek (virDomainPtr domain, - unsigned long long offset, - size_t size, - void *buffer, - unsigned int flags) +remoteDomainMemoryPeek(virDomainPtr domain, + unsigned long long offset, + size_t size, + void *buffer, + unsigned int flags) { int rv = -1; remote_domain_memory_peek_args args; @@ -2515,17 +2515,17 @@ remoteDomainMemoryPeek (virDomainPtr domain, goto done; } - make_nonnull_domain (&args.dom, domain); + make_nonnull_domain(&args.dom, domain); args.offset = offset; args.size = size; args.flags = flags; - memset (&ret, 0, sizeof(ret)); - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_MEMORY_PEEK, - (xdrproc_t) xdr_remote_domain_memory_peek_args, - (char *) &args, - (xdrproc_t) xdr_remote_domain_memory_peek_ret, - (char *) &ret) == -1) + memset(&ret, 0, sizeof(ret)); + if (call(domain->conn, priv, 0, REMOTE_PROC_DOMAIN_MEMORY_PEEK, + (xdrproc_t) xdr_remote_domain_memory_peek_args, + (char *) &args, + (xdrproc_t) xdr_remote_domain_memory_peek_ret, + (char *) &ret) == -1) goto done; if (ret.buffer.buffer_len != size) { @@ -2534,7 +2534,7 @@ remoteDomainMemoryPeek (virDomainPtr domain, goto cleanup; } - memcpy (buffer, ret.buffer.buffer_val, size); + memcpy(buffer, ret.buffer.buffer_val, size); rv = 0; cleanup: @@ -2631,8 +2631,8 @@ static int remoteDomainGetBlockIoTune(virDomainPtr domain, rv = 0; cleanup: - xdr_free ((xdrproc_t) xdr_remote_domain_get_block_io_tune_ret, - (char *) &ret); + xdr_free((xdrproc_t) xdr_remote_domain_get_block_io_tune_ret, + (char *) &ret); done: remoteDriverUnlock(priv); return rv; @@ -2722,8 +2722,8 @@ cleanup: if (rv < 0) virTypedParameterArrayClear(params, nparams * ncpus); - xdr_free ((xdrproc_t) xdr_remote_domain_get_cpu_stats_ret, - (char *) &ret); + xdr_free((xdrproc_t) xdr_remote_domain_get_cpu_stats_ret, + (char *) &ret); done: remoteDriverUnlock(priv); return rv; @@ -2765,7 +2765,7 @@ remoteConnectListAllNetworks(virConnectPtr conn, } for (i = 0; i < ret.nets.nets_len; i++) { - tmp_nets[i] = get_nonnull_network (conn, ret.nets.nets_val[i]); + tmp_nets[i] = get_nonnull_network(conn, ret.nets.nets_val[i]); if (!tmp_nets[i]) { virReportOOMError(); goto cleanup; @@ -2828,7 +2828,7 @@ remoteConnectListAllInterfaces(virConnectPtr conn, } for (i = 0; i < ret.ifaces.ifaces_len; i++) { - tmp_ifaces[i] = get_nonnull_interface (conn, ret.ifaces.ifaces_val[i]); + tmp_ifaces[i] = get_nonnull_interface(conn, ret.ifaces.ifaces_val[i]); if (!tmp_ifaces[i]) { virReportOOMError(); goto cleanup; @@ -3017,7 +3017,7 @@ remoteConnectListAllSecrets(virConnectPtr conn, } for (i = 0; i < ret.secrets.secrets_len; i++) { - tmp_secrets[i] = get_nonnull_secret (conn, ret.secrets.secrets_val[i]); + tmp_secrets[i] = get_nonnull_secret(conn, ret.secrets.secrets_val[i]); if (!tmp_secrets[i]) { virReportOOMError(); goto cleanup; @@ -3046,7 +3046,7 @@ done: /*----------------------------------------------------------------------*/ -static virDrvOpenStatus ATTRIBUTE_NONNULL (1) +static virDrvOpenStatus ATTRIBUTE_NONNULL(1) remoteGenericOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int flags, void **genericPrivateData) { @@ -3054,7 +3054,7 @@ remoteGenericOpen(virConnectPtr conn, virConnectAuthPtr auth, return VIR_DRV_OPEN_DECLINED; if (conn->driver && - STREQ (conn->driver->name, "remote")) { + STREQ(conn->driver->name, "remote")) { struct private_data *priv; /* If we're here, the remote driver is already @@ -3067,7 +3067,7 @@ remoteGenericOpen(virConnectPtr conn, virConnectAuthPtr auth, remoteDriverUnlock(priv); return VIR_DRV_OPEN_SUCCESS; } else if (conn->networkDriver && - STREQ (conn->networkDriver->name, "remote")) { + STREQ(conn->networkDriver->name, "remote")) { struct private_data *priv = conn->networkPrivateData; remoteDriverLock(priv); *genericPrivateData = priv; @@ -3106,7 +3106,7 @@ remoteGenericClose(virConnectPtr conn, void **genericPrivateData) return rv; } -static virDrvOpenStatus ATTRIBUTE_NONNULL (1) +static virDrvOpenStatus ATTRIBUTE_NONNULL(1) remoteNetworkOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int flags) { @@ -3121,7 +3121,7 @@ remoteNetworkClose(virConnectPtr conn) /*----------------------------------------------------------------------*/ -static virDrvOpenStatus ATTRIBUTE_NONNULL (1) +static virDrvOpenStatus ATTRIBUTE_NONNULL(1) remoteInterfaceOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int flags) { @@ -3136,7 +3136,7 @@ remoteInterfaceClose(virConnectPtr conn) /*----------------------------------------------------------------------*/ -static virDrvOpenStatus ATTRIBUTE_NONNULL (1) +static virDrvOpenStatus ATTRIBUTE_NONNULL(1) remoteStorageOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int flags) { @@ -3150,10 +3150,10 @@ remoteStorageClose(virConnectPtr conn) } static char * -remoteFindStoragePoolSources (virConnectPtr conn, - const char *type, - const char *srcSpec, - unsigned int flags) +remoteFindStoragePoolSources(virConnectPtr conn, + const char *type, + const char *srcSpec, + unsigned int flags) { char *rv = NULL; remote_find_storage_pool_sources_args args; @@ -3166,16 +3166,16 @@ remoteFindStoragePoolSources (virConnectPtr conn, args.srcSpec = srcSpec ? (char **)&srcSpec : NULL; args.flags = flags; - memset (&ret, 0, sizeof(ret)); - if (call (conn, priv, 0, REMOTE_PROC_FIND_STORAGE_POOL_SOURCES, - (xdrproc_t) xdr_remote_find_storage_pool_sources_args, (char *) &args, - (xdrproc_t) xdr_remote_find_storage_pool_sources_ret, (char *) &ret) == -1) + memset(&ret, 0, sizeof(ret)); + if (call(conn, priv, 0, REMOTE_PROC_FIND_STORAGE_POOL_SOURCES, + (xdrproc_t) xdr_remote_find_storage_pool_sources_args, (char *) &args, + (xdrproc_t) xdr_remote_find_storage_pool_sources_ret, (char *) &ret) == -1) goto done; rv = ret.xml; ret.xml = NULL; /* To stop xdr_free free'ing it */ - xdr_free ((xdrproc_t) xdr_remote_find_storage_pool_sources_ret, (char *) &ret); + xdr_free((xdrproc_t) xdr_remote_find_storage_pool_sources_ret, (char *) &ret); done: remoteDriverUnlock(priv); @@ -3183,9 +3183,9 @@ done: } static int -remoteConnectListAllStoragePools (virConnectPtr conn, - virStoragePoolPtr **pools, - unsigned int flags) +remoteConnectListAllStoragePools(virConnectPtr conn, + virStoragePoolPtr **pools, + unsigned int flags) { int rv = -1; int i; @@ -3312,7 +3312,7 @@ done: /*----------------------------------------------------------------------*/ -static virDrvOpenStatus ATTRIBUTE_NONNULL (1) +static virDrvOpenStatus ATTRIBUTE_NONNULL(1) remoteDevMonOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int flags) { @@ -3326,7 +3326,7 @@ remoteDevMonClose(virConnectPtr conn) } static int -remoteNodeDeviceDettach (virNodeDevicePtr dev) +remoteNodeDeviceDettach(virNodeDevicePtr dev) { int rv = -1; remote_node_device_dettach_args args; @@ -3338,9 +3338,9 @@ remoteNodeDeviceDettach (virNodeDevicePtr dev) args.name = dev->name; - if (call (dev->conn, priv, 0, REMOTE_PROC_NODE_DEVICE_DETTACH, - (xdrproc_t) xdr_remote_node_device_dettach_args, (char *) &args, - (xdrproc_t) xdr_void, (char *) NULL) == -1) + if (call(dev->conn, priv, 0, REMOTE_PROC_NODE_DEVICE_DETTACH, + (xdrproc_t) xdr_remote_node_device_dettach_args, (char *) &args, + (xdrproc_t) xdr_void, (char *) NULL) == -1) goto done; rv = 0; @@ -3351,7 +3351,7 @@ done: } static int -remoteNodeDeviceReAttach (virNodeDevicePtr dev) +remoteNodeDeviceReAttach(virNodeDevicePtr dev) { int rv = -1; remote_node_device_re_attach_args args; @@ -3363,9 +3363,9 @@ remoteNodeDeviceReAttach (virNodeDevicePtr dev) args.name = dev->name; - if (call (dev->conn, priv, 0, REMOTE_PROC_NODE_DEVICE_RE_ATTACH, - (xdrproc_t) xdr_remote_node_device_re_attach_args, (char *) &args, - (xdrproc_t) xdr_void, (char *) NULL) == -1) + if (call(dev->conn, priv, 0, REMOTE_PROC_NODE_DEVICE_RE_ATTACH, + (xdrproc_t) xdr_remote_node_device_re_attach_args, (char *) &args, + (xdrproc_t) xdr_void, (char *) NULL) == -1) goto done; rv = 0; @@ -3376,7 +3376,7 @@ done: } static int -remoteNodeDeviceReset (virNodeDevicePtr dev) +remoteNodeDeviceReset(virNodeDevicePtr dev) { int rv = -1; remote_node_device_reset_args args; @@ -3388,9 +3388,9 @@ remoteNodeDeviceReset (virNodeDevicePtr dev) args.name = dev->name; - if (call (dev->conn, priv, 0, REMOTE_PROC_NODE_DEVICE_RESET, - (xdrproc_t) xdr_remote_node_device_reset_args, (char *) &args, - (xdrproc_t) xdr_void, (char *) NULL) == -1) + if (call(dev->conn, priv, 0, REMOTE_PROC_NODE_DEVICE_RESET, + (xdrproc_t) xdr_remote_node_device_reset_args, (char *) &args, + (xdrproc_t) xdr_void, (char *) NULL) == -1) goto done; rv = 0; @@ -3402,7 +3402,7 @@ done: /* ------------------------------------------------------------- */ -static virDrvOpenStatus ATTRIBUTE_NONNULL (1) +static virDrvOpenStatus ATTRIBUTE_NONNULL(1) remoteNWFilterOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int flags) { @@ -3418,18 +3418,18 @@ remoteNWFilterClose(virConnectPtr conn) /*----------------------------------------------------------------------*/ static int -remoteAuthenticate (virConnectPtr conn, struct private_data *priv, - virConnectAuthPtr auth ATTRIBUTE_UNUSED, - const char *authtype) +remoteAuthenticate(virConnectPtr conn, struct private_data *priv, + virConnectAuthPtr auth ATTRIBUTE_UNUSED, + const char *authtype) { struct remote_auth_list_ret ret; int err, type = REMOTE_AUTH_NONE; memset(&ret, 0, sizeof(ret)); - err = call (conn, priv, 0, - REMOTE_PROC_AUTH_LIST, - (xdrproc_t) xdr_void, (char *) NULL, - (xdrproc_t) xdr_remote_auth_list_ret, (char *) &ret); + err = call(conn, priv, 0, + REMOTE_PROC_AUTH_LIST, + (xdrproc_t) xdr_void, (char *) NULL, + (xdrproc_t) xdr_remote_auth_list_ret, (char *) &ret); if (err < 0) { virErrorPtr verr = virGetLastError(); if (verr && verr->code == VIR_ERR_NO_SUPPORT) { @@ -3829,8 +3829,8 @@ cleanup: /* Perform the SASL authentication process */ static int -remoteAuthSASL (virConnectPtr conn, struct private_data *priv, - virConnectAuthPtr auth, const char *wantmech) +remoteAuthSASL(virConnectPtr conn, struct private_data *priv, + virConnectAuthPtr auth, const char *wantmech) { remote_auth_sasl_init_ret iret; remote_auth_sasl_start_args sargs; @@ -3894,10 +3894,10 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, goto cleanup; /* First call is to inquire about supported mechanisms in the server */ - memset (&iret, 0, sizeof(iret)); - if (call (conn, priv, 0, REMOTE_PROC_AUTH_SASL_INIT, - (xdrproc_t) xdr_void, (char *)NULL, - (xdrproc_t) xdr_remote_auth_sasl_init_ret, (char *) &iret) != 0) + memset(&iret, 0, sizeof(iret)); + if (call(conn, priv, 0, REMOTE_PROC_AUTH_SASL_INIT, + (xdrproc_t) xdr_void, (char *)NULL, + (xdrproc_t) xdr_remote_auth_sasl_init_ret, (char *) &iret) != 0) goto cleanup; @@ -3949,10 +3949,10 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, mech, clientoutlen, clientout); /* Now send the initial auth data to the server */ - memset (&sret, 0, sizeof(sret)); - if (call (conn, priv, 0, REMOTE_PROC_AUTH_SASL_START, - (xdrproc_t) xdr_remote_auth_sasl_start_args, (char *) &sargs, - (xdrproc_t) xdr_remote_auth_sasl_start_ret, (char *) &sret) != 0) + memset(&sret, 0, sizeof(sret)); + if (call(conn, priv, 0, REMOTE_PROC_AUTH_SASL_START, + (xdrproc_t) xdr_remote_auth_sasl_start_args, (char *) &sargs, + (xdrproc_t) xdr_remote_auth_sasl_start_ret, (char *) &sret) != 0) goto cleanup; complete = sret.complete; @@ -4001,10 +4001,10 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, VIR_DEBUG("Server step with %zu bytes %p", clientoutlen, clientout); - memset (&pret, 0, sizeof(pret)); - if (call (conn, priv, 0, REMOTE_PROC_AUTH_SASL_STEP, - (xdrproc_t) xdr_remote_auth_sasl_step_args, (char *) &pargs, - (xdrproc_t) xdr_remote_auth_sasl_step_ret, (char *) &pret) != 0) + memset(&pret, 0, sizeof(pret)); + if (call(conn, priv, 0, REMOTE_PROC_AUTH_SASL_STEP, + (xdrproc_t) xdr_remote_auth_sasl_step_args, (char *) &pargs, + (xdrproc_t) xdr_remote_auth_sasl_step_ret, (char *) &pret) != 0) goto cleanup; complete = pret.complete; @@ -4056,16 +4056,16 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, #if HAVE_POLKIT # if HAVE_POLKIT1 static int -remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, - virConnectAuthPtr auth ATTRIBUTE_UNUSED) +remoteAuthPolkit(virConnectPtr conn, struct private_data *priv, + virConnectAuthPtr auth ATTRIBUTE_UNUSED) { remote_auth_polkit_ret ret; VIR_DEBUG("Client initialize PolicyKit-1 authentication"); - memset (&ret, 0, sizeof(ret)); - if (call (conn, priv, 0, REMOTE_PROC_AUTH_POLKIT, - (xdrproc_t) xdr_void, (char *)NULL, - (xdrproc_t) xdr_remote_auth_polkit_ret, (char *) &ret) != 0) { + memset(&ret, 0, sizeof(ret)); + if (call(conn, priv, 0, REMOTE_PROC_AUTH_POLKIT, + (xdrproc_t) xdr_void, (char *)NULL, + (xdrproc_t) xdr_remote_auth_polkit_ret, (char *) &ret) != 0) { return -1; /* virError already set by call */ } @@ -4076,8 +4076,8 @@ remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, /* Perform the PolicyKit authentication process */ static int -remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, - virConnectAuthPtr auth) +remoteAuthPolkit(virConnectPtr conn, struct private_data *priv, + virConnectAuthPtr auth) { remote_auth_polkit_ret ret; int i, allowcb = 0; @@ -4092,10 +4092,10 @@ remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, VIR_DEBUG("Client initialize PolicyKit-0 authentication"); /* Check auth first and if it succeeds we are done. */ - memset (&ret, 0, sizeof(ret)); - if (call (conn, priv, 0, REMOTE_PROC_AUTH_POLKIT, - (xdrproc_t) xdr_void, (char *)NULL, - (xdrproc_t) xdr_remote_auth_polkit_ret, (char *) &ret) == 0) + memset(&ret, 0, sizeof(ret)); + if (call(conn, priv, 0, REMOTE_PROC_AUTH_POLKIT, + (xdrproc_t) xdr_void, (char *)NULL, + (xdrproc_t) xdr_remote_auth_polkit_ret, (char *) &ret) == 0) goto out; /* Auth failed. Ask client to obtain it and check again. */ @@ -4123,10 +4123,10 @@ remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, return -1; } - memset (&ret, 0, sizeof(ret)); - if (call (conn, priv, 0, REMOTE_PROC_AUTH_POLKIT, - (xdrproc_t) xdr_void, (char *)NULL, - (xdrproc_t) xdr_remote_auth_polkit_ret, (char *) &ret) != 0) { + memset(&ret, 0, sizeof(ret)); + if (call(conn, priv, 0, REMOTE_PROC_AUTH_POLKIT, + (xdrproc_t) xdr_void, (char *)NULL, + (xdrproc_t) xdr_remote_auth_polkit_ret, (char *) &ret) != 0) { return -1; /* virError already set by call */ } @@ -4157,9 +4157,9 @@ static int remoteDomainEventRegister(virConnectPtr conn, if (count == 1) { /* Tell the server when we are the first callback deregistering */ - if (call (conn, priv, 0, REMOTE_PROC_DOMAIN_EVENTS_REGISTER, - (xdrproc_t) xdr_void, (char *) NULL, - (xdrproc_t) xdr_void, (char *) NULL) == -1) + if (call(conn, priv, 0, REMOTE_PROC_DOMAIN_EVENTS_REGISTER, + (xdrproc_t) xdr_void, (char *) NULL, + (xdrproc_t) xdr_void, (char *) NULL) == -1) goto done; } @@ -4186,9 +4186,9 @@ static int remoteDomainEventDeregister(virConnectPtr conn, if (count == 0) { /* Tell the server when we are the last callback deregistering */ - if (call (conn, priv, 0, REMOTE_PROC_DOMAIN_EVENTS_DEREGISTER, - (xdrproc_t) xdr_void, (char *) NULL, - (xdrproc_t) xdr_void, (char *) NULL) == -1) + if (call(conn, priv, 0, REMOTE_PROC_DOMAIN_EVENTS_DEREGISTER, + (xdrproc_t) xdr_void, (char *) NULL, + (xdrproc_t) xdr_void, (char *) NULL) == -1) goto done; } @@ -4606,7 +4606,7 @@ remoteDomainBuildEventPMSuspendDisk(virNetClientProgramPtr prog ATTRIBUTE_UNUSED } -static virDrvOpenStatus ATTRIBUTE_NONNULL (1) +static virDrvOpenStatus ATTRIBUTE_NONNULL(1) remoteSecretOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int flags) { @@ -4614,21 +4614,21 @@ remoteSecretOpen(virConnectPtr conn, virConnectAuthPtr auth, } static int -remoteSecretClose (virConnectPtr conn) +remoteSecretClose(virConnectPtr conn) { return remoteGenericClose(conn, &conn->secretPrivateData); } static unsigned char * -remoteSecretGetValue (virSecretPtr secret, size_t *value_size, - unsigned int flags, unsigned int internalFlags) +remoteSecretGetValue(virSecretPtr secret, size_t *value_size, + unsigned int flags, unsigned int internalFlags) { unsigned char *rv = NULL; remote_secret_get_value_args args; remote_secret_get_value_ret ret; struct private_data *priv = secret->conn->secretPrivateData; - remoteDriverLock (priv); + remoteDriverLock(priv); /* internalFlags intentionally do not go over the wire */ if (internalFlags) { @@ -4636,20 +4636,20 @@ remoteSecretGetValue (virSecretPtr secret, size_t *value_size, goto done; } - make_nonnull_secret (&args.secret, secret); + make_nonnull_secret(&args.secret, secret); args.flags = flags; - memset (&ret, 0, sizeof(ret)); - if (call (secret->conn, priv, 0, REMOTE_PROC_SECRET_GET_VALUE, - (xdrproc_t) xdr_remote_secret_get_value_args, (char *) &args, - (xdrproc_t) xdr_remote_secret_get_value_ret, (char *) &ret) == -1) + memset(&ret, 0, sizeof(ret)); + if (call(secret->conn, priv, 0, REMOTE_PROC_SECRET_GET_VALUE, + (xdrproc_t) xdr_remote_secret_get_value_args, (char *) &args, + (xdrproc_t) xdr_remote_secret_get_value_ret, (char *) &ret) == -1) goto done; *value_size = ret.value.value_len; rv = (unsigned char *) ret.value.value_val; /* Caller frees. */ done: - remoteDriverUnlock (priv); + remoteDriverUnlock(priv); return rv; } @@ -4926,9 +4926,9 @@ static int remoteDomainEventRegisterAny(virConnectPtr conn, if (count == 1) { args.eventID = eventID; - if (call (conn, priv, 0, REMOTE_PROC_DOMAIN_EVENTS_REGISTER_ANY, - (xdrproc_t) xdr_remote_domain_events_register_any_args, (char *) &args, - (xdrproc_t) xdr_void, (char *)NULL) == -1) { + if (call(conn, priv, 0, REMOTE_PROC_DOMAIN_EVENTS_REGISTER_ANY, + (xdrproc_t) xdr_remote_domain_events_register_any_args, (char *) &args, + (xdrproc_t) xdr_void, (char *)NULL) == -1) { virDomainEventStateDeregisterID(conn, priv->domainEventState, callbackID); @@ -4974,9 +4974,9 @@ static int remoteDomainEventDeregisterAny(virConnectPtr conn, if (count == 0) { args.eventID = callbackID; - if (call (conn, priv, 0, REMOTE_PROC_DOMAIN_EVENTS_DEREGISTER_ANY, - (xdrproc_t) xdr_remote_domain_events_deregister_any_args, (char *) &args, - (xdrproc_t) xdr_void, (char *) NULL) == -1) + if (call(conn, priv, 0, REMOTE_PROC_DOMAIN_EVENTS_DEREGISTER_ANY, + (xdrproc_t) xdr_remote_domain_events_deregister_any_args, (char *) &args, + (xdrproc_t) xdr_void, (char *) NULL) == -1) goto done; } @@ -4991,8 +4991,8 @@ done: /*----------------------------------------------------------------------*/ static int -remoteQemuDomainMonitorCommand (virDomainPtr domain, const char *cmd, - char **result, unsigned int flags) +remoteQemuDomainMonitorCommand(virDomainPtr domain, const char *cmd, + char **result, unsigned int flags) { int rv = -1; qemu_monitor_command_args args; @@ -5005,10 +5005,10 @@ remoteQemuDomainMonitorCommand (virDomainPtr domain, const char *cmd, args.cmd = (char *)cmd; args.flags = flags; - memset (&ret, 0, sizeof(ret)); - if (call (domain->conn, priv, REMOTE_CALL_QEMU, QEMU_PROC_MONITOR_COMMAND, - (xdrproc_t) xdr_qemu_monitor_command_args, (char *) &args, - (xdrproc_t) xdr_qemu_monitor_command_ret, (char *) &ret) == -1) + memset(&ret, 0, sizeof(ret)); + if (call(domain->conn, priv, REMOTE_CALL_QEMU, QEMU_PROC_MONITOR_COMMAND, + (xdrproc_t) xdr_qemu_monitor_command_args, (char *) &args, + (xdrproc_t) xdr_qemu_monitor_command_ret, (char *) &ret) == -1) goto done; *result = strdup(ret.result); @@ -5020,7 +5020,7 @@ remoteQemuDomainMonitorCommand (virDomainPtr domain, const char *cmd, rv = 0; cleanup: - xdr_free ((xdrproc_t) xdr_qemu_monitor_command_ret, (char *) &ret); + xdr_free((xdrproc_t) xdr_qemu_monitor_command_ret, (char *) &ret); done: remoteDriverUnlock(priv); @@ -5047,15 +5047,15 @@ remoteDomainMigrateBegin3(virDomainPtr domain, memset(&args, 0, sizeof(args)); memset(&ret, 0, sizeof(ret)); - make_nonnull_domain (&args.dom, domain); + make_nonnull_domain(&args.dom, domain); args.xmlin = xmlin == NULL ? NULL : (char **) &xmlin; args.flags = flags; args.dname = dname == NULL ? NULL : (char **) &dname; args.resource = resource; - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_MIGRATE_BEGIN3, - (xdrproc_t) xdr_remote_domain_migrate_begin3_args, (char *) &args, - (xdrproc_t) xdr_remote_domain_migrate_begin3_ret, (char *) &ret) == -1) + if (call(domain->conn, priv, 0, REMOTE_PROC_DOMAIN_MIGRATE_BEGIN3, + (xdrproc_t) xdr_remote_domain_migrate_begin3_args, (char *) &args, + (xdrproc_t) xdr_remote_domain_migrate_begin3_ret, (char *) &ret) == -1) goto done; if (ret.cookie_out.cookie_out_len > 0) { @@ -5111,10 +5111,10 @@ remoteDomainMigratePrepare3(virConnectPtr dconn, args.resource = resource; args.dom_xml = (char *) dom_xml; - memset (&ret, 0, sizeof(ret)); - if (call (dconn, priv, 0, REMOTE_PROC_DOMAIN_MIGRATE_PREPARE3, - (xdrproc_t) xdr_remote_domain_migrate_prepare3_args, (char *) &args, - (xdrproc_t) xdr_remote_domain_migrate_prepare3_ret, (char *) &ret) == -1) + memset(&ret, 0, sizeof(ret)); + if (call(dconn, priv, 0, REMOTE_PROC_DOMAIN_MIGRATE_PREPARE3, + (xdrproc_t) xdr_remote_domain_migrate_prepare3_args, (char *) &args, + (xdrproc_t) xdr_remote_domain_migrate_prepare3_ret, (char *) &ret) == -1) goto done; if (ret.cookie_out.cookie_out_len > 0) { @@ -5256,9 +5256,9 @@ remoteDomainMigratePerform3(virDomainPtr dom, args.dconnuri = dconnuri == NULL ? NULL : (char **) &dconnuri; args.resource = resource; - if (call (dom->conn, priv, 0, REMOTE_PROC_DOMAIN_MIGRATE_PERFORM3, - (xdrproc_t) xdr_remote_domain_migrate_perform3_args, (char *) &args, - (xdrproc_t) xdr_remote_domain_migrate_perform3_ret, (char *) &ret) == -1) + if (call(dom->conn, priv, 0, REMOTE_PROC_DOMAIN_MIGRATE_PERFORM3, + (xdrproc_t) xdr_remote_domain_migrate_perform3_args, (char *) &args, + (xdrproc_t) xdr_remote_domain_migrate_perform3_ret, (char *) &ret) == -1) goto done; if (ret.cookie_out.cookie_out_len > 0) { @@ -5313,9 +5313,9 @@ remoteDomainMigrateFinish3(virConnectPtr dconn, args.flags = flags; args.cancelled = cancelled; - if (call (dconn, priv, 0, REMOTE_PROC_DOMAIN_MIGRATE_FINISH3, - (xdrproc_t) xdr_remote_domain_migrate_finish3_args, (char *) &args, - (xdrproc_t) xdr_remote_domain_migrate_finish3_ret, (char *) &ret) == -1) + if (call(dconn, priv, 0, REMOTE_PROC_DOMAIN_MIGRATE_FINISH3, + (xdrproc_t) xdr_remote_domain_migrate_finish3_args, (char *) &args, + (xdrproc_t) xdr_remote_domain_migrate_finish3_ret, (char *) &ret) == -1) goto done; rv = get_nonnull_domain(dconn, ret.dom); @@ -5332,7 +5332,7 @@ remoteDomainMigrateFinish3(virConnectPtr dconn, ret.cookie_out.cookie_out_len = 0; } - xdr_free ((xdrproc_t) &xdr_remote_domain_migrate_finish3_ret, (char *) &ret); + xdr_free((xdrproc_t) &xdr_remote_domain_migrate_finish3_ret, (char *) &ret); done: remoteDriverUnlock(priv); @@ -5359,15 +5359,15 @@ remoteDomainMigrateConfirm3(virDomainPtr domain, memset(&args, 0, sizeof(args)); - make_nonnull_domain (&args.dom, domain); + make_nonnull_domain(&args.dom, domain); args.cookie_in.cookie_in_len = cookieinlen; args.cookie_in.cookie_in_val = (char *) cookiein; args.flags = flags; args.cancelled = cancelled; - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_MIGRATE_CONFIRM3, - (xdrproc_t) xdr_remote_domain_migrate_confirm3_args, (char *) &args, - (xdrproc_t) xdr_void, (char *) NULL) == -1) + if (call(domain->conn, priv, 0, REMOTE_PROC_DOMAIN_MIGRATE_CONFIRM3, + (xdrproc_t) xdr_remote_domain_migrate_confirm3_args, (char *) &args, + (xdrproc_t) xdr_void, (char *) NULL) == -1) goto done; rv = 0; @@ -5390,7 +5390,7 @@ remoteDomainOpenGraphics(virDomainPtr dom, remoteDriverLock(priv); - make_nonnull_domain (&args.dom, dom); + make_nonnull_domain(&args.dom, dom); args.idx = idx; args.flags = flags; @@ -5543,12 +5543,12 @@ callWithFD(virConnectPtr conn ATTRIBUTE_UNUSED, } static int -call (virConnectPtr conn, - struct private_data *priv, - unsigned int flags, - int proc_nr, - xdrproc_t args_filter, char *args, - xdrproc_t ret_filter, char *ret) +call(virConnectPtr conn, + struct private_data *priv, + unsigned int flags, + int proc_nr, + xdrproc_t args_filter, char *args, + xdrproc_t ret_filter, char *ret) { return callWithFD(conn, priv, flags, -1, proc_nr, args_filter, args, @@ -5557,10 +5557,10 @@ call (virConnectPtr conn, static int -remoteDomainGetInterfaceParameters (virDomainPtr domain, - const char *device, - virTypedParameterPtr params, int *nparams, - unsigned int flags) +remoteDomainGetInterfaceParameters(virDomainPtr domain, + const char *device, + virTypedParameterPtr params, int *nparams, + unsigned int flags) { int rv = -1; remote_domain_get_interface_parameters_args args; @@ -5569,15 +5569,15 @@ remoteDomainGetInterfaceParameters (virDomainPtr domain, remoteDriverLock(priv); - make_nonnull_domain (&args.dom, domain); + make_nonnull_domain(&args.dom, domain); args.device = (char *)device; args.nparams = *nparams; args.flags = flags; - memset (&ret, 0, sizeof(ret)); - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_INTERFACE_PARAMETERS, - (xdrproc_t) xdr_remote_domain_get_interface_parameters_args, (char *) &args, - (xdrproc_t) xdr_remote_domain_get_interface_parameters_ret, (char *) &ret) == -1) + memset(&ret, 0, sizeof(ret)); + if (call(domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_INTERFACE_PARAMETERS, + (xdrproc_t) xdr_remote_domain_get_interface_parameters_args, (char *) &args, + (xdrproc_t) xdr_remote_domain_get_interface_parameters_ret, (char *) &ret) == -1) goto done; /* Handle the case when the caller does not know the number of parameters @@ -5599,8 +5599,8 @@ remoteDomainGetInterfaceParameters (virDomainPtr domain, rv = 0; cleanup: - xdr_free ((xdrproc_t) xdr_remote_domain_get_interface_parameters_ret, - (char *) &ret); + xdr_free((xdrproc_t) xdr_remote_domain_get_interface_parameters_ret, + (char *) &ret); done: remoteDriverUnlock(priv); return rv; @@ -5626,14 +5626,14 @@ remoteDomainListAllSnapshots(virDomainPtr dom, args.flags = flags; memset(&ret, 0, sizeof(ret)); - if (call (dom->conn, - priv, - 0, - REMOTE_PROC_DOMAIN_LIST_ALL_SNAPSHOTS, - (xdrproc_t) xdr_remote_domain_list_all_snapshots_args, - (char *) &args, - (xdrproc_t) xdr_remote_domain_list_all_snapshots_ret, - (char *) &ret) == -1) + if (call(dom->conn, + priv, + 0, + REMOTE_PROC_DOMAIN_LIST_ALL_SNAPSHOTS, + (xdrproc_t) xdr_remote_domain_list_all_snapshots_args, + (char *) &args, + (xdrproc_t) xdr_remote_domain_list_all_snapshots_ret, + (char *) &ret) == -1) goto done; if (snapshots) { @@ -5689,14 +5689,14 @@ remoteDomainSnapshotListAllChildren(virDomainSnapshotPtr parent, make_nonnull_domain_snapshot(&args.snapshot, parent); memset(&ret, 0, sizeof(ret)); - if (call (parent->domain->conn, - priv, - 0, - REMOTE_PROC_DOMAIN_SNAPSHOT_LIST_ALL_CHILDREN, - (xdrproc_t) xdr_remote_domain_snapshot_list_all_children_args, - (char *) &args, - (xdrproc_t) xdr_remote_domain_snapshot_list_all_children_ret, - (char *) &ret) == -1) + if (call(parent->domain->conn, + priv, + 0, + REMOTE_PROC_DOMAIN_SNAPSHOT_LIST_ALL_CHILDREN, + (xdrproc_t) xdr_remote_domain_snapshot_list_all_children_args, + (char *) &args, + (xdrproc_t) xdr_remote_domain_snapshot_list_all_children_ret, + (char *) &ret) == -1) goto done; if (snapshots) { @@ -5748,10 +5748,10 @@ remoteNodeGetMemoryParameters(virConnectPtr conn, args.nparams = *nparams; args.flags = flags; - memset (&ret, 0, sizeof(ret)); - if (call (conn, priv, 0, REMOTE_PROC_NODE_GET_MEMORY_PARAMETERS, - (xdrproc_t) xdr_remote_node_get_memory_parameters_args, (char *) &args, - (xdrproc_t) xdr_remote_node_get_memory_parameters_ret, (char *) &ret) == -1) + memset(&ret, 0, sizeof(ret)); + if (call(conn, priv, 0, REMOTE_PROC_NODE_GET_MEMORY_PARAMETERS, + (xdrproc_t) xdr_remote_node_get_memory_parameters_args, (char *) &args, + (xdrproc_t) xdr_remote_node_get_memory_parameters_ret, (char *) &ret) == -1) goto done; /* Handle the case when the caller does not know the number of parameters @@ -5773,8 +5773,8 @@ remoteNodeGetMemoryParameters(virConnectPtr conn, rv = 0; cleanup: - xdr_free ((xdrproc_t) xdr_remote_node_get_memory_parameters_ret, - (char *) &ret); + xdr_free((xdrproc_t) xdr_remote_node_get_memory_parameters_ret, + (char *) &ret); done: remoteDriverUnlock(priv); return rv; @@ -5792,58 +5792,58 @@ remoteDomainEventQueue(struct private_data *priv, virDomainEventPtr event) * but if they do then virterror_internal.has been set. */ static virDomainPtr -get_nonnull_domain (virConnectPtr conn, remote_nonnull_domain domain) +get_nonnull_domain(virConnectPtr conn, remote_nonnull_domain domain) { virDomainPtr dom; - dom = virGetDomain (conn, domain.name, BAD_CAST domain.uuid); + dom = virGetDomain(conn, domain.name, BAD_CAST domain.uuid); if (dom) dom->id = domain.id; return dom; } static virNetworkPtr -get_nonnull_network (virConnectPtr conn, remote_nonnull_network network) +get_nonnull_network(virConnectPtr conn, remote_nonnull_network network) { - return virGetNetwork (conn, network.name, BAD_CAST network.uuid); + return virGetNetwork(conn, network.name, BAD_CAST network.uuid); } static virInterfacePtr -get_nonnull_interface (virConnectPtr conn, remote_nonnull_interface iface) +get_nonnull_interface(virConnectPtr conn, remote_nonnull_interface iface) { - return virGetInterface (conn, iface.name, iface.mac); + return virGetInterface(conn, iface.name, iface.mac); } static virStoragePoolPtr -get_nonnull_storage_pool (virConnectPtr conn, remote_nonnull_storage_pool pool) +get_nonnull_storage_pool(virConnectPtr conn, remote_nonnull_storage_pool pool) { - return virGetStoragePool (conn, pool.name, BAD_CAST pool.uuid); + return virGetStoragePool(conn, pool.name, BAD_CAST pool.uuid); } static virStorageVolPtr -get_nonnull_storage_vol (virConnectPtr conn, remote_nonnull_storage_vol vol) +get_nonnull_storage_vol(virConnectPtr conn, remote_nonnull_storage_vol vol) { - return virGetStorageVol (conn, vol.pool, vol.name, vol.key); + return virGetStorageVol(conn, vol.pool, vol.name, vol.key); } static virNodeDevicePtr -get_nonnull_node_device (virConnectPtr conn, remote_nonnull_node_device dev) +get_nonnull_node_device(virConnectPtr conn, remote_nonnull_node_device dev) { return virGetNodeDevice(conn, dev.name); } static virSecretPtr -get_nonnull_secret (virConnectPtr conn, remote_nonnull_secret secret) +get_nonnull_secret(virConnectPtr conn, remote_nonnull_secret secret) { return virGetSecret(conn, BAD_CAST secret.uuid, secret.usageType, secret.usageID); } static virNWFilterPtr -get_nonnull_nwfilter (virConnectPtr conn, remote_nonnull_nwfilter nwfilter) +get_nonnull_nwfilter(virConnectPtr conn, remote_nonnull_nwfilter nwfilter) { - return virGetNWFilter (conn, nwfilter.name, BAD_CAST nwfilter.uuid); + return virGetNWFilter(conn, nwfilter.name, BAD_CAST nwfilter.uuid); } static virDomainSnapshotPtr -get_nonnull_domain_snapshot (virDomainPtr domain, remote_nonnull_domain_snapshot snapshot) +get_nonnull_domain_snapshot(virDomainPtr domain, remote_nonnull_domain_snapshot snapshot) { return virGetDomainSnapshot(domain, snapshot.name); } @@ -5851,22 +5851,22 @@ get_nonnull_domain_snapshot (virDomainPtr domain, remote_nonnull_domain_snapshot /* Make remote_nonnull_domain and remote_nonnull_network. */ static void -make_nonnull_domain (remote_nonnull_domain *dom_dst, virDomainPtr dom_src) +make_nonnull_domain(remote_nonnull_domain *dom_dst, virDomainPtr dom_src) { dom_dst->id = dom_src->id; dom_dst->name = dom_src->name; - memcpy (dom_dst->uuid, dom_src->uuid, VIR_UUID_BUFLEN); + memcpy(dom_dst->uuid, dom_src->uuid, VIR_UUID_BUFLEN); } static void -make_nonnull_network (remote_nonnull_network *net_dst, virNetworkPtr net_src) +make_nonnull_network(remote_nonnull_network *net_dst, virNetworkPtr net_src) { net_dst->name = net_src->name; - memcpy (net_dst->uuid, net_src->uuid, VIR_UUID_BUFLEN); + memcpy(net_dst->uuid, net_src->uuid, VIR_UUID_BUFLEN); } static void -make_nonnull_interface (remote_nonnull_interface *interface_dst, +make_nonnull_interface(remote_nonnull_interface *interface_dst, virInterfacePtr interface_src) { interface_dst->name = interface_src->name; @@ -5874,14 +5874,14 @@ make_nonnull_interface (remote_nonnull_interface *interface_dst, } static void -make_nonnull_storage_pool (remote_nonnull_storage_pool *pool_dst, virStoragePoolPtr pool_src) +make_nonnull_storage_pool(remote_nonnull_storage_pool *pool_dst, virStoragePoolPtr pool_src) { pool_dst->name = pool_src->name; - memcpy (pool_dst->uuid, pool_src->uuid, VIR_UUID_BUFLEN); + memcpy(pool_dst->uuid, pool_src->uuid, VIR_UUID_BUFLEN); } static void -make_nonnull_storage_vol (remote_nonnull_storage_vol *vol_dst, virStorageVolPtr vol_src) +make_nonnull_storage_vol(remote_nonnull_storage_vol *vol_dst, virStorageVolPtr vol_src) { vol_dst->pool = vol_src->pool; vol_dst->name = vol_src->name; @@ -5889,22 +5889,22 @@ make_nonnull_storage_vol (remote_nonnull_storage_vol *vol_dst, virStorageVolPtr } static void -make_nonnull_secret (remote_nonnull_secret *secret_dst, virSecretPtr secret_src) +make_nonnull_secret(remote_nonnull_secret *secret_dst, virSecretPtr secret_src) { - memcpy (secret_dst->uuid, secret_src->uuid, VIR_UUID_BUFLEN); + memcpy(secret_dst->uuid, secret_src->uuid, VIR_UUID_BUFLEN); secret_dst->usageType = secret_src->usageType; secret_dst->usageID = secret_src->usageID; } static void -make_nonnull_nwfilter (remote_nonnull_nwfilter *nwfilter_dst, virNWFilterPtr nwfilter_src) +make_nonnull_nwfilter(remote_nonnull_nwfilter *nwfilter_dst, virNWFilterPtr nwfilter_src) { nwfilter_dst->name = nwfilter_src->name; - memcpy (nwfilter_dst->uuid, nwfilter_src->uuid, VIR_UUID_BUFLEN); + memcpy(nwfilter_dst->uuid, nwfilter_src->uuid, VIR_UUID_BUFLEN); } static void -make_nonnull_domain_snapshot (remote_nonnull_domain_snapshot *snapshot_dst, virDomainSnapshotPtr snapshot_src) +make_nonnull_domain_snapshot(remote_nonnull_domain_snapshot *snapshot_dst, virDomainSnapshotPtr snapshot_src) { snapshot_dst->name = snapshot_src->name; make_nonnull_domain(&snapshot_dst->dom, snapshot_src->domain); @@ -6252,19 +6252,19 @@ static virStateDriver state_driver = { * Returns -1 on error. */ int -remoteRegister (void) +remoteRegister(void) { remoteDriver = &remote_driver; - if (virRegisterDriver (&remote_driver) == -1) return -1; - if (virRegisterNetworkDriver (&network_driver) == -1) return -1; - if (virRegisterInterfaceDriver (&interface_driver) == -1) return -1; - if (virRegisterStorageDriver (&storage_driver) == -1) return -1; - if (virRegisterDeviceMonitor (&dev_monitor) == -1) return -1; - if (virRegisterSecretDriver (&secret_driver) == -1) return -1; + if (virRegisterDriver(&remote_driver) == -1) return -1; + if (virRegisterNetworkDriver(&network_driver) == -1) return -1; + if (virRegisterInterfaceDriver(&interface_driver) == -1) return -1; + if (virRegisterStorageDriver(&storage_driver) == -1) return -1; + if (virRegisterDeviceMonitor(&dev_monitor) == -1) return -1; + if (virRegisterSecretDriver(&secret_driver) == -1) return -1; if (virRegisterNWFilterDriver(&nwfilter_driver) == -1) return -1; #ifdef WITH_LIBVIRTD - if (virRegisterStateDriver (&state_driver) == -1) return -1; + if (virRegisterStateDriver(&state_driver) == -1) return -1; #endif return 0; diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c index 18f60c1..bf2547c 100644 --- a/src/rpc/virnetclient.c +++ b/src/rpc/virnetclient.c @@ -754,14 +754,14 @@ int virNetClientSetTLSSession(virNetClientPtr client, struct pollfd fds[1]; sigset_t oldmask, blockedsigs; - sigemptyset (&blockedsigs); + sigemptyset(&blockedsigs); #ifdef SIGWINCH - sigaddset (&blockedsigs, SIGWINCH); + sigaddset(&blockedsigs, SIGWINCH); #endif #ifdef SIGCHLD - sigaddset (&blockedsigs, SIGCHLD); + sigaddset(&blockedsigs, SIGCHLD); #endif - sigaddset (&blockedsigs, SIGPIPE); + sigaddset(&blockedsigs, SIGPIPE); virNetClientLock(client); @@ -1510,14 +1510,14 @@ static int virNetClientIOEventLoop(virNetClientPtr client, * after the call (RHBZ#567931). Same for SIGCHLD and SIGPIPE * at the suggestion of Paolo Bonzini and Daniel Berrange. */ - sigemptyset (&blockedsigs); + sigemptyset(&blockedsigs); #ifdef SIGWINCH - sigaddset (&blockedsigs, SIGWINCH); + sigaddset(&blockedsigs, SIGWINCH); #endif #ifdef SIGCHLD - sigaddset (&blockedsigs, SIGCHLD); + sigaddset(&blockedsigs, SIGCHLD); #endif - sigaddset (&blockedsigs, SIGPIPE); + sigaddset(&blockedsigs, SIGPIPE); ignore_value(pthread_sigmask(SIG_BLOCK, &blockedsigs, &oldmask)); repoll: diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c index 2777e66..ed26719 100644 --- a/src/rpc/virnetserverclient.c +++ b/src/rpc/virnetserverclient.c @@ -1196,7 +1196,7 @@ virNetServerClientDispatchHandshake(virNetServerClientPtr client) /* Carry on waiting for more handshake. Update the events just in case handshake data flow direction has changed */ - virNetServerClientUpdateEvent (client); + virNetServerClientUpdateEvent(client); } else { /* Fatal error in handshake */ client->wantClose = true; diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index 55243b9..a1b64d7 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -453,7 +453,7 @@ int virNetSocketNewConnectTCP(const char *nodename, if (e != 0) { virReportError(VIR_ERR_SYSTEM_ERROR, _("Unable to resolve address '%s' service '%s': %s"), - nodename, service, gai_strerror (e)); + nodename, service, gai_strerror(e)); return -1; } diff --git a/src/rpc/virnettlscontext.c b/src/rpc/virnettlscontext.c index 0c89a54..5f46803 100644 --- a/src/rpc/virnettlscontext.c +++ b/src/rpc/virnettlscontext.c @@ -600,7 +600,7 @@ static int virNetTLSContextLoadCredentials(virNetTLSContextPtr ctxt, if (err < 0) { virReportError(VIR_ERR_SYSTEM_ERROR, _("Unable to set x509 CA certificate: %s: %s"), - cacert, gnutls_strerror (err)); + cacert, gnutls_strerror(err)); goto cleanup; } } diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c index 9ce1e33..d6f7f4f 100644 --- a/src/secret/secret_driver.c +++ b/src/secret/secret_driver.c @@ -171,7 +171,7 @@ replaceFile(const char *filename, void *data, size_t size) virReportOOMError(); goto cleanup; } - fd = mkstemp (tmp_path); + fd = mkstemp(tmp_path); if (fd == -1) { virReportSystemError(errno, _("mkstemp('%s') failed"), tmp_path); goto cleanup; diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index 51daa4b..8a44f37 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -678,7 +678,7 @@ caps_mockup(vahControl * ctl, const char *xmlStr) struct utsname utsname; /* Really, this never fails - look at the man-page. */ - uname (&utsname); + uname(&utsname); if ((ctl->arch = strdup(utsname.machine)) == NULL) { vah_error(ctl, 0, _("could not allocate memory")); goto cleanup; @@ -692,7 +692,7 @@ caps_mockup(vahControl * ctl, const char *xmlStr) rc = 0; cleanup: - xmlFreeDoc (xml); + xmlFreeDoc(xml); xmlXPathFreeContext(ctxt); return rc; diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index aea70e2..0c28d0d 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c @@ -128,7 +128,7 @@ enum { #define READ_BLOCK_SIZE_DEFAULT (1024 * 1024) #define WRITE_BLOCK_SIZE_DEFAULT (4 * 1024) -static int ATTRIBUTE_NONNULL (2) +static int ATTRIBUTE_NONNULL(2) virStorageBackendCopyToFD(virStorageVolDefPtr vol, virStorageVolDefPtr inputvol, int fd, @@ -1621,18 +1621,18 @@ virStorageBackendRunProgNul(virStoragePoolObjPtr pool, size_t buf_len = 0; /* Be careful: even when it returns -1, this use of getdelim allocates memory. */ - ssize_t tok_len = getdelim (&buf, &buf_len, 0, fp); + ssize_t tok_len = getdelim(&buf, &buf_len, 0, fp); v[n_tok] = buf; if (tok_len < 0) { /* Maybe EOF, maybe an error. If n_tok > 0, then we know it's an error. */ - if (n_tok && func (pool, n_tok, v, data) < 0) + if (n_tok && func(pool, n_tok, v, data) < 0) goto cleanup; break; } ++n_tok; if (n_tok == n_columns) { - if (func (pool, n_tok, v, data) < 0) + if (func(pool, n_tok, v, data) < 0) goto cleanup; n_tok = 0; for (i = 0; i < n_columns; i++) { diff --git a/src/storage/storage_backend_disk.c b/src/storage/storage_backend_disk.c index 5d9e72f..afefbf3 100644 --- a/src/storage/storage_backend_disk.c +++ b/src/storage/storage_backend_disk.c @@ -365,7 +365,7 @@ virStorageBackendDiskFindLabel(const char* device) /* if parted succeeds we have a valid partition table */ ret = virCommandRun(cmd, NULL); if (ret < 0) { - if (strstr (output, "unrecognised disk label")) + if (strstr(output, "unrecognised disk label")) ret = 1; } @@ -410,7 +410,7 @@ virStorageBackendDiskBuildPool(virConnectPtr conn ATTRIBUTE_UNUSED, else { int check; - check = virStorageBackendDiskFindLabel ( + check = virStorageBackendDiskFindLabel( pool->def->source.devices[0].path); if (check > 0) { ok_to_mklabel = true; diff --git a/src/storage/storage_backend_mpath.c b/src/storage/storage_backend_mpath.c index 4c74e8c..efcfb28 100644 --- a/src/storage/storage_backend_mpath.c +++ b/src/storage/storage_backend_mpath.c @@ -287,7 +287,7 @@ virStorageBackendGetMaps(virStoragePoolObjPtr pool) out: if (dmt != NULL) { - dm_task_destroy (dmt); + dm_task_destroy(dmt); } return retval; } diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 28829d3..68fe253 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -142,7 +142,7 @@ storageDriverStartup(int privileged) storageDriverLock(driverState); if (privileged) { - if ((base = strdup (SYSCONFDIR "/libvirt")) == NULL) + if ((base = strdup(SYSCONFDIR "/libvirt")) == NULL) goto out_of_memory; } else { base = virGetUserConfigDirectory(); diff --git a/src/test/test_driver.c b/src/test/test_driver.c index c9f9115..f6bd80b 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -336,7 +336,7 @@ testDomainGenerateIfname(virDomainDefPtr domdef) { /* Generate network interface names */ for (i = 0 ; i < domdef->nnets ; i++) { if (domdef->nets[i]->ifname && - STREQ (domdef->nets[i]->ifname, ifname)) { + STREQ(domdef->nets[i]->ifname, ifname)) { found = 1; break; } @@ -1175,7 +1175,7 @@ static int testClose(virConnectPtr conn) testDriverUnlock(privconn); virMutexDestroy(&privconn->lock); - VIR_FREE (privconn); + VIR_FREE(privconn); conn->privateData = NULL; return 0; } @@ -1218,7 +1218,7 @@ static int testNodeGetInfo(virConnectPtr conn, return 0; } -static char *testGetCapabilities (virConnectPtr conn) +static char *testGetCapabilities(virConnectPtr conn) { testConnPtr privconn = conn->privateData; char *xml; @@ -1416,9 +1416,9 @@ cleanup: return ret; } -static int testListDomains (virConnectPtr conn, - int *ids, - int maxids) +static int testListDomains(virConnectPtr conn, + int *ids, + int maxids) { testConnPtr privconn = conn->privateData; int n; @@ -1430,7 +1430,7 @@ static int testListDomains (virConnectPtr conn, return n; } -static int testDestroyDomain (virDomainPtr domain) +static int testDestroyDomain(virDomainPtr domain) { testConnPtr privconn = domain->conn->privateData; virDomainObjPtr privdom; @@ -1467,7 +1467,7 @@ cleanup: return ret; } -static int testResumeDomain (virDomainPtr domain) +static int testResumeDomain(virDomainPtr domain) { testConnPtr privconn = domain->conn->privateData; virDomainObjPtr privdom; @@ -1508,7 +1508,7 @@ cleanup: return ret; } -static int testPauseDomain (virDomainPtr domain) +static int testPauseDomain(virDomainPtr domain) { testConnPtr privconn = domain->conn->privateData; virDomainObjPtr privdom; @@ -1597,14 +1597,14 @@ cleanup: return ret; } -static int testShutdownDomain (virDomainPtr domain) +static int testShutdownDomain(virDomainPtr domain) { return testShutdownDomainFlags(domain, 0); } /* Similar behaviour as shutdown */ -static int testRebootDomain (virDomainPtr domain, - unsigned int action ATTRIBUTE_UNUSED) +static int testRebootDomain(virDomainPtr domain, + unsigned int action ATTRIBUTE_UNUSED) { testConnPtr privconn = domain->conn->privateData; virDomainObjPtr privdom; @@ -1673,8 +1673,8 @@ cleanup: return ret; } -static int testGetDomainInfo (virDomainPtr domain, - virDomainInfoPtr info) +static int testGetDomainInfo(virDomainPtr domain, + virDomainInfoPtr info) { testConnPtr privconn = domain->conn->privateData; struct timeval tv; @@ -2851,7 +2851,7 @@ static int testDomainInterfaceStats(virDomainPtr domain, for (i = 0 ; i < privdom->def->nnets ; i++) { if (privdom->def->nets[i]->ifname && - STREQ (privdom->def->nets[i]->ifname, path)) { + STREQ(privdom->def->nets[i]->ifname, path)) { found = 1; break; } diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c index 1d91ce8..036181c 100644 --- a/src/uml/uml_conf.c +++ b/src/uml/uml_conf.c @@ -65,7 +65,7 @@ virCapsPtr umlCapsInit(void) { virCapsGuestPtr guest; /* Really, this never fails - look at the man-page. */ - uname (&utsname); + uname(&utsname); if ((caps = virCapabilitiesNew(utsname.machine, 0, 0)) == NULL) diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index ba37eb7..c6dc470 100644 --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -455,7 +455,7 @@ umlStartup(int privileged) "%s/log/libvirt/uml", LOCALSTATEDIR) == -1) goto out_of_memory; - if ((base = strdup (SYSCONFDIR "/libvirt")) == NULL) + if ((base = strdup(SYSCONFDIR "/libvirt")) == NULL) goto out_of_memory; if (virAsprintf(¨_driver->monitorDir, @@ -1173,7 +1173,7 @@ static virDrvOpenStatus umlOpen(virConnectPtr conn, return VIR_DRV_OPEN_ERROR; } else { if (conn->uri->scheme == NULL || - STRNEQ (conn->uri->scheme, "uml")) + STRNEQ(conn->uri->scheme, "uml")) return VIR_DRV_OPEN_DECLINED; /* Allow remote driver to deal with URIs with hostname server */ @@ -1183,15 +1183,15 @@ static virDrvOpenStatus umlOpen(virConnectPtr conn, /* Check path and tell them correct path if they made a mistake */ if (uml_driver->privileged) { - if (STRNEQ (conn->uri->path, "/system") && - STRNEQ (conn->uri->path, "/session")) { + if (STRNEQ(conn->uri->path, "/system") && + STRNEQ(conn->uri->path, "/session")) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unexpected UML URI path '%s', try uml:///system"), conn->uri->path); return VIR_DRV_OPEN_ERROR; } } else { - if (STRNEQ (conn->uri->path, "/session")) { + if (STRNEQ(conn->uri->path, "/session")) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unexpected UML URI path '%s', try uml:///session"), conn->uri->path); diff --git a/src/util/command.c b/src/util/command.c index 2657a1d..ebdd636 100644 --- a/src/util/command.c +++ b/src/util/command.c @@ -269,7 +269,7 @@ virFork(pid_t *pid) if (*pid < 0) { /* attempt to restore signal mask, but ignore failure, to avoid obscuring the fork failure */ - ignore_value (pthread_sigmask(SIG_SETMASK, &oldmask, NULL)); + ignore_value(pthread_sigmask(SIG_SETMASK, &oldmask, NULL)); virReportSystemError(saved_errno, "%s", _("cannot fork child process")); goto cleanup; diff --git a/src/util/conf.c b/src/util/conf.c index 4df62b1..4b1e40a 100644 --- a/src/util/conf.c +++ b/src/util/conf.c @@ -491,7 +491,7 @@ virConfParseValue(virConfParserCtxtPtr ctxt) "lst" is guaranteed to be non-NULL. This stops it from issuing an invalid NULL-dereference warning about "prev = lst; while (prev->next..." below. */ - sa_assert (lst); + sa_assert(lst); if (CUR != ',') { virConfError(ctxt, VIR_ERR_CONF_SYNTAX, @@ -877,9 +877,9 @@ virConfGetValue(virConfPtr conf, const char *setting) * Returns 0 on success, or -1 on failure. */ int -virConfSetValue (virConfPtr conf, - const char *setting, - virConfValuePtr value) +virConfSetValue(virConfPtr conf, + const char *setting, + virConfValuePtr value) { virConfEntryPtr cur, prev = NULL; diff --git a/src/util/logging.c b/src/util/logging.c index 9a8bba1..dadc8b0 100644 --- a/src/util/logging.c +++ b/src/util/logging.c @@ -356,13 +356,13 @@ virLogDumpAllFD(const char *msg, int len) int fd = (intptr_t) virLogOutputs[i].data; if (fd >= 0) { - ignore_value (safewrite(fd, msg, len)); + ignore_value(safewrite(fd, msg, len)); found = 1; } } } if (!found) - ignore_value (safewrite(STDERR_FILENO, msg, len)); + ignore_value(safewrite(STDERR_FILENO, msg, len)); } diff --git a/src/util/pci.c b/src/util/pci.c index 83d86b7..d1ad121 100644 --- a/src/util/pci.c +++ b/src/util/pci.c @@ -1857,7 +1857,7 @@ pciGetPciConfigAddressFromSysfsDeviceLink(const char *device_link, return ret; } - device_path = canonicalize_file_name (device_link); + device_path = canonicalize_file_name(device_link); if (device_path == NULL) { memset(errbuf, '\0', sizeof(errbuf)); virReportError(VIR_ERR_INTERNAL_ERROR, diff --git a/src/util/stats_linux.c b/src/util/stats_linux.c index a0daee9..2dfc30d 100644 --- a/src/util/stats_linux.c +++ b/src/util/stats_linux.c @@ -56,16 +56,16 @@ linuxDomainInterfaceStats(const char *path, FILE *fp; char line[256], *colon; - fp = fopen ("/proc/net/dev", "r"); + fp = fopen("/proc/net/dev", "r"); if (!fp) { virReportSystemError(errno, "%s", _("Could not open /proc/net/dev")); return -1; } - path_len = strlen (path); + path_len = strlen(path); - while (fgets (line, sizeof(line), fp)) { + while (fgets(line, sizeof(line), fp)) { long long dummy; long long rx_bytes; long long rx_packets; @@ -80,23 +80,23 @@ linuxDomainInterfaceStats(const char *path, * " eth0:..." * Split it at the colon. */ - colon = strchr (line, ':'); + colon = strchr(line, ':'); if (!colon) continue; *colon = '\0'; if (colon-path_len >= line && - STREQ (colon-path_len, path)) { + STREQ(colon-path_len, path)) { /* IMPORTANT NOTE! * /proc/net/dev vif<domid>.nn sees the network from the point * of view of dom0 / hypervisor. So bytes TRANSMITTED by dom0 * are bytes RECEIVED by the domain. That's why the TX/RX fields * appear to be swapped here. */ - if (sscanf (colon+1, - "%lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld", - &tx_bytes, &tx_packets, &tx_errs, &tx_drop, - &dummy, &dummy, &dummy, &dummy, - &rx_bytes, &rx_packets, &rx_errs, &rx_drop, - &dummy, &dummy, &dummy, &dummy) != 16) + if (sscanf(colon+1, + "%lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld", + &tx_bytes, &tx_packets, &tx_errs, &tx_drop, + &dummy, &dummy, &dummy, &dummy, + &rx_bytes, &rx_packets, &rx_errs, &rx_drop, + &dummy, &dummy, &dummy, &dummy) != 16) continue; stats->rx_bytes = rx_bytes; @@ -107,7 +107,7 @@ linuxDomainInterfaceStats(const char *path, stats->tx_packets = tx_packets; stats->tx_errs = tx_errs; stats->tx_drop = tx_drop; - VIR_FORCE_FCLOSE (fp); + VIR_FORCE_FCLOSE(fp); return 0; } diff --git a/src/util/storage_file.c b/src/util/storage_file.c index eea760c..591753b 100644 --- a/src/util/storage_file.c +++ b/src/util/storage_file.c @@ -198,7 +198,7 @@ cowGetBackingStore(char **res, if (buf[4+4] == '\0') /* cow_header_v2.backing_file[0] */ return BACKING_STORE_OK; - *res = strndup ((const char*)buf + 4+4, COW_FILENAME_MAXLEN); + *res = strndup((const char*)buf + 4+4, COW_FILENAME_MAXLEN); if (*res == NULL) { virReportOOMError(); return BACKING_STORE_ERROR; @@ -503,7 +503,7 @@ static char * absolutePathFromBaseFile(const char *base_file, const char *path) { char *res; - size_t d_len = dir_len (base_file); + size_t d_len = dir_len(base_file); /* If path is already absolute, or if dirname(base_file) is ".", just return a copy of path. */ diff --git a/src/util/util.c b/src/util/util.c index bf60837..fb9a63d 100644 --- a/src/util/util.c +++ b/src/util/util.c @@ -285,7 +285,7 @@ int virSetInherit(int fd ATTRIBUTE_UNUSED, bool inherit ATTRIBUTE_UNUSED) #endif /* WIN32 */ int virSetBlocking(int fd, bool blocking) { - return set_nonblocking_flag (fd, !blocking); + return set_nonblocking_flag(fd, !blocking); } int virSetNonBlock(int fd) { @@ -386,7 +386,7 @@ error: number of bytes. If the length of the input is <= max_len, and upon error while reading that data, it works just like fread_file. */ static char * -saferead_lim (int fd, size_t max_len, size_t *length) +saferead_lim(int fd, size_t max_len, size_t *length) { char *buf = NULL; size_t alloc = 0; @@ -409,9 +409,9 @@ saferead_lim (int fd, size_t max_len, size_t *length) } /* Ensure that (size + requested <= max_len); */ - requested = MIN (size < max_len ? max_len - size : 0, - alloc - size - 1); - count = saferead (fd, buf + size, requested); + requested = MIN(size < max_len ? max_len - size : 0, + alloc - size - 1); + count = saferead(fd, buf + size, requested); size += count; if (count != requested || requested == 0) { @@ -441,7 +441,7 @@ virFileReadLimFD(int fd, int maxlen, char **buf) errno = EINVAL; return -1; } - s = saferead_lim (fd, maxlen+1, &len); + s = saferead_lim(fd, maxlen+1, &len); if (s == NULL) return -1; if (len > maxlen || (int)len != len) { @@ -540,9 +540,9 @@ int virFileLinkPointsTo(const char *checkLink, struct stat src_sb; struct stat dest_sb; - return (stat (checkLink, &src_sb) == 0 - && stat (checkDest, &dest_sb) == 0 - && SAME_INODE (src_sb, dest_sb)); + return (stat(checkLink, &src_sb) == 0 + && stat(checkDest, &dest_sb) == 0 + && SAME_INODE(src_sb, dest_sb)); } @@ -678,7 +678,7 @@ char *virFindFileInPath(const char *file) bool virFileIsDir(const char *path) { struct stat s; - return (stat (path, &s) == 0) && S_ISDIR (s.st_mode); + return (stat(path, &s) == 0) && S_ISDIR(s.st_mode); } bool virFileExists(const char *path) @@ -2268,7 +2268,7 @@ char *virGetHostname(virConnectPtr conn ATTRIBUTE_UNUSED) char hostname[HOST_NAME_MAX+1], *result; struct addrinfo hints, *info; - r = gethostname (hostname, sizeof(hostname)); + r = gethostname(hostname, sizeof(hostname)); if (r == -1) { virReportSystemError(errno, "%s", _("failed to determine host name")); @@ -2303,7 +2303,7 @@ char *virGetHostname(virConnectPtr conn ATTRIBUTE_UNUSED) } /* Tell static analyzers about getaddrinfo semantics. */ - sa_assert (info); + sa_assert(info); if (info->ai_canonname == NULL || STRPREFIX(info->ai_canonname, "localhost")) @@ -2314,7 +2314,7 @@ char *virGetHostname(virConnectPtr conn ATTRIBUTE_UNUSED) result = strdup(hostname); else /* Caller frees this string. */ - result = strdup (info->ai_canonname); + result = strdup(info->ai_canonname); freeaddrinfo(info); @@ -2825,7 +2825,7 @@ virGetUserDirectory(void) */ if (dir) { char *p; - while ((p = strchr (dir, '/')) != NULL) + while ((p = strchr(dir, '/')) != NULL) *p = '\\'; } diff --git a/src/util/virterror.c b/src/util/virterror.c index 9572116..e49e320 100644 --- a/src/util/virterror.c +++ b/src/util/virterror.c @@ -1319,7 +1319,7 @@ void virReportSystemErrorFull(int domcode, size_t len = strlen(errnoDetail); if (0 <= n && n + 2 + len < sizeof(msgDetailBuf)) { char *p = msgDetailBuf + n; - stpcpy (stpcpy (p, ": "), errnoDetail); + stpcpy(stpcpy(p, ": "), errnoDetail); msgDetail = msgDetailBuf; } } diff --git a/src/util/virtime.c b/src/util/virtime.c index bd6fdce..a2610c4 100644 --- a/src/util/virtime.c +++ b/src/util/virtime.c @@ -159,8 +159,8 @@ int virTimeFieldsThenRaw(unsigned long long when, struct tm *fields) /* Adjust DAYS and Y to match the guessed year. */ days -= ((yg - y) * 365 - + LEAPS_THRU_END_OF (yg - 1) - - LEAPS_THRU_END_OF (y - 1)); + + LEAPS_THRU_END_OF(yg - 1) + - LEAPS_THRU_END_OF(y - 1)); y = yg; } fields->tm_year = y - 1900; diff --git a/src/util/viruri.c b/src/util/viruri.c index 47d41a3..26dbf24 100644 --- a/src/util/viruri.c +++ b/src/util/viruri.c @@ -39,7 +39,7 @@ virURIParamAppend(virURIPtr uri, if (!(pname = strdup(name))) goto no_memory; - if (!(pvalue = strdup (value))) + if (!(pvalue = strdup(value))) goto no_memory; if (VIR_RESIZE_N(uri->params, uri->paramsAlloc, uri->paramsCount, 1) < 0) @@ -73,14 +73,14 @@ virURIParseParams(virURIPtr uri) char *name = NULL, *value = NULL; /* Find the next separator, or end of the string. */ - end = strchr (query, '&'); + end = strchr(query, '&'); if (!end) - end = strchr (query, ';'); + end = strchr(query, ';'); if (!end) - end = query + strlen (query); + end = query + strlen(query); /* Find the first '=' character between here and end. */ - eq = strchr (query, '='); + eq = strchr(query, '='); if (eq && eq >= end) eq = NULL; /* Empty section (eg. "&&"). */ @@ -91,14 +91,14 @@ virURIParseParams(virURIPtr uri) * and consistent with CGI.pm we assume value is "". */ else if (!eq) { - name = xmlURIUnescapeString (query, end - query, NULL); + name = xmlURIUnescapeString(query, end - query, NULL); if (!name) goto no_memory; } /* Or if we have "name=" here (works around annoying * problem when calling xmlURIUnescapeString with len = 0). */ else if (eq+1 == end) { - name = xmlURIUnescapeString (query, eq - query, NULL); + name = xmlURIUnescapeString(query, eq - query, NULL); if (!name) goto no_memory; } /* If the '=' character is at the beginning then we have @@ -109,10 +109,10 @@ virURIParseParams(virURIPtr uri) /* Otherwise it's "name=value". */ else { - name = xmlURIUnescapeString (query, eq - query, NULL); + name = xmlURIUnescapeString(query, eq - query, NULL); if (!name) goto no_memory; - value = xmlURIUnescapeString (eq+1, end - (eq+1), NULL); + value = xmlURIUnescapeString(eq+1, end - (eq+1), NULL); if (!value) { VIR_FREE(name); goto no_memory; @@ -292,9 +292,9 @@ char *virURIFormatParams(virURIPtr uri) for (i = 0; i < uri->paramsCount; ++i) { if (!uri->params[i].ignore) { - if (amp) virBufferAddChar (&buf, '&'); - virBufferStrcat (&buf, uri->params[i].name, "=", NULL); - virBufferURIEncodeString (&buf, uri->params[i].value); + if (amp) virBufferAddChar(&buf, '&'); + virBufferStrcat(&buf, uri->params[i].name, "=", NULL); + virBufferURIEncodeString(&buf, uri->params[i].value); amp = 1; } } diff --git a/src/vbox/vbox_driver.c b/src/vbox/vbox_driver.c index c4037f8..56726ed 100644 --- a/src/vbox/vbox_driver.c +++ b/src/vbox/vbox_driver.c @@ -151,7 +151,7 @@ static virDrvOpenStatus vboxOpenDummy(virConnectPtr conn, if (conn->uri == NULL || conn->uri->scheme == NULL || - STRNEQ (conn->uri->scheme, "vbox") || + STRNEQ(conn->uri->scheme, "vbox") || conn->uri->server != NULL) return VIR_DRV_OPEN_DECLINED; @@ -162,14 +162,14 @@ static virDrvOpenStatus vboxOpenDummy(virConnectPtr conn, } if (uid != 0) { - if (STRNEQ (conn->uri->path, "/session")) { + if (STRNEQ(conn->uri->path, "/session")) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unknown driver path '%s' specified (try vbox:///session)"), conn->uri->path); return VIR_DRV_OPEN_ERROR; } } else { /* root */ - if (STRNEQ (conn->uri->path, "/system") && - STRNEQ (conn->uri->path, "/session")) { + if (STRNEQ(conn->uri->path, "/system") && + STRNEQ(conn->uri->path, "/session")) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unknown driver path '%s' specified (try vbox:///system)"), conn->uri->path); return VIR_DRV_OPEN_ERROR; diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c index 0eeac85..132a033 100644 --- a/src/vbox/vbox_tmpl.c +++ b/src/vbox/vbox_tmpl.c @@ -154,7 +154,7 @@ if (strUtf16) {\ #define DEBUGUUID(msg, iid) \ {\ - VIR_DEBUG (msg ": {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",\ + VIR_DEBUG(msg ": {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",\ (unsigned)(iid)->m0,\ (unsigned)(iid)->m1,\ (unsigned)(iid)->m2,\ @@ -982,7 +982,7 @@ static virDrvOpenStatus vboxOpen(virConnectPtr conn, return VIR_DRV_OPEN_ERROR; if (conn->uri->scheme == NULL || - STRNEQ (conn->uri->scheme, "vbox")) + STRNEQ(conn->uri->scheme, "vbox")) return VIR_DRV_OPEN_DECLINED; /* Leave for remote driver */ @@ -996,14 +996,14 @@ static virDrvOpenStatus vboxOpen(virConnectPtr conn, } if (uid != 0) { - if (STRNEQ (conn->uri->path, "/session")) { + if (STRNEQ(conn->uri->path, "/session")) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unknown driver path '%s' specified (try vbox:///session)"), conn->uri->path); return VIR_DRV_OPEN_ERROR; } } else { /* root */ - if (STRNEQ (conn->uri->path, "/system") && - STRNEQ (conn->uri->path, "/session")) { + if (STRNEQ(conn->uri->path, "/system") && + STRNEQ(conn->uri->path, "/session")) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unknown driver path '%s' specified (try vbox:///system)"), conn->uri->path); return VIR_DRV_OPEN_ERROR; @@ -7247,10 +7247,10 @@ static void vboxReadCallback(int watch ATTRIBUTE_UNUSED, } } -static int vboxDomainEventRegister (virConnectPtr conn, - virConnectDomainEventCallback callback, - void *opaque, - virFreeCallback freecb) { +static int vboxDomainEventRegister(virConnectPtr conn, + virConnectDomainEventCallback callback, + void *opaque, + virFreeCallback freecb) { VBOX_OBJECT_CHECK(conn, int, -1); int vboxRet = -1; nsresult rc; @@ -7310,8 +7310,8 @@ static int vboxDomainEventRegister (virConnectPtr conn, } } -static int vboxDomainEventDeregister (virConnectPtr conn, - virConnectDomainEventCallback callback) { +static int vboxDomainEventDeregister(virConnectPtr conn, + virConnectDomainEventCallback callback) { VBOX_OBJECT_CHECK(conn, int, -1); int cnt; @@ -8254,9 +8254,9 @@ cleanup: * The Storage Functions here on */ -static virDrvOpenStatus vboxStorageOpen (virConnectPtr conn, - virConnectAuthPtr auth ATTRIBUTE_UNUSED, - unsigned int flags) +static virDrvOpenStatus vboxStorageOpen(virConnectPtr conn, + virConnectAuthPtr auth ATTRIBUTE_UNUSED, + unsigned int flags) { vboxGlobalData *data = conn->privateData; @@ -8275,7 +8275,7 @@ static virDrvOpenStatus vboxStorageOpen (virConnectPtr conn, return VIR_DRV_OPEN_SUCCESS; } -static int vboxStorageClose (virConnectPtr conn) { +static int vboxStorageClose(virConnectPtr conn) { VIR_DEBUG("vbox storage uninitialized"); conn->storagePrivateData = NULL; return 0; diff --git a/src/xen/block_stats.c b/src/xen/block_stats.c index 5ab1ce4..e50b5ff 100644 --- a/src/xen/block_stats.c +++ b/src/xen/block_stats.c @@ -60,13 +60,13 @@ # endif static int -xstrtoint64 (char const *s, int base, int64_t *result) +xstrtoint64(char const *s, int base, int64_t *result) { long long int lli; char *p; errno = 0; - lli = strtoll (s, &p, base); + lli = strtoll(s, &p, base); if (errno || !(*p == 0 || *p == '\n') || p == s || (int64_t) lli != lli) return -1; *result = lli; @@ -74,26 +74,26 @@ xstrtoint64 (char const *s, int base, int64_t *result) } static int64_t -read_stat (const char *path) +read_stat(const char *path) { char str[64]; int64_t r; int i; FILE *fp; - fp = fopen (path, "r"); + fp = fopen(path, "r"); if (!fp) return -1; /* read, but don't bail out before closing */ - i = fread (str, 1, sizeof(str) - 1, fp); + i = fread(str, 1, sizeof(str) - 1, fp); if (VIR_FCLOSE(fp) != 0 /* disk error */ || i < 1) /* ensure we read at least one byte */ return -1; str[i] = '\0'; /* make sure the string is nul-terminated */ - if (xstrtoint64 (str, 10, &r) == -1) + if (xstrtoint64(str, 10, &r) == -1) return -1; return r; @@ -136,7 +136,7 @@ read_bd_stat(int device, int domid, const char *str) * is no connected device. */ static int -check_bd_connected (xenUnifiedPrivatePtr priv, int device, int domid) +check_bd_connected(xenUnifiedPrivatePtr priv, int device, int domid) { char s[256], *rs; int r; @@ -146,11 +146,11 @@ check_bd_connected (xenUnifiedPrivatePtr priv, int device, int domid) * xenstore, etc. */ if (!priv->xshandle) return 1; - snprintf (s, sizeof(s), "/local/domain/0/backend/vbd/%d/%d/state", - domid, device); + snprintf(s, sizeof(s), "/local/domain/0/backend/vbd/%d/%d/state", + domid, device); s[sizeof(s) - 1] = '\0'; - rs = xs_read (priv->xshandle, 0, s, &len); + rs = xs_read(priv->xshandle, 0, s, &len); if (!rs) return 1; if (len == 0) { /* Hmmm ... we can get to xenstore but it returns an empty @@ -161,7 +161,7 @@ check_bd_connected (xenUnifiedPrivatePtr priv, int device, int domid) return 0; } - r = STREQ (rs, "4"); + r = STREQ(rs, "4"); VIR_FREE(rs); return r; } @@ -170,11 +170,11 @@ static int read_bd_stats(xenUnifiedPrivatePtr priv, int device, int domid, struct _virDomainBlockStats *stats) { - stats->rd_req = read_bd_stat (device, domid, "rd_req"); - stats->rd_bytes = read_bd_stat (device, domid, "rd_sect"); - stats->wr_req = read_bd_stat (device, domid, "wr_req"); - stats->wr_bytes = read_bd_stat (device, domid, "wr_sect"); - stats->errs = read_bd_stat (device, domid, "oo_req"); + stats->rd_req = read_bd_stat(device, domid, "rd_req"); + stats->rd_bytes = read_bd_stat(device, domid, "rd_sect"); + stats->wr_req = read_bd_stat(device, domid, "wr_req"); + stats->wr_bytes = read_bd_stat(device, domid, "wr_sect"); + stats->errs = read_bd_stat(device, domid, "oo_req"); /* None of the files were found - it's likely that this version * of Xen is an old one which just doesn't support stats collection. @@ -195,7 +195,7 @@ read_bd_stats(xenUnifiedPrivatePtr priv, if (stats->rd_req == 0 && stats->rd_bytes == 0 && stats->wr_req == 0 && stats->wr_bytes == 0 && stats->errs == 0 && - !check_bd_connected (priv, device, domid)) { + !check_bd_connected(priv, device, domid)) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Frontend block device not connected for domain %d"), domid); @@ -358,10 +358,10 @@ xenLinuxDomainDeviceID(int domid, const char *path) } int -xenLinuxDomainBlockStats (xenUnifiedPrivatePtr priv, - virDomainPtr dom, - const char *path, - struct _virDomainBlockStats *stats) +xenLinuxDomainBlockStats(xenUnifiedPrivatePtr priv, + virDomainPtr dom, + const char *path, + struct _virDomainBlockStats *stats) { int device = xenLinuxDomainDeviceID(dom->id, path); diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c index 6f08aad..ef49bce 100644 --- a/src/xen/xen_driver.c +++ b/src/xen/xen_driver.c @@ -69,13 +69,13 @@ #define VIR_FROM_THIS VIR_FROM_XEN static int -xenUnifiedNodeGetInfo (virConnectPtr conn, virNodeInfoPtr info); +xenUnifiedNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info); static int -xenUnifiedDomainGetMaxVcpus (virDomainPtr dom); +xenUnifiedDomainGetMaxVcpus(virDomainPtr dom); static int -xenUnifiedDomainGetVcpus (virDomainPtr dom, - virVcpuInfoPtr info, int maxinfo, - unsigned char *cpumaps, int maplen); +xenUnifiedDomainGetVcpus(virDomainPtr dom, + virVcpuInfoPtr info, int maxinfo, + unsigned char *cpumaps, int maplen); /* The five Xen drivers below us. */ @@ -201,7 +201,7 @@ done: #ifdef WITH_LIBVIRTD static int -xenInitialize (int privileged ATTRIBUTE_UNUSED) +xenInitialize(int privileged ATTRIBUTE_UNUSED) { inside_daemon = 1; return 0; @@ -226,7 +226,7 @@ static virStateDriver state_driver = { */ static int -xenUnifiedProbe (void) +xenUnifiedProbe(void) { #ifdef __linux__ if (virFileExists("/proc/xen")) @@ -245,7 +245,7 @@ xenUnifiedProbe (void) #ifdef WITH_LIBXL static int -xenUnifiedXendProbe (void) +xenUnifiedXendProbe(void) { virCommandPtr cmd; int status; @@ -263,7 +263,7 @@ xenUnifiedXendProbe (void) static virDrvOpenStatus -xenUnifiedOpen (virConnectPtr conn, virConnectAuthPtr auth, unsigned int flags) +xenUnifiedOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int flags) { int i, ret = VIR_DRV_OPEN_DECLINED; xenUnifiedPrivatePtr priv; @@ -425,7 +425,7 @@ clean: xenUnifiedPrivatePtr priv = (xenUnifiedPrivatePtr) (conn)->privateData static int -xenUnifiedClose (virConnectPtr conn) +xenUnifiedClose(virConnectPtr conn) { GET_PRIVATE(conn); int i; @@ -455,7 +455,7 @@ unsigned long xenUnifiedVersion(void) static const char * -xenUnifiedType (virConnectPtr conn) +xenUnifiedType(virConnectPtr conn) { GET_PRIVATE(conn); int i; @@ -469,7 +469,7 @@ xenUnifiedType (virConnectPtr conn) /* Which features are supported by this driver? */ static int -xenUnifiedSupportsFeature (virConnectPtr conn ATTRIBUTE_UNUSED, int feature) +xenUnifiedSupportsFeature(virConnectPtr conn ATTRIBUTE_UNUSED, int feature) { switch (feature) { case VIR_DRV_FEATURE_MIGRATION_V1: @@ -481,7 +481,7 @@ xenUnifiedSupportsFeature (virConnectPtr conn ATTRIBUTE_UNUSED, int feature) } static int -xenUnifiedGetVersion (virConnectPtr conn, unsigned long *hvVer) +xenUnifiedGetVersion(virConnectPtr conn, unsigned long *hvVer) { GET_PRIVATE(conn); int i; @@ -489,7 +489,7 @@ xenUnifiedGetVersion (virConnectPtr conn, unsigned long *hvVer) for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) if (priv->opened[i] && drivers[i]->xenVersion && - drivers[i]->xenVersion (conn, hvVer) == 0) + drivers[i]->xenVersion(conn, hvVer) == 0) return 0; return -1; @@ -523,17 +523,17 @@ xenUnifiedIsAlive(virConnectPtr conn ATTRIBUTE_UNUSED) } int -xenUnifiedGetMaxVcpus (virConnectPtr conn, const char *type) +xenUnifiedGetMaxVcpus(virConnectPtr conn, const char *type) { GET_PRIVATE(conn); - if (type && STRCASENEQ (type, "Xen")) { + if (type && STRCASENEQ(type, "Xen")) { virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__); return -1; } if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET]) - return xenHypervisorGetMaxVcpus (conn, type); + return xenHypervisorGetMaxVcpus(conn, type); else { virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__); return -1; @@ -541,7 +541,7 @@ xenUnifiedGetMaxVcpus (virConnectPtr conn, const char *type) } static int -xenUnifiedNodeGetInfo (virConnectPtr conn, virNodeInfoPtr info) +xenUnifiedNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info) { GET_PRIVATE(conn); @@ -551,7 +551,7 @@ xenUnifiedNodeGetInfo (virConnectPtr conn, virNodeInfoPtr info) } static char * -xenUnifiedGetCapabilities (virConnectPtr conn) +xenUnifiedGetCapabilities(virConnectPtr conn) { xenUnifiedPrivatePtr priv = conn->privateData; char *xml; @@ -565,26 +565,26 @@ xenUnifiedGetCapabilities (virConnectPtr conn) } static int -xenUnifiedListDomains (virConnectPtr conn, int *ids, int maxids) +xenUnifiedListDomains(virConnectPtr conn, int *ids, int maxids) { GET_PRIVATE(conn); int ret; /* Try xenstore. */ if (priv->opened[XEN_UNIFIED_XS_OFFSET]) { - ret = xenStoreListDomains (conn, ids, maxids); + ret = xenStoreListDomains(conn, ids, maxids); if (ret >= 0) return ret; } /* Try HV. */ if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET]) { - ret = xenHypervisorListDomains (conn, ids, maxids); + ret = xenHypervisorListDomains(conn, ids, maxids); if (ret >= 0) return ret; } /* Try xend. */ if (priv->opened[XEN_UNIFIED_XEND_OFFSET]) { - ret = xenDaemonListDomains (conn, ids, maxids); + ret = xenDaemonListDomains(conn, ids, maxids); if (ret >= 0) return ret; } @@ -592,26 +592,26 @@ xenUnifiedListDomains (virConnectPtr conn, int *ids, int maxids) } static int -xenUnifiedNumOfDomains (virConnectPtr conn) +xenUnifiedNumOfDomains(virConnectPtr conn) { GET_PRIVATE(conn); int ret; /* Try xenstore. */ if (priv->opened[XEN_UNIFIED_XS_OFFSET]) { - ret = xenStoreNumOfDomains (conn); + ret = xenStoreNumOfDomains(conn); if (ret >= 0) return ret; } /* Try HV. */ if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET]) { - ret = xenHypervisorNumOfDomains (conn); + ret = xenHypervisorNumOfDomains(conn); if (ret >= 0) return ret; } /* Try xend. */ if (priv->opened[XEN_UNIFIED_XEND_OFFSET]) { - ret = xenDaemonNumOfDomains (conn); + ret = xenDaemonNumOfDomains(conn); if (ret >= 0) return ret; } @@ -619,8 +619,8 @@ xenUnifiedNumOfDomains (virConnectPtr conn) } static virDomainPtr -xenUnifiedDomainCreateXML (virConnectPtr conn, - const char *xmlDesc, unsigned int flags) +xenUnifiedDomainCreateXML(virConnectPtr conn, + const char *xmlDesc, unsigned int flags) { GET_PRIVATE(conn); @@ -634,7 +634,7 @@ xenUnifiedDomainCreateXML (virConnectPtr conn, * the Lookup* functions return a NULL but do not set virterror. */ static virDomainPtr -xenUnifiedDomainLookupByID (virConnectPtr conn, int id) +xenUnifiedDomainLookupByID(virConnectPtr conn, int id) { GET_PRIVATE(conn); virDomainPtr ret; @@ -642,18 +642,18 @@ xenUnifiedDomainLookupByID (virConnectPtr conn, int id) /* Reset any connection-level errors in virterror first, in case * there is one hanging around from a previous call. */ - virConnResetLastError (conn); + virConnResetLastError(conn); /* Try hypervisor/xenstore combo. */ if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET]) { - ret = xenHypervisorLookupDomainByID (conn, id); + ret = xenHypervisorLookupDomainByID(conn, id); if (ret || conn->err.code != VIR_ERR_OK) return ret; } /* Try xend. */ if (priv->opened[XEN_UNIFIED_XEND_OFFSET]) { - ret = xenDaemonLookupByID (conn, id); + ret = xenDaemonLookupByID(conn, id); if (ret || conn->err.code != VIR_ERR_OK) return ret; } @@ -664,8 +664,8 @@ xenUnifiedDomainLookupByID (virConnectPtr conn, int id) } static virDomainPtr -xenUnifiedDomainLookupByUUID (virConnectPtr conn, - const unsigned char *uuid) +xenUnifiedDomainLookupByUUID(virConnectPtr conn, + const unsigned char *uuid) { GET_PRIVATE(conn); virDomainPtr ret; @@ -673,25 +673,25 @@ xenUnifiedDomainLookupByUUID (virConnectPtr conn, /* Reset any connection-level errors in virterror first, in case * there is one hanging around from a previous call. */ - virConnResetLastError (conn); + virConnResetLastError(conn); /* Try hypervisor/xenstore combo. */ if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET]) { - ret = xenHypervisorLookupDomainByUUID (conn, uuid); + ret = xenHypervisorLookupDomainByUUID(conn, uuid); if (ret || conn->err.code != VIR_ERR_OK) return ret; } /* Try xend. */ if (priv->opened[XEN_UNIFIED_XEND_OFFSET]) { - ret = xenDaemonLookupByUUID (conn, uuid); + ret = xenDaemonLookupByUUID(conn, uuid); if (ret || conn->err.code != VIR_ERR_OK) return ret; } /* Try XM for inactive domains. */ if (priv->opened[XEN_UNIFIED_XM_OFFSET]) { - ret = xenXMDomainLookupByUUID (conn, uuid); + ret = xenXMDomainLookupByUUID(conn, uuid); if (ret || conn->err.code != VIR_ERR_OK) return ret; } @@ -702,8 +702,8 @@ xenUnifiedDomainLookupByUUID (virConnectPtr conn, } static virDomainPtr -xenUnifiedDomainLookupByName (virConnectPtr conn, - const char *name) +xenUnifiedDomainLookupByName(virConnectPtr conn, + const char *name) { GET_PRIVATE(conn); virDomainPtr ret; @@ -711,25 +711,25 @@ xenUnifiedDomainLookupByName (virConnectPtr conn, /* Reset any connection-level errors in virterror first, in case * there is one hanging around from a previous call. */ - virConnResetLastError (conn); + virConnResetLastError(conn); /* Try xend. */ if (priv->opened[XEN_UNIFIED_XEND_OFFSET]) { - ret = xenDaemonLookupByName (conn, name); + ret = xenDaemonLookupByName(conn, name); if (ret || conn->err.code != VIR_ERR_OK) return ret; } /* Try xenstore for inactive domains. */ if (priv->opened[XEN_UNIFIED_XS_OFFSET]) { - ret = xenStoreLookupByName (conn, name); + ret = xenStoreLookupByName(conn, name); if (ret || conn->err.code != VIR_ERR_OK) return ret; } /* Try XM for inactive domains. */ if (priv->opened[XEN_UNIFIED_XM_OFFSET]) { - ret = xenXMDomainLookupByName (conn, name); + ret = xenXMDomainLookupByName(conn, name); if (ret || conn->err.code != VIR_ERR_OK) return ret; } @@ -815,7 +815,7 @@ xenUnifiedDomainIsUpdated(virDomainPtr dom ATTRIBUTE_UNUSED) } static int -xenUnifiedDomainSuspend (virDomainPtr dom) +xenUnifiedDomainSuspend(virDomainPtr dom) { GET_PRIVATE(dom->conn); int i; @@ -827,7 +827,7 @@ xenUnifiedDomainSuspend (virDomainPtr dom) if (i != XEN_UNIFIED_HYPERVISOR_OFFSET && priv->opened[i] && drivers[i]->xenDomainSuspend && - drivers[i]->xenDomainSuspend (dom) == 0) + drivers[i]->xenDomainSuspend(dom) == 0) return 0; if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET] && @@ -838,7 +838,7 @@ xenUnifiedDomainSuspend (virDomainPtr dom) } static int -xenUnifiedDomainResume (virDomainPtr dom) +xenUnifiedDomainResume(virDomainPtr dom) { GET_PRIVATE(dom->conn); int i; @@ -850,7 +850,7 @@ xenUnifiedDomainResume (virDomainPtr dom) if (i != XEN_UNIFIED_HYPERVISOR_OFFSET && priv->opened[i] && drivers[i]->xenDomainResume && - drivers[i]->xenDomainResume (dom) == 0) + drivers[i]->xenDomainResume(dom) == 0) return 0; if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET] && @@ -885,7 +885,7 @@ xenUnifiedDomainShutdown(virDomainPtr dom) } static int -xenUnifiedDomainReboot (virDomainPtr dom, unsigned int flags) +xenUnifiedDomainReboot(virDomainPtr dom, unsigned int flags) { GET_PRIVATE(dom->conn); int i; @@ -893,7 +893,7 @@ xenUnifiedDomainReboot (virDomainPtr dom, unsigned int flags) for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) if (priv->opened[i] && drivers[i]->xenDomainReboot && - drivers[i]->xenDomainReboot (dom, flags) == 0) + drivers[i]->xenDomainReboot(dom, flags) == 0) return 0; return -1; @@ -932,7 +932,7 @@ xenUnifiedDomainDestroy(virDomainPtr dom) } static char * -xenUnifiedDomainGetOSType (virDomainPtr dom) +xenUnifiedDomainGetOSType(virDomainPtr dom) { GET_PRIVATE(dom->conn); int i; @@ -940,7 +940,7 @@ xenUnifiedDomainGetOSType (virDomainPtr dom) for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) if (priv->opened[i] && drivers[i]->xenDomainGetOSType) { - ret = drivers[i]->xenDomainGetOSType (dom); + ret = drivers[i]->xenDomainGetOSType(dom); if (ret) return ret; } @@ -948,7 +948,7 @@ xenUnifiedDomainGetOSType (virDomainPtr dom) } static unsigned long long -xenUnifiedDomainGetMaxMemory (virDomainPtr dom) +xenUnifiedDomainGetMaxMemory(virDomainPtr dom) { GET_PRIVATE(dom->conn); int i; @@ -956,7 +956,7 @@ xenUnifiedDomainGetMaxMemory (virDomainPtr dom) for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) if (priv->opened[i] && drivers[i]->xenDomainGetMaxMemory) { - ret = drivers[i]->xenDomainGetMaxMemory (dom); + ret = drivers[i]->xenDomainGetMaxMemory(dom); if (ret != 0) return ret; } @@ -964,14 +964,14 @@ xenUnifiedDomainGetMaxMemory (virDomainPtr dom) } static int -xenUnifiedDomainSetMaxMemory (virDomainPtr dom, unsigned long memory) +xenUnifiedDomainSetMaxMemory(virDomainPtr dom, unsigned long memory) { GET_PRIVATE(dom->conn); int i; /* Prefer xend for setting max memory */ if (priv->opened[XEN_UNIFIED_XEND_OFFSET]) { - if (xenDaemonDomainSetMaxMemory (dom, memory) == 0) + if (xenDaemonDomainSetMaxMemory(dom, memory) == 0) return 0; } @@ -979,14 +979,14 @@ xenUnifiedDomainSetMaxMemory (virDomainPtr dom, unsigned long memory) if (i != XEN_UNIFIED_XEND_OFFSET && priv->opened[i] && drivers[i]->xenDomainSetMaxMemory && - drivers[i]->xenDomainSetMaxMemory (dom, memory) == 0) + drivers[i]->xenDomainSetMaxMemory(dom, memory) == 0) return 0; return -1; } static int -xenUnifiedDomainSetMemory (virDomainPtr dom, unsigned long memory) +xenUnifiedDomainSetMemory(virDomainPtr dom, unsigned long memory) { GET_PRIVATE(dom->conn); int i; @@ -994,14 +994,14 @@ xenUnifiedDomainSetMemory (virDomainPtr dom, unsigned long memory) for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) if (priv->opened[i] && drivers[i]->xenDomainSetMemory && - drivers[i]->xenDomainSetMemory (dom, memory) == 0) + drivers[i]->xenDomainSetMemory(dom, memory) == 0) return 0; return -1; } static int -xenUnifiedDomainGetInfo (virDomainPtr dom, virDomainInfoPtr info) +xenUnifiedDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info) { GET_PRIVATE(dom->conn); int i; @@ -1009,7 +1009,7 @@ xenUnifiedDomainGetInfo (virDomainPtr dom, virDomainInfoPtr info) for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) if (priv->opened[i] && drivers[i]->xenDomainGetInfo && - drivers[i]->xenDomainGetInfo (dom, info) == 0) + drivers[i]->xenDomainGetInfo(dom, info) == 0) return 0; return -1; @@ -1099,13 +1099,13 @@ xenUnifiedDomainRestoreFlags(virConnectPtr conn, const char *from, } static int -xenUnifiedDomainRestore (virConnectPtr conn, const char *from) +xenUnifiedDomainRestore(virConnectPtr conn, const char *from) { return xenUnifiedDomainRestoreFlags(conn, from, NULL, 0); } static int -xenUnifiedDomainCoreDump (virDomainPtr dom, const char *to, unsigned int flags) +xenUnifiedDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags) { GET_PRIVATE(dom->conn); @@ -1115,8 +1115,8 @@ xenUnifiedDomainCoreDump (virDomainPtr dom, const char *to, unsigned int flags) } static int -xenUnifiedDomainSetVcpusFlags (virDomainPtr dom, unsigned int nvcpus, - unsigned int flags) +xenUnifiedDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus, + unsigned int flags) { GET_PRIVATE(dom->conn); int ret; @@ -1161,7 +1161,7 @@ xenUnifiedDomainSetVcpusFlags (virDomainPtr dom, unsigned int nvcpus, } static int -xenUnifiedDomainSetVcpus (virDomainPtr dom, unsigned int nvcpus) +xenUnifiedDomainSetVcpus(virDomainPtr dom, unsigned int nvcpus) { unsigned int flags = VIR_DOMAIN_VCPU_LIVE; xenUnifiedPrivatePtr priv; @@ -1178,8 +1178,8 @@ xenUnifiedDomainSetVcpus (virDomainPtr dom, unsigned int nvcpus) } static int -xenUnifiedDomainPinVcpu (virDomainPtr dom, unsigned int vcpu, - unsigned char *cpumap, int maplen) +xenUnifiedDomainPinVcpu(virDomainPtr dom, unsigned int vcpu, + unsigned char *cpumap, int maplen) { GET_PRIVATE(dom->conn); int i; @@ -1187,23 +1187,23 @@ xenUnifiedDomainPinVcpu (virDomainPtr dom, unsigned int vcpu, for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) if (priv->opened[i] && drivers[i]->xenDomainPinVcpu && - drivers[i]->xenDomainPinVcpu (dom, vcpu, cpumap, maplen) == 0) + drivers[i]->xenDomainPinVcpu(dom, vcpu, cpumap, maplen) == 0) return 0; return -1; } static int -xenUnifiedDomainGetVcpus (virDomainPtr dom, - virVcpuInfoPtr info, int maxinfo, - unsigned char *cpumaps, int maplen) +xenUnifiedDomainGetVcpus(virDomainPtr dom, + virVcpuInfoPtr info, int maxinfo, + unsigned char *cpumaps, int maplen) { GET_PRIVATE(dom->conn); int i, ret; for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) if (priv->opened[i] && drivers[i]->xenDomainGetVcpus) { - ret = drivers[i]->xenDomainGetVcpus (dom, info, maxinfo, cpumaps, maplen); + ret = drivers[i]->xenDomainGetVcpus(dom, info, maxinfo, cpumaps, maplen); if (ret > 0) return ret; } @@ -1211,7 +1211,7 @@ xenUnifiedDomainGetVcpus (virDomainPtr dom, } static int -xenUnifiedDomainGetVcpusFlags (virDomainPtr dom, unsigned int flags) +xenUnifiedDomainGetVcpusFlags(virDomainPtr dom, unsigned int flags) { GET_PRIVATE(dom->conn); int ret; @@ -1238,7 +1238,7 @@ xenUnifiedDomainGetVcpusFlags (virDomainPtr dom, unsigned int flags) } static int -xenUnifiedDomainGetMaxVcpus (virDomainPtr dom) +xenUnifiedDomainGetMaxVcpus(virDomainPtr dom) { return xenUnifiedDomainGetVcpusFlags(dom, (VIR_DOMAIN_VCPU_LIVE | VIR_DOMAIN_VCPU_MAXIMUM)); @@ -1373,56 +1373,56 @@ cleanup: static int -xenUnifiedDomainMigratePrepare (virConnectPtr dconn, - char **cookie, - int *cookielen, - const char *uri_in, - char **uri_out, - unsigned long flags, - const char *dname, - unsigned long resource) +xenUnifiedDomainMigratePrepare(virConnectPtr dconn, + char **cookie, + int *cookielen, + const char *uri_in, + char **uri_out, + unsigned long flags, + const char *dname, + unsigned long resource) { GET_PRIVATE(dconn); virCheckFlags(XEN_MIGRATION_FLAGS, -1); if (priv->opened[XEN_UNIFIED_XEND_OFFSET]) - return xenDaemonDomainMigratePrepare (dconn, cookie, cookielen, - uri_in, uri_out, - flags, dname, resource); + return xenDaemonDomainMigratePrepare(dconn, cookie, cookielen, + uri_in, uri_out, + flags, dname, resource); virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__); return -1; } static int -xenUnifiedDomainMigratePerform (virDomainPtr dom, - const char *cookie, - int cookielen, - const char *uri, - unsigned long flags, - const char *dname, - unsigned long resource) +xenUnifiedDomainMigratePerform(virDomainPtr dom, + const char *cookie, + int cookielen, + const char *uri, + unsigned long flags, + const char *dname, + unsigned long resource) { GET_PRIVATE(dom->conn); virCheckFlags(XEN_MIGRATION_FLAGS, -1); if (priv->opened[XEN_UNIFIED_XEND_OFFSET]) - return xenDaemonDomainMigratePerform (dom, cookie, cookielen, uri, - flags, dname, resource); + return xenDaemonDomainMigratePerform(dom, cookie, cookielen, uri, + flags, dname, resource); virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__); return -1; } static virDomainPtr -xenUnifiedDomainMigrateFinish (virConnectPtr dconn, - const char *dname, - const char *cookie ATTRIBUTE_UNUSED, - int cookielen ATTRIBUTE_UNUSED, - const char *uri ATTRIBUTE_UNUSED, - unsigned long flags) +xenUnifiedDomainMigrateFinish(virConnectPtr dconn, + const char *dname, + const char *cookie ATTRIBUTE_UNUSED, + int cookielen ATTRIBUTE_UNUSED, + const char *uri ATTRIBUTE_UNUSED, + unsigned long flags) { virDomainPtr dom = NULL; char *domain_xml = NULL; @@ -1430,7 +1430,7 @@ xenUnifiedDomainMigrateFinish (virConnectPtr dconn, virCheckFlags(XEN_MIGRATION_FLAGS, NULL); - dom = xenUnifiedDomainLookupByName (dconn, dname); + dom = xenUnifiedDomainLookupByName(dconn, dname); if (! dom) { return NULL; } @@ -1443,7 +1443,7 @@ xenUnifiedDomainMigrateFinish (virConnectPtr dconn, goto failure; } - dom_new = xenDaemonDomainDefineXML (dconn, domain_xml); + dom_new = xenDaemonDomainDefineXML(dconn, domain_xml); if (! dom_new) { virReportError(VIR_ERR_MIGRATE_PERSIST_FAILED, "%s", _("failed to define domain on destination host")); @@ -1451,25 +1451,25 @@ xenUnifiedDomainMigrateFinish (virConnectPtr dconn, } /* Free additional reference added by Define */ - virDomainFree (dom_new); + virDomainFree(dom_new); } - VIR_FREE (domain_xml); + VIR_FREE(domain_xml); return dom; failure: - virDomainFree (dom); + virDomainFree(dom); - VIR_FREE (domain_xml); + VIR_FREE(domain_xml); return NULL; } static int -xenUnifiedListDefinedDomains (virConnectPtr conn, char **const names, - int maxnames) +xenUnifiedListDefinedDomains(virConnectPtr conn, char **const names, + int maxnames) { GET_PRIVATE(conn); int i; @@ -1477,7 +1477,7 @@ xenUnifiedListDefinedDomains (virConnectPtr conn, char **const names, for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) if (priv->opened[i] && drivers[i]->xenListDefinedDomains) { - ret = drivers[i]->xenListDefinedDomains (conn, names, maxnames); + ret = drivers[i]->xenListDefinedDomains(conn, names, maxnames); if (ret >= 0) return ret; } @@ -1485,7 +1485,7 @@ xenUnifiedListDefinedDomains (virConnectPtr conn, char **const names, } static int -xenUnifiedNumOfDefinedDomains (virConnectPtr conn) +xenUnifiedNumOfDefinedDomains(virConnectPtr conn) { GET_PRIVATE(conn); int i; @@ -1493,7 +1493,7 @@ xenUnifiedNumOfDefinedDomains (virConnectPtr conn) for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) if (priv->opened[i] && drivers[i]->xenNumOfDefinedDomains) { - ret = drivers[i]->xenNumOfDefinedDomains (conn); + ret = drivers[i]->xenNumOfDefinedDomains(conn); if (ret >= 0) return ret; } @@ -1501,7 +1501,7 @@ xenUnifiedNumOfDefinedDomains (virConnectPtr conn) } static int -xenUnifiedDomainCreateWithFlags (virDomainPtr dom, unsigned int flags) +xenUnifiedDomainCreateWithFlags(virDomainPtr dom, unsigned int flags) { GET_PRIVATE(dom->conn); int i; @@ -1510,20 +1510,20 @@ xenUnifiedDomainCreateWithFlags (virDomainPtr dom, unsigned int flags) for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) if (priv->opened[i] && drivers[i]->xenDomainCreate && - drivers[i]->xenDomainCreate (dom) == 0) + drivers[i]->xenDomainCreate(dom) == 0) return 0; return -1; } static int -xenUnifiedDomainCreate (virDomainPtr dom) +xenUnifiedDomainCreate(virDomainPtr dom) { return xenUnifiedDomainCreateWithFlags(dom, 0); } static virDomainPtr -xenUnifiedDomainDefineXML (virConnectPtr conn, const char *xml) +xenUnifiedDomainDefineXML(virConnectPtr conn, const char *xml) { GET_PRIVATE(conn); int i; @@ -1531,7 +1531,7 @@ xenUnifiedDomainDefineXML (virConnectPtr conn, const char *xml) for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) if (priv->opened[i] && drivers[i]->xenDomainDefineXML) { - ret = drivers[i]->xenDomainDefineXML (conn, xml); + ret = drivers[i]->xenDomainDefineXML(conn, xml); if (ret) return ret; } @@ -1539,7 +1539,7 @@ xenUnifiedDomainDefineXML (virConnectPtr conn, const char *xml) } static int -xenUnifiedDomainUndefineFlags (virDomainPtr dom, unsigned int flags) +xenUnifiedDomainUndefineFlags(virDomainPtr dom, unsigned int flags) { GET_PRIVATE(dom->conn); int i; @@ -1547,19 +1547,19 @@ xenUnifiedDomainUndefineFlags (virDomainPtr dom, unsigned int flags) virCheckFlags(0, -1); for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) if (priv->opened[i] && drivers[i]->xenDomainUndefine && - drivers[i]->xenDomainUndefine (dom) == 0) + drivers[i]->xenDomainUndefine(dom) == 0) return 0; return -1; } static int -xenUnifiedDomainUndefine (virDomainPtr dom) { +xenUnifiedDomainUndefine(virDomainPtr dom) { return xenUnifiedDomainUndefineFlags(dom, 0); } static int -xenUnifiedDomainAttachDevice (virDomainPtr dom, const char *xml) +xenUnifiedDomainAttachDevice(virDomainPtr dom, const char *xml) { GET_PRIVATE(dom->conn); int i; @@ -1583,8 +1583,8 @@ xenUnifiedDomainAttachDevice (virDomainPtr dom, const char *xml) } static int -xenUnifiedDomainAttachDeviceFlags (virDomainPtr dom, const char *xml, - unsigned int flags) +xenUnifiedDomainAttachDeviceFlags(virDomainPtr dom, const char *xml, + unsigned int flags) { GET_PRIVATE(dom->conn); int i; @@ -1598,7 +1598,7 @@ xenUnifiedDomainAttachDeviceFlags (virDomainPtr dom, const char *xml, } static int -xenUnifiedDomainDetachDevice (virDomainPtr dom, const char *xml) +xenUnifiedDomainDetachDevice(virDomainPtr dom, const char *xml) { GET_PRIVATE(dom->conn); int i; @@ -1622,8 +1622,8 @@ xenUnifiedDomainDetachDevice (virDomainPtr dom, const char *xml) } static int -xenUnifiedDomainDetachDeviceFlags (virDomainPtr dom, const char *xml, - unsigned int flags) +xenUnifiedDomainDetachDeviceFlags(virDomainPtr dom, const char *xml, + unsigned int flags) { GET_PRIVATE(dom->conn); int i; @@ -1637,8 +1637,8 @@ xenUnifiedDomainDetachDeviceFlags (virDomainPtr dom, const char *xml, } static int -xenUnifiedDomainUpdateDeviceFlags (virDomainPtr dom, const char *xml, - unsigned int flags) +xenUnifiedDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml, + unsigned int flags) { GET_PRIVATE(dom->conn); @@ -1648,7 +1648,7 @@ xenUnifiedDomainUpdateDeviceFlags (virDomainPtr dom, const char *xml, } static int -xenUnifiedDomainGetAutostart (virDomainPtr dom, int *autostart) +xenUnifiedDomainGetAutostart(virDomainPtr dom, int *autostart) { GET_PRIVATE(dom->conn); @@ -1665,7 +1665,7 @@ xenUnifiedDomainGetAutostart (virDomainPtr dom, int *autostart) } static int -xenUnifiedDomainSetAutostart (virDomainPtr dom, int autostart) +xenUnifiedDomainSetAutostart(virDomainPtr dom, int autostart) { GET_PRIVATE(dom->conn); @@ -1682,7 +1682,7 @@ xenUnifiedDomainSetAutostart (virDomainPtr dom, int autostart) } static char * -xenUnifiedDomainGetSchedulerType (virDomainPtr dom, int *nparams) +xenUnifiedDomainGetSchedulerType(virDomainPtr dom, int *nparams) { GET_PRIVATE(dom->conn); int i; @@ -1690,7 +1690,7 @@ xenUnifiedDomainGetSchedulerType (virDomainPtr dom, int *nparams) for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; i++) { if (priv->opened[i] && drivers[i]->xenDomainGetSchedulerType) { - schedulertype = drivers[i]->xenDomainGetSchedulerType (dom, nparams); + schedulertype = drivers[i]->xenDomainGetSchedulerType(dom, nparams); if (schedulertype != NULL) return schedulertype; } @@ -1761,49 +1761,49 @@ xenUnifiedDomainSetSchedulerParameters(virDomainPtr dom, } static int -xenUnifiedDomainBlockStats (virDomainPtr dom, const char *path, - struct _virDomainBlockStats *stats) +xenUnifiedDomainBlockStats(virDomainPtr dom, const char *path, + struct _virDomainBlockStats *stats) { - GET_PRIVATE (dom->conn); + GET_PRIVATE(dom->conn); if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET]) - return xenHypervisorDomainBlockStats (dom, path, stats); + return xenHypervisorDomainBlockStats(dom, path, stats); virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__); return -1; } static int -xenUnifiedDomainInterfaceStats (virDomainPtr dom, const char *path, - struct _virDomainInterfaceStats *stats) +xenUnifiedDomainInterfaceStats(virDomainPtr dom, const char *path, + struct _virDomainInterfaceStats *stats) { - GET_PRIVATE (dom->conn); + GET_PRIVATE(dom->conn); if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET]) - return xenHypervisorDomainInterfaceStats (dom, path, stats); + return xenHypervisorDomainInterfaceStats(dom, path, stats); virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__); return -1; } static int -xenUnifiedDomainBlockPeek (virDomainPtr dom, const char *path, - unsigned long long offset, size_t size, - void *buffer, unsigned int flags) +xenUnifiedDomainBlockPeek(virDomainPtr dom, const char *path, + unsigned long long offset, size_t size, + void *buffer, unsigned int flags) { int r; - GET_PRIVATE (dom->conn); + GET_PRIVATE(dom->conn); virCheckFlags(0, -1); if (priv->opened[XEN_UNIFIED_XEND_OFFSET]) { - r = xenDaemonDomainBlockPeek (dom, path, offset, size, buffer); + r = xenDaemonDomainBlockPeek(dom, path, offset, size, buffer); if (r != -2) return r; /* r == -2 means declined, so fall through to XM driver ... */ } if (priv->opened[XEN_UNIFIED_XM_OFFSET]) { - if (xenXMDomainBlockPeek (dom, path, offset, size, buffer) == 0) + if (xenXMDomainBlockPeek(dom, path, offset, size, buffer) == 0) return 0; } @@ -1812,29 +1812,29 @@ xenUnifiedDomainBlockPeek (virDomainPtr dom, const char *path, } static int -xenUnifiedNodeGetCellsFreeMemory (virConnectPtr conn, unsigned long long *freeMems, - int startCell, int maxCells) +xenUnifiedNodeGetCellsFreeMemory(virConnectPtr conn, unsigned long long *freeMems, + int startCell, int maxCells) { - GET_PRIVATE (conn); + GET_PRIVATE(conn); if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET]) - return xenHypervisorNodeGetCellsFreeMemory (conn, freeMems, - startCell, maxCells); + return xenHypervisorNodeGetCellsFreeMemory(conn, freeMems, + startCell, maxCells); virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__); return -1; } static unsigned long long -xenUnifiedNodeGetFreeMemory (virConnectPtr conn) +xenUnifiedNodeGetFreeMemory(virConnectPtr conn) { unsigned long long freeMem = 0; int ret; - GET_PRIVATE (conn); + GET_PRIVATE(conn); if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET]) { - ret = xenHypervisorNodeGetCellsFreeMemory (conn, &freeMem, - -1, 1); + ret = xenHypervisorNodeGetCellsFreeMemory(conn, &freeMem, + -1, 1); if (ret != 1) return 0; return freeMem; @@ -1851,7 +1851,7 @@ xenUnifiedDomainEventRegister(virConnectPtr conn, void *opaque, virFreeCallback freefunc) { - GET_PRIVATE (conn); + GET_PRIVATE(conn); int ret; xenUnifiedLock(priv); @@ -1875,7 +1875,7 @@ xenUnifiedDomainEventDeregister(virConnectPtr conn, virConnectDomainEventCallback callback) { int ret; - GET_PRIVATE (conn); + GET_PRIVATE(conn); xenUnifiedLock(priv); if (priv->xsWatch == -1) { @@ -1901,7 +1901,7 @@ xenUnifiedDomainEventRegisterAny(virConnectPtr conn, void *opaque, virFreeCallback freefunc) { - GET_PRIVATE (conn); + GET_PRIVATE(conn); int ret; xenUnifiedLock(priv); @@ -1926,7 +1926,7 @@ xenUnifiedDomainEventDeregisterAny(virConnectPtr conn, int callbackID) { int ret; - GET_PRIVATE (conn); + GET_PRIVATE(conn); xenUnifiedLock(priv); if (priv->xsWatch == -1) { @@ -1945,11 +1945,11 @@ xenUnifiedDomainEventDeregisterAny(virConnectPtr conn, static int -xenUnifiedNodeDeviceGetPciInfo (virNodeDevicePtr dev, - unsigned *domain, - unsigned *bus, - unsigned *slot, - unsigned *function) +xenUnifiedNodeDeviceGetPciInfo(virNodeDevicePtr dev, + unsigned *domain, + unsigned *bus, + unsigned *slot, + unsigned *function) { virNodeDeviceDefPtr def = NULL; virNodeDevCapsDefPtr cap; @@ -1991,7 +1991,7 @@ out: } static int -xenUnifiedNodeDeviceDettach (virNodeDevicePtr dev) +xenUnifiedNodeDeviceDettach(virNodeDevicePtr dev) { pciDevice *pci; unsigned domain, bus, slot, function; @@ -2014,7 +2014,7 @@ out: } static int -xenUnifiedNodeDeviceAssignedDomainId (virNodeDevicePtr dev) +xenUnifiedNodeDeviceAssignedDomainId(virNodeDevicePtr dev) { int numdomains; int ret = -1, i; @@ -2072,7 +2072,7 @@ out: } static int -xenUnifiedNodeDeviceReAttach (virNodeDevicePtr dev) +xenUnifiedNodeDeviceReAttach(virNodeDevicePtr dev) { pciDevice *pci; unsigned domain, bus, slot, function; @@ -2104,7 +2104,7 @@ out: } static int -xenUnifiedNodeDeviceReset (virNodeDevicePtr dev) +xenUnifiedNodeDeviceReset(virNodeDevicePtr dev) { pciDevice *pci; unsigned domain, bus, slot, function; @@ -2284,13 +2284,13 @@ static virDriver xenUnifiedDriver = { * Returns the driver priority or -1 in case of error. */ int -xenRegister (void) +xenRegister(void) { #ifdef WITH_LIBVIRTD - if (virRegisterStateDriver (&state_driver) == -1) return -1; + if (virRegisterStateDriver(&state_driver) == -1) return -1; #endif - return virRegisterDriver (&xenUnifiedDriver); + return virRegisterDriver(&xenUnifiedDriver); } /** @@ -2413,7 +2413,7 @@ xenUnifiedRemoveDomainInfo(xenUnifiedDomainInfoListPtr list, * The caller must hold the lock in 'priv' before invoking * */ -void xenUnifiedDomainEventDispatch (xenUnifiedPrivatePtr priv, +void xenUnifiedDomainEventDispatch(xenUnifiedPrivatePtr priv, virDomainEventPtr event) { if (!priv) diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c index 3244bbd..17bd7f1 100644 --- a/src/xen/xen_hypervisor.c +++ b/src/xen/xen_hypervisor.c @@ -1463,9 +1463,9 @@ xenHypervisorSetSchedulerParameters(virDomainPtr domain, int -xenHypervisorDomainBlockStats (virDomainPtr dom, - const char *path, - struct _virDomainBlockStats *stats) +xenHypervisorDomainBlockStats(virDomainPtr dom, + const char *path, + struct _virDomainBlockStats *stats) { #ifdef __linux__ xenUnifiedPrivatePtr priv; @@ -1474,7 +1474,7 @@ xenHypervisorDomainBlockStats (virDomainPtr dom, priv = (xenUnifiedPrivatePtr) dom->conn->privateData; xenUnifiedLock(priv); /* Need to lock because it hits the xenstore handle :-( */ - ret = xenLinuxDomainBlockStats (priv, dom, path, stats); + ret = xenLinuxDomainBlockStats(priv, dom, path, stats); xenUnifiedUnlock(priv); return ret; #else @@ -1492,9 +1492,9 @@ xenHypervisorDomainBlockStats (virDomainPtr dom, * virNetwork interface, as yet not decided. */ int -xenHypervisorDomainInterfaceStats (virDomainPtr dom, - const char *path, - struct _virDomainInterfaceStats *stats) +xenHypervisorDomainInterfaceStats(virDomainPtr dom, + const char *path, + struct _virDomainInterfaceStats *stats) { #ifdef __linux__ int rqdomid, device; @@ -1983,30 +1983,30 @@ xenHypervisorInit(struct xenHypervisorVersions *override_versions) * Note that errors here are really internal errors since these * regexps should never fail to compile. */ - errcode = regcomp (&flags_hvm_rec, flags_hvm_re, REG_EXTENDED); + errcode = regcomp(&flags_hvm_rec, flags_hvm_re, REG_EXTENDED); if (errcode != 0) { char error[100]; - regerror (errcode, &flags_hvm_rec, error, sizeof(error)); - regfree (&flags_hvm_rec); + regerror(errcode, &flags_hvm_rec, error, sizeof(error)); + regfree(&flags_hvm_rec); virReportError(VIR_ERR_INTERNAL_ERROR, "%s", error); return -1; } - errcode = regcomp (&flags_pae_rec, flags_pae_re, REG_EXTENDED); + errcode = regcomp(&flags_pae_rec, flags_pae_re, REG_EXTENDED); if (errcode != 0) { char error[100]; - regerror (errcode, &flags_pae_rec, error, sizeof(error)); - regfree (&flags_pae_rec); - regfree (&flags_hvm_rec); + regerror(errcode, &flags_pae_rec, error, sizeof(error)); + regfree(&flags_pae_rec); + regfree(&flags_hvm_rec); virReportError(VIR_ERR_INTERNAL_ERROR, "%s", error); return -1; } - errcode = regcomp (&xen_cap_rec, xen_cap_re, REG_EXTENDED); + errcode = regcomp(&xen_cap_rec, xen_cap_re, REG_EXTENDED); if (errcode != 0) { char error[100]; - regerror (errcode, &xen_cap_rec, error, sizeof(error)); - regfree (&xen_cap_rec); - regfree (&flags_pae_rec); - regfree (&flags_hvm_rec); + regerror(errcode, &xen_cap_rec, error, sizeof(error)); + regfree(&xen_cap_rec); + regfree(&flags_pae_rec); + regfree(&flags_hvm_rec); virReportError(VIR_ERR_INTERNAL_ERROR, "%s", error); return -1; } @@ -2512,7 +2512,7 @@ xenHypervisorMakeCapabilitiesSunOS(virConnectPtr conn) return NULL; /* Really, this never fails - look at the man-page. */ - uname (&utsname); + uname(&utsname); guest_arches[i].model = "i686"; guest_arches[i].bits = 32; @@ -2594,15 +2594,15 @@ xenHypervisorMakeCapabilitiesInternal(virConnectPtr conn, * architectures and non-Linux. (XXX) */ if (cpuinfo) { - while (fgets (line, sizeof(line), cpuinfo)) { - if (regexec (&flags_hvm_rec, line, sizeof(subs)/sizeof(regmatch_t), subs, 0) == 0 + while (fgets(line, sizeof(line), cpuinfo)) { + if (regexec(&flags_hvm_rec, line, sizeof(subs)/sizeof(regmatch_t), subs, 0) == 0 && subs[0].rm_so != -1) { if (virStrncpy(hvm_type, &line[subs[1].rm_so], subs[1].rm_eo-subs[1].rm_so, sizeof(hvm_type)) == NULL) goto no_memory; - } else if (regexec (&flags_pae_rec, line, 0, NULL, 0) == 0) + } else if (regexec(&flags_pae_rec, line, 0, NULL, 0) == 0) host_pae = 1; } } @@ -2632,17 +2632,17 @@ xenHypervisorMakeCapabilitiesInternal(virConnectPtr conn, */ /* Expecting one line in this file - ignore any more. */ - if ((capabilities) && (fgets (line, sizeof(line), capabilities))) { + if ((capabilities) && (fgets(line, sizeof(line), capabilities))) { /* Split the line into tokens. strtok_r is OK here because we "own" * this buffer. Parse out the features from each token. */ for (str = line, nr_guest_archs = 0; nr_guest_archs < sizeof(guest_archs) / sizeof(guest_archs[0]) - && (token = strtok_r (str, " ", &saveptr)) != NULL; + && (token = strtok_r(str, " ", &saveptr)) != NULL; str = NULL) { - if (regexec (&xen_cap_rec, token, sizeof(subs) / sizeof(subs[0]), - subs, 0) == 0) { + if (regexec(&xen_cap_rec, token, sizeof(subs) / sizeof(subs[0]), + subs, 0) == 0) { int hvm = STRPREFIX(&token[subs[1].rm_so], "hvm"); const char *model; int bits, pae = 0, nonpae = 0, ia64_be = 0; @@ -2740,9 +2740,9 @@ xenHypervisorMakeCapabilities(virConnectPtr conn) struct utsname utsname; /* Really, this never fails - look at the man-page. */ - uname (&utsname); + uname(&utsname); - cpuinfo = fopen ("/proc/cpuinfo", "r"); + cpuinfo = fopen("/proc/cpuinfo", "r"); if (cpuinfo == NULL) { if (errno != ENOENT) { virReportSystemError(errno, @@ -2752,7 +2752,7 @@ xenHypervisorMakeCapabilities(virConnectPtr conn) } } - capabilities = fopen ("/sys/hypervisor/properties/capabilities", "r"); + capabilities = fopen("/sys/hypervisor/properties/capabilities", "r"); if (capabilities == NULL) { if (errno != ENOENT) { VIR_FORCE_FCLOSE(cpuinfo); @@ -2790,7 +2790,7 @@ cleanup: * Return the capabilities of this hypervisor. */ char * -xenHypervisorGetCapabilities (virConnectPtr conn) +xenHypervisorGetCapabilities(virConnectPtr conn) { xenUnifiedPrivatePtr priv = (xenUnifiedPrivatePtr) conn->privateData; char *xml; @@ -2920,7 +2920,7 @@ xenHypervisorListDomains(virConnectPtr conn, int *ids, int maxids) char * -xenHypervisorDomainGetOSType (virDomainPtr dom) +xenHypervisorDomainGetOSType(virDomainPtr dom) { xenUnifiedPrivatePtr priv; xen_getdomaininfo dominfo; @@ -3161,7 +3161,7 @@ xenHypervisorGetDomMaxMemory(virConnectPtr conn, int id) * * Returns the memory size in kilobytes or 0 in case of error. */ -static unsigned long long ATTRIBUTE_NONNULL (1) +static unsigned long long ATTRIBUTE_NONNULL(1) xenHypervisorGetMaxMemory(virDomainPtr domain) { xenUnifiedPrivatePtr priv; @@ -3717,7 +3717,7 @@ int xenHavePrivilege(void) { #ifdef __sun - return priv_ineffect (PRIV_XVM_CONTROL); + return priv_ineffect(PRIV_XVM_CONTROL); #else return access(XEN_HYPERVISOR_SOCKET, R_OK) == 0; #endif diff --git a/src/xen/xen_inotify.c b/src/xen/xen_inotify.c index 10b7834..e3a260c 100644 --- a/src/xen/xen_inotify.c +++ b/src/xen/xen_inotify.c @@ -414,7 +414,7 @@ xenInotifyOpen(virConnectPtr conn, VIR_DEBUG("Building initial config cache"); if (priv->useXenConfigCache && - xenXMConfigCacheRefresh (conn) < 0) { + xenXMConfigCacheRefresh(conn) < 0) { VIR_DEBUG("Failed to enable XM config cache %s", conn->err.message); return -1; } diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c index 95152f8..8435841 100644 --- a/src/xen/xend_internal.c +++ b/src/xen/xend_internal.c @@ -268,7 +268,7 @@ istartswith(const char *haystack, const char *needle) * Returns the HTTP return code and @content is set to the * allocated memory containing HTTP content. */ -static int ATTRIBUTE_NONNULL (2) +static int ATTRIBUTE_NONNULL(2) xend_req(int fd, char **content) { char *buffer; @@ -682,13 +682,13 @@ xenDaemonOpen_tcp(virConnectPtr conn, const char *host, const char *port) for (r = res; r; r = r->ai_next) { int sock; - sock = socket (r->ai_family, SOCK_STREAM, r->ai_protocol); + sock = socket(r->ai_family, SOCK_STREAM, r->ai_protocol); if (sock == -1) { saved_errno = errno; continue; } - if (connect (sock, r->ai_addr, r->ai_addrlen) == -1) { + if (connect(sock, r->ai_addr, r->ai_addrlen) == -1) { saved_errno = errno; VIR_FORCE_CLOSE(sock); continue; @@ -704,7 +704,7 @@ xenDaemonOpen_tcp(virConnectPtr conn, const char *host, const char *port) break; } - freeaddrinfo (res); + freeaddrinfo(res); if (!priv->addrlen) { /* Don't raise error when unprivileged, since proxy takes over */ @@ -1288,7 +1288,7 @@ xenDaemonOpen(virConnectPtr conn, xend_detect_config_version(conn) == -1) goto failed; } - else if (STRCASEEQ (conn->uri->scheme, "xen")) { + else if (STRCASEEQ(conn->uri->scheme, "xen")) { /* * try first to open the unix socket */ @@ -1302,7 +1302,7 @@ xenDaemonOpen(virConnectPtr conn, if (xenDaemonOpen_tcp(conn, "localhost", "8000") < 0 || xend_detect_config_version(conn) == -1) goto failed; - } else if (STRCASEEQ (conn->uri->scheme, "http")) { + } else if (STRCASEEQ(conn->uri->scheme, "http")) { if (conn->uri->port && virAsprintf(&port, "%d", conn->uri->port) == -1) { virReportOOMError(); @@ -3130,14 +3130,14 @@ xenDaemonDomainSetAutostart(virDomainPtr domain, } int -xenDaemonDomainMigratePrepare (virConnectPtr dconn, - char **cookie ATTRIBUTE_UNUSED, - int *cookielen ATTRIBUTE_UNUSED, - const char *uri_in, - char **uri_out, - unsigned long flags, - const char *dname ATTRIBUTE_UNUSED, - unsigned long resource ATTRIBUTE_UNUSED) +xenDaemonDomainMigratePrepare(virConnectPtr dconn, + char **cookie ATTRIBUTE_UNUSED, + int *cookielen ATTRIBUTE_UNUSED, + const char *uri_in, + char **uri_out, + unsigned long flags, + const char *dname ATTRIBUTE_UNUSED, + unsigned long resource ATTRIBUTE_UNUSED) { virCheckFlags(XEN_MIGRATION_FLAGS, -1); @@ -3155,13 +3155,13 @@ xenDaemonDomainMigratePrepare (virConnectPtr dconn, } int -xenDaemonDomainMigratePerform (virDomainPtr domain, - const char *cookie ATTRIBUTE_UNUSED, - int cookielen ATTRIBUTE_UNUSED, - const char *uri, - unsigned long flags, - const char *dname, - unsigned long bandwidth) +xenDaemonDomainMigratePerform(virDomainPtr domain, + const char *cookie ATTRIBUTE_UNUSED, + int cookielen ATTRIBUTE_UNUSED, + const char *uri, + unsigned long flags, + const char *dname, + unsigned long bandwidth) { /* Upper layers have already checked domain. */ /* NB: Passing port=0 to xend means it ignores @@ -3199,7 +3199,7 @@ xenDaemonDomainMigratePerform (virDomainPtr domain, * Check the flags. */ if ((flags & VIR_MIGRATE_LIVE)) { - strcpy (live, "1"); + strcpy(live, "1"); flags &= ~VIR_MIGRATE_LIVE; } @@ -3235,36 +3235,36 @@ xenDaemonDomainMigratePerform (virDomainPtr domain, * URI is non-NULL (guaranteed by caller). We expect either * "hostname", "hostname:port" or "xenmigr://hostname[:port]/". */ - if (strstr (uri, "//")) { /* Full URI. */ + if (strstr(uri, "//")) { /* Full URI. */ virURIPtr uriptr; - if (!(uriptr = virURIParse (uri))) + if (!(uriptr = virURIParse(uri))) return -1; - if (uriptr->scheme && STRCASENEQ (uriptr->scheme, "xenmigr")) { + if (uriptr->scheme && STRCASENEQ(uriptr->scheme, "xenmigr")) { virReportError(VIR_ERR_INVALID_ARG, "%s", _("xenDaemonDomainMigrate: only xenmigr://" " migrations are supported by Xen")); - virURIFree (uriptr); + virURIFree(uriptr); return -1; } if (!uriptr->server) { virReportError(VIR_ERR_INVALID_ARG, "%s", _("xenDaemonDomainMigrate: a hostname must be" " specified in the URI")); - virURIFree (uriptr); + virURIFree(uriptr); return -1; } - hostname = strdup (uriptr->server); + hostname = strdup(uriptr->server); if (!hostname) { virReportOOMError(); - virURIFree (uriptr); + virURIFree(uriptr); return -1; } if (uriptr->port) - snprintf (port, sizeof(port), "%d", uriptr->port); - virURIFree (uriptr); + snprintf(port, sizeof(port), "%d", uriptr->port); + virURIFree(uriptr); } - else if ((p = strrchr (uri, ':')) != NULL) { /* "hostname:port" */ + else if ((p = strrchr(uri, ':')) != NULL) { /* "hostname:port" */ int port_nr, n; if (virStrToLong_i(p+1, NULL, 10, &port_nr) < 0) { @@ -3272,11 +3272,11 @@ xenDaemonDomainMigratePerform (virDomainPtr domain, "%s", _("xenDaemonDomainMigrate: invalid port number")); return -1; } - snprintf (port, sizeof(port), "%d", port_nr); + snprintf(port, sizeof(port), "%d", port_nr); /* Get the hostname. */ n = p - uri; /* n = Length of hostname in bytes. */ - hostname = strdup (uri); + hostname = strdup(uri); if (!hostname) { virReportOOMError(); return -1; @@ -3284,7 +3284,7 @@ xenDaemonDomainMigratePerform (virDomainPtr domain, hostname[n] = '\0'; } else { /* "hostname" (or IP address) */ - hostname = strdup (uri); + hostname = strdup(uri); if (!hostname) { virReportOOMError(); return -1; @@ -3299,20 +3299,20 @@ xenDaemonDomainMigratePerform (virDomainPtr domain, * to our advantage since all parameters supported and required * by current xend can be included without breaking older xend. */ - ret = xend_op (domain->conn, domain->name, - "op", "migrate", - "destination", hostname, - "live", live, - "port", port, - "node", "-1", /* xen-unstable c/s 17753 */ - "ssl", "0", /* xen-unstable c/s 17709 */ - "change_home_server", "0", /* xen-unstable c/s 20326 */ - "resource", "0", /* removed by xen-unstable c/s 17553 */ - NULL); - VIR_FREE (hostname); + ret = xend_op(domain->conn, domain->name, + "op", "migrate", + "destination", hostname, + "live", live, + "port", port, + "node", "-1", /* xen-unstable c/s 17753 */ + "ssl", "0", /* xen-unstable c/s 17709 */ + "change_home_server", "0", /* xen-unstable c/s 20326 */ + "resource", "0", /* removed by xen-unstable c/s 17553 */ + NULL); + VIR_FREE(hostname); if (ret == 0 && undefined_source) - xenDaemonDomainUndefine (domain); + xenDaemonDomainUndefine(domain); VIR_DEBUG("migration done"); @@ -3540,7 +3540,7 @@ xenDaemonGetSchedulerType(virDomainPtr domain, int *nparams) "%s", _("node information incomplete, missing scheduler name")); goto error; } - if (STREQ (ret, "credit")) { + if (STREQ(ret, "credit")) { schedulertype = strdup("credit"); if (schedulertype == NULL){ virReportOOMError(); @@ -3548,7 +3548,7 @@ xenDaemonGetSchedulerType(virDomainPtr domain, int *nparams) } if (nparams) *nparams = XEN_SCHED_CRED_NPARAM; - } else if (STREQ (ret, "sedf")) { + } else if (STREQ(ret, "sedf")) { schedulertype = strdup("sedf"); if (schedulertype == NULL){ virReportOOMError(); @@ -3738,10 +3738,10 @@ xenDaemonSetSchedulerParameters(virDomainPtr domain, memset(&buf_weight, 0, VIR_UUID_BUFLEN); memset(&buf_cap, 0, VIR_UUID_BUFLEN); for (i = 0; i < nparams; i++) { - if (STREQ (params[i].field, VIR_DOMAIN_SCHEDULER_WEIGHT) && + if (STREQ(params[i].field, VIR_DOMAIN_SCHEDULER_WEIGHT) && params[i].type == VIR_TYPED_PARAM_UINT) { snprintf(buf_weight, sizeof(buf_weight), "%u", params[i].value.ui); - } else if (STREQ (params[i].field, VIR_DOMAIN_SCHEDULER_CAP) && + } else if (STREQ(params[i].field, VIR_DOMAIN_SCHEDULER_CAP) && params[i].type == VIR_TYPED_PARAM_UINT) { snprintf(buf_cap, sizeof(buf_cap), "%u", params[i].value.ui); } else { @@ -3797,9 +3797,9 @@ error: * Returns 0 if successful, -1 if error, -2 if declined. */ int -xenDaemonDomainBlockPeek (virDomainPtr domain, const char *path, - unsigned long long offset, size_t size, - void *buffer) +xenDaemonDomainBlockPeek(virDomainPtr domain, const char *path, + unsigned long long offset, size_t size, + void *buffer) { xenUnifiedPrivatePtr priv; struct sexpr *root = NULL; @@ -3817,11 +3817,11 @@ xenDaemonDomainBlockPeek (virDomainPtr domain, const char *path, /* Security check: The path must correspond to a block device. */ if (domain->id > 0) - root = sexpr_get (domain->conn, "/xend/domain/%d?detail=1", - domain->id); + root = sexpr_get(domain->conn, "/xend/domain/%d?detail=1", + domain->id); else if (domain->id < 0) - root = sexpr_get (domain->conn, "/xend/domain/%s?detail=1", - domain->name); + root = sexpr_get(domain->conn, "/xend/domain/%s?detail=1", + domain->name); else { /* This call always fails for dom0. */ virReportError(VIR_ERR_OPERATION_INVALID, @@ -3852,7 +3852,7 @@ xenDaemonDomainBlockPeek (virDomainPtr domain, const char *path, path = actual; /* The path is correct, now try to open it and get its size. */ - fd = open (path, O_RDONLY); + fd = open(path, O_RDONLY); if (fd == -1) { virReportSystemError(errno, _("failed to open for reading: %s"), @@ -3864,8 +3864,8 @@ xenDaemonDomainBlockPeek (virDomainPtr domain, const char *path, /* NB. Because we configure with AC_SYS_LARGEFILE, off_t should * be 64 bits on all platforms. */ - if (lseek (fd, offset, SEEK_SET) == (off_t) -1 || - saferead (fd, buffer, size) == (ssize_t) -1) { + if (lseek(fd, offset, SEEK_SET) == (off_t) -1 || + saferead(fd, buffer, size) == (ssize_t) -1) { virReportSystemError(errno, _("failed to lseek or read from file: %s"), path); diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c index 7b3d340..9da2974 100644 --- a/src/xen/xm_internal.c +++ b/src/xen/xm_internal.c @@ -309,7 +309,7 @@ xenXMConfigCacheAddFile(virConnectPtr conn, const char *filename) * Caller must hold the lock on 'conn->privateData' before * calling this function */ -int xenXMConfigCacheRefresh (virConnectPtr conn) { +int xenXMConfigCacheRefresh(virConnectPtr conn) { xenUnifiedPrivatePtr priv = conn->privateData; DIR *dh; struct dirent *ent; @@ -411,9 +411,9 @@ int xenXMConfigCacheRefresh (virConnectPtr conn) { * every few seconds */ virDrvOpenStatus -xenXMOpen (virConnectPtr conn, - virConnectAuthPtr auth ATTRIBUTE_UNUSED, - unsigned int flags) +xenXMOpen(virConnectPtr conn, + virConnectAuthPtr auth ATTRIBUTE_UNUSED, + unsigned int flags) { xenUnifiedPrivatePtr priv = conn->privateData; @@ -893,7 +893,7 @@ virDomainPtr xenXMDomainLookupByName(virConnectPtr conn, const char *domname) { priv = conn->privateData; xenUnifiedLock(priv); - if (!xenInotifyActive(conn) && xenXMConfigCacheRefresh (conn) < 0) + if (!xenInotifyActive(conn) && xenXMConfigCacheRefresh(conn) < 0) goto cleanup; if (!(filename = virHashLookup(priv->nameConfigMap, domname))) @@ -949,7 +949,7 @@ virDomainPtr xenXMDomainLookupByUUID(virConnectPtr conn, priv = conn->privateData; xenUnifiedLock(priv); - if (!xenInotifyActive(conn) && xenXMConfigCacheRefresh (conn) < 0) + if (!xenInotifyActive(conn) && xenXMConfigCacheRefresh(conn) < 0) goto cleanup; if (!(entry = virHashSearch(priv->configCache, xenXMDomainSearchForUUID, (const void *)uuid))) @@ -1049,7 +1049,7 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char *xml) xenUnifiedLock(priv); - if (!xenInotifyActive(conn) && xenXMConfigCacheRefresh (conn) < 0) { + if (!xenInotifyActive(conn) && xenXMConfigCacheRefresh(conn) < 0) { xenUnifiedUnlock(priv); return NULL; } @@ -1261,7 +1261,7 @@ int xenXMListDefinedDomains(virConnectPtr conn, char **const names, int maxnames priv = conn->privateData; xenUnifiedLock(priv); - if (!xenInotifyActive(conn) && xenXMConfigCacheRefresh (conn) < 0) + if (!xenInotifyActive(conn) && xenXMConfigCacheRefresh(conn) < 0) goto cleanup; if (maxnames > virHashSize(priv->configCache)) @@ -1306,7 +1306,7 @@ int xenXMNumOfDefinedDomains(virConnectPtr conn) { priv = conn->privateData; xenUnifiedLock(priv); - if (!xenInotifyActive(conn) && xenXMConfigCacheRefresh (conn) < 0) + if (!xenInotifyActive(conn) && xenXMConfigCacheRefresh(conn) < 0) goto cleanup; ret = virHashSize(priv->nameConfigMap); @@ -1527,11 +1527,11 @@ xenXMDomainDetachDeviceFlags(virDomainPtr domain, const char *xml, } int -xenXMDomainBlockPeek (virDomainPtr dom ATTRIBUTE_UNUSED, - const char *path ATTRIBUTE_UNUSED, - unsigned long long offset ATTRIBUTE_UNUSED, - size_t size ATTRIBUTE_UNUSED, - void *buffer ATTRIBUTE_UNUSED) +xenXMDomainBlockPeek(virDomainPtr dom ATTRIBUTE_UNUSED, + const char *path ATTRIBUTE_UNUSED, + unsigned long long offset ATTRIBUTE_UNUSED, + size_t size ATTRIBUTE_UNUSED, + void *buffer ATTRIBUTE_UNUSED) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("block peeking not implemented")); diff --git a/src/xen/xs_internal.c b/src/xen/xs_internal.c index a91d409..167f2b8 100644 --- a/src/xen/xs_internal.c +++ b/src/xen/xs_internal.c @@ -95,7 +95,7 @@ virConnectDoStoreList(virConnectPtr conn, const char *path, if (priv->xshandle == NULL || path == NULL || nb == NULL) return NULL; - return xs_directory (priv->xshandle, 0, path, nb); + return xs_directory(priv->xshandle, 0, path, nb); } /** @@ -571,7 +571,7 @@ xenStoreNumOfDomains(virConnectPtr conn) realnum++; } out: - VIR_FREE (idlist); + VIR_FREE(idlist); ret = realnum; } return ret; @@ -599,7 +599,7 @@ xenStoreDoListDomains(virConnectPtr conn, xenUnifiedPrivatePtr priv, int *ids, i if (priv->xshandle == NULL) goto out; - idlist = xs_directory (priv->xshandle, 0, "/local/domain", &num); + idlist = xs_directory(priv->xshandle, 0, "/local/domain", &num); if (idlist == NULL) goto out; @@ -615,7 +615,7 @@ xenStoreDoListDomains(virConnectPtr conn, xenUnifiedPrivatePtr priv, int *ids, i } out: - VIR_FREE (idlist); + VIR_FREE(idlist); return ret; } @@ -696,7 +696,7 @@ xenStoreLookupByName(virConnectPtr conn, const char *name) prop[199] = 0; tmp = xs_read(priv->xshandle, 0, prop, &len); if (tmp != NULL) { - found = STREQ (name, tmp); + found = STREQ(name, tmp); VIR_FREE(tmp); if (found) break; @@ -985,19 +985,19 @@ xenStoreDomainGetDiskID(virConnectPtr conn, int id, const char *dev) { if (val == NULL) break; if ((devlen != len) || memcmp(val, dev, len)) { - VIR_FREE (val); + VIR_FREE(val); } else { ret = strdup(list[i]); if (ret == NULL) virReportOOMError(); - VIR_FREE (val); - VIR_FREE (list); + VIR_FREE(val); + VIR_FREE(list); return ret; } } - VIR_FREE (list); + VIR_FREE(list); } snprintf(dir, sizeof(dir), "/local/domain/0/backend/tap/%d", id); list = xs_directory(priv->xshandle, 0, dir, &num); @@ -1008,19 +1008,19 @@ xenStoreDomainGetDiskID(virConnectPtr conn, int id, const char *dev) { if (val == NULL) break; if ((devlen != len) || memcmp(val, dev, len)) { - VIR_FREE (val); + VIR_FREE(val); } else { ret = strdup(list[i]); if (ret == NULL) virReportOOMError(); - VIR_FREE (val); - VIR_FREE (list); + VIR_FREE(val); + VIR_FREE(list); return ret; } } - VIR_FREE (list); + VIR_FREE(list); } return NULL; } diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c index d60ad23..2d9ff70 100644 --- a/src/xenapi/xenapi_driver.c +++ b/src/xenapi/xenapi_driver.c @@ -59,7 +59,7 @@ static int xenapiDefaultConsoleType(const char *ostype) * Return virCapsPtr on success or NULL on failure */ static virCapsPtr -getCapsObject (void) +getCapsObject(void) { virCapsGuestPtr guest1, guest2; virCapsGuestDomainPtr domain1, domain2; @@ -98,8 +98,8 @@ getCapsObject (void) * Return VIR_DRV_OPEN_SUCCESS on success, else VIR_DRV_OPEN_ERROR */ static virDrvOpenStatus -xenapiOpen (virConnectPtr conn, virConnectAuthPtr auth, - unsigned int flags) +xenapiOpen(virConnectPtr conn, virConnectAuthPtr auth, + unsigned int flags) { char *username = NULL; char *password = NULL; @@ -225,7 +225,7 @@ xenapiOpen (virConnectPtr conn, virConnectAuthPtr auth, * */ static int -xenapiClose (virConnectPtr conn) +xenapiClose(virConnectPtr conn) { struct _xenapiPrivate *priv = conn->privateData; @@ -251,7 +251,7 @@ xenapiClose (virConnectPtr conn) * Returns 0 */ static int -xenapiSupportsFeature (virConnectPtr conn ATTRIBUTE_UNUSED, int feature) +xenapiSupportsFeature(virConnectPtr conn ATTRIBUTE_UNUSED, int feature) { switch (feature) { case VIR_DRV_FEATURE_MIGRATION_V2: @@ -268,7 +268,7 @@ xenapiSupportsFeature (virConnectPtr conn ATTRIBUTE_UNUSED, int feature) * Returns name of the driver */ static const char * -xenapiType (virConnectPtr conn ATTRIBUTE_UNUSED) +xenapiType(virConnectPtr conn ATTRIBUTE_UNUSED) { return "XenAPI"; } @@ -281,7 +281,7 @@ xenapiType (virConnectPtr conn ATTRIBUTE_UNUSED) * */ static int -xenapiGetVersion (virConnectPtr conn, unsigned long *hvVer) +xenapiGetVersion(virConnectPtr conn, unsigned long *hvVer) { xen_host host; xen_session *session = ((struct _xenapiPrivate *)(conn->privateData))->session; @@ -333,7 +333,7 @@ xenapiGetVersion (virConnectPtr conn, unsigned long *hvVer) * Returns the hostname on success, or NULL on failure */ static char * -xenapiGetHostname (virConnectPtr conn) +xenapiGetHostname(virConnectPtr conn) { char *result = NULL; xen_host host; @@ -356,7 +356,7 @@ xenapiGetHostname (virConnectPtr conn) * Returns a hardcoded value for Maximum VCPUS */ static int -xenapiGetMaxVcpus (virConnectPtr conn ATTRIBUTE_UNUSED, const char *type ATTRIBUTE_UNUSED) +xenapiGetMaxVcpus(virConnectPtr conn ATTRIBUTE_UNUSED, const char *type ATTRIBUTE_UNUSED) { /* this is hardcoded for simplicity and set to a resonable value compared to the actual value */ @@ -371,7 +371,7 @@ xenapiGetMaxVcpus (virConnectPtr conn ATTRIBUTE_UNUSED, const char *type ATTRIBU * Returns Node details on success or else -1 */ static int -xenapiNodeGetInfo (virConnectPtr conn, virNodeInfoPtr info) +xenapiNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info) { int64_t memory, mhz; xen_host_cpu_set *host_cpu_set; @@ -422,7 +422,7 @@ xenapiNodeGetInfo (virConnectPtr conn, virNodeInfoPtr info) * Returns capabilities as an XML string */ static char * -xenapiGetCapabilities (virConnectPtr conn) +xenapiGetCapabilities(virConnectPtr conn) { virCapsPtr caps = ((struct _xenapiPrivate *)(conn->privateData))->caps; if (caps) { @@ -444,7 +444,7 @@ xenapiGetCapabilities (virConnectPtr conn) * Returns the number of domain found or -1 in case of error */ static int -xenapiListDomains (virConnectPtr conn, int *ids, int maxids) +xenapiListDomains(virConnectPtr conn, int *ids, int maxids) { /* vm.list */ xen_host host; @@ -481,7 +481,7 @@ xenapiListDomains (virConnectPtr conn, int *ids, int maxids) * Returns the number of domains found or -1 in case of error */ static int -xenapiNumOfDomains (virConnectPtr conn) +xenapiNumOfDomains(virConnectPtr conn) { /* #(vm.list) */ xen_vm_set *result = NULL; @@ -510,9 +510,9 @@ xenapiNumOfDomains (virConnectPtr conn) * Returns the domain pointer or NULL in case of error */ static virDomainPtr -xenapiDomainCreateXML (virConnectPtr conn, - const char *xmlDesc, - unsigned int flags) +xenapiDomainCreateXML(virConnectPtr conn, + const char *xmlDesc, + unsigned int flags) { xen_vm_record *record = NULL; xen_vm vm = NULL; @@ -562,7 +562,7 @@ xenapiDomainCreateXML (virConnectPtr conn, * or NULL in case of error */ static virDomainPtr -xenapiDomainLookupByID (virConnectPtr conn, int id) +xenapiDomainLookupByID(virConnectPtr conn, int id) { int i; int64_t domID; @@ -617,8 +617,8 @@ xenapiDomainLookupByID (virConnectPtr conn, int id) * or -1 in case of error */ static virDomainPtr -xenapiDomainLookupByUUID (virConnectPtr conn, - const unsigned char *uuid) +xenapiDomainLookupByUUID(virConnectPtr conn, + const unsigned char *uuid) { /* vm.get_by_uuid */ xen_vm vm; @@ -655,8 +655,8 @@ xenapiDomainLookupByUUID (virConnectPtr conn, * or -1 in case of error */ static virDomainPtr -xenapiDomainLookupByName (virConnectPtr conn, - const char *name) +xenapiDomainLookupByName(virConnectPtr conn, + const char *name) { /* vm.get_by_name_label */ xen_vm_set *vms = NULL; @@ -706,7 +706,7 @@ xenapiDomainLookupByName (virConnectPtr conn, * Returns 0 on success or -1 in case of error */ static int -xenapiDomainSuspend (virDomainPtr dom) +xenapiDomainSuspend(virDomainPtr dom) { /* vm.pause() */ xen_vm vm; @@ -741,7 +741,7 @@ xenapiDomainSuspend (virDomainPtr dom) * Returns 0 on success or -1 in case of error */ static int -xenapiDomainResume (virDomainPtr dom) +xenapiDomainResume(virDomainPtr dom) { /* vm.unpause() */ xen_vm vm; @@ -820,7 +820,7 @@ xenapiDomainShutdown(virDomainPtr dom) * Returns 0 on success or -1 in case of error */ static int -xenapiDomainReboot (virDomainPtr dom, unsigned int flags) +xenapiDomainReboot(virDomainPtr dom, unsigned int flags) { /* vm.clean_reboot */ xen_vm vm; @@ -912,7 +912,7 @@ xenapiDomainDestroy(virDomainPtr dom) * Returns OS version on success or NULL in case of error */ static char * -xenapiDomainGetOSType (virDomainPtr dom) +xenapiDomainGetOSType(virDomainPtr dom) { xen_vm vm=NULL; xen_vm_set *vms; @@ -949,7 +949,7 @@ xenapiDomainGetOSType (virDomainPtr dom) * or 0 in case of error */ static unsigned long long -xenapiDomainGetMaxMemory (virDomainPtr dom) +xenapiDomainGetMaxMemory(virDomainPtr dom) { int64_t mem_static_max = 0; xen_vm vm; @@ -980,7 +980,7 @@ xenapiDomainGetMaxMemory (virDomainPtr dom) * Returns 0 on success or -1 in case of error */ static int -xenapiDomainSetMaxMemory (virDomainPtr dom, unsigned long memory) +xenapiDomainSetMaxMemory(virDomainPtr dom, unsigned long memory) { /* vm.set_memory_static_max */ xen_vm vm; @@ -1015,7 +1015,7 @@ xenapiDomainSetMaxMemory (virDomainPtr dom, unsigned long memory) * Returns 0 on success or -1 in case of error */ static int -xenapiDomainGetInfo (virDomainPtr dom, virDomainInfoPtr info) +xenapiDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info) { int64_t maxmem = 0, memory = 0, vcpu = 0; xen_vm vm; @@ -1108,8 +1108,8 @@ cleanup: * Return 0 on success or -1 in case of error */ static int -xenapiDomainSetVcpusFlags (virDomainPtr dom, unsigned int nvcpus, - unsigned int flags) +xenapiDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus, + unsigned int flags) { /* vm.set_vcpus_max */ xen_vm vm; @@ -1147,7 +1147,7 @@ xenapiDomainSetVcpusFlags (virDomainPtr dom, unsigned int nvcpus, * Return 0 on success or -1 in case of error */ static int -xenapiDomainSetVcpus (virDomainPtr dom, unsigned int nvcpus) +xenapiDomainSetVcpus(virDomainPtr dom, unsigned int nvcpus) { return xenapiDomainSetVcpusFlags(dom, nvcpus, VIR_DOMAIN_VCPU_LIVE); } @@ -1159,8 +1159,8 @@ xenapiDomainSetVcpus (virDomainPtr dom, unsigned int nvcpus) * Returns 0 on success or -1 in case of error */ static int -xenapiDomainPinVcpu (virDomainPtr dom, unsigned int vcpu ATTRIBUTE_UNUSED, - unsigned char *cpumap, int maplen) +xenapiDomainPinVcpu(virDomainPtr dom, unsigned int vcpu ATTRIBUTE_UNUSED, + unsigned char *cpumap, int maplen) { char *value = NULL; xen_vm vm; @@ -1200,9 +1200,9 @@ xenapiDomainPinVcpu (virDomainPtr dom, unsigned int vcpu ATTRIBUTE_UNUSED, * Return number of structures filled on success or -1 in case of error */ static int -xenapiDomainGetVcpus (virDomainPtr dom, - virVcpuInfoPtr info, int maxinfo, - unsigned char *cpumaps, int maplen) +xenapiDomainGetVcpus(virDomainPtr dom, + virVcpuInfoPtr info, int maxinfo, + unsigned char *cpumaps, int maplen) { xen_vm_set *vms = NULL; @@ -1278,7 +1278,7 @@ xenapiDomainGetVcpus (virDomainPtr dom, * Returns Vcpus count on success or -1 in case of error */ static int -xenapiDomainGetVcpusFlags (virDomainPtr dom, unsigned int flags) +xenapiDomainGetVcpusFlags(virDomainPtr dom, unsigned int flags) { xen_vm vm; xen_vm_set *vms; @@ -1321,7 +1321,7 @@ xenapiDomainGetVcpusFlags (virDomainPtr dom, unsigned int flags) * Returns maximum number of Vcpus on success or -1 in case of error */ static int -xenapiDomainGetMaxVcpus (virDomainPtr dom) +xenapiDomainGetMaxVcpus(virDomainPtr dom) { return xenapiDomainGetVcpusFlags(dom, (VIR_DOMAIN_VCPU_LIVE | VIR_DOMAIN_VCPU_MAXIMUM)); @@ -1535,8 +1535,8 @@ xenapiDomainGetXMLDesc(virDomainPtr dom, unsigned int flags) * Returns number of names provided in the array or -1 in case of error */ static int -xenapiListDefinedDomains (virConnectPtr conn, char **const names, - int maxnames) +xenapiListDefinedDomains(virConnectPtr conn, char **const names, + int maxnames) { int i,j=0,doms; xen_vm_set *result; @@ -1582,7 +1582,7 @@ xenapiListDefinedDomains (virConnectPtr conn, char **const names, * Returns number of domains found on success or -1 in case of error */ static int -xenapiNumOfDefinedDomains (virConnectPtr conn) +xenapiNumOfDefinedDomains(virConnectPtr conn) { xen_vm_set *result; xen_vm_record *record; @@ -1615,7 +1615,7 @@ xenapiNumOfDefinedDomains (virConnectPtr conn) * Return 0 on success or -1 in case of error */ static int -xenapiDomainCreateWithFlags (virDomainPtr dom, unsigned int flags) +xenapiDomainCreateWithFlags(virDomainPtr dom, unsigned int flags) { xen_vm_set *vms; xen_vm vm; @@ -1657,7 +1657,7 @@ xenapiDomainCreateWithFlags (virDomainPtr dom, unsigned int flags) * Return 0 on success or -1 in case of error */ static int -xenapiDomainCreate (virDomainPtr dom) +xenapiDomainCreate(virDomainPtr dom) { return xenapiDomainCreateWithFlags(dom, 0); } @@ -1669,7 +1669,7 @@ xenapiDomainCreate (virDomainPtr dom) * Returns 0 on success or -1 in case of error */ static virDomainPtr -xenapiDomainDefineXML (virConnectPtr conn, const char *xml) +xenapiDomainDefineXML(virConnectPtr conn, const char *xml) { xen_vm_record *record=NULL; xen_vm vm=NULL; @@ -1755,7 +1755,7 @@ xenapiDomainUndefine(virDomainPtr dom) * Return 0 on success or -1 in case of error */ static int -xenapiDomainGetAutostart (virDomainPtr dom, int *autostart) +xenapiDomainGetAutostart(virDomainPtr dom, int *autostart) { int i,flag=0; xen_vm_set *vms; @@ -1802,7 +1802,7 @@ xenapiDomainGetAutostart (virDomainPtr dom, int *autostart) * Return 0 on success or -1 in case of error */ static int -xenapiDomainSetAutostart (virDomainPtr dom, int autostart) +xenapiDomainSetAutostart(virDomainPtr dom, int autostart) { xen_vm_set *vms; xen_vm vm; @@ -1835,7 +1835,7 @@ xenapiDomainSetAutostart (virDomainPtr dom, int autostart) } static char * -xenapiDomainGetSchedulerType (virDomainPtr dom ATTRIBUTE_UNUSED, int *nparams) +xenapiDomainGetSchedulerType(virDomainPtr dom ATTRIBUTE_UNUSED, int *nparams) { char *result = NULL; @@ -1853,7 +1853,7 @@ xenapiDomainGetSchedulerType (virDomainPtr dom ATTRIBUTE_UNUSED, int *nparams) * Returns memory size on success or 0 in case of error */ static unsigned long long -xenapiNodeGetFreeMemory (virConnectPtr conn) +xenapiNodeGetFreeMemory(virConnectPtr conn) { xen_host_metrics_set *xen_met_set; unsigned long long freeMem = 0; @@ -1886,8 +1886,8 @@ xenapiDomainIsUpdated(virDomainPtr dom ATTRIBUTE_UNUSED) * Returns the number of entries filled in freeMems, or -1 in case of error. */ static int -xenapiNodeGetCellsFreeMemory (virConnectPtr conn, unsigned long long *freeMems, - int startCell, int maxCells) +xenapiNodeGetCellsFreeMemory(virConnectPtr conn, unsigned long long *freeMems, + int startCell, int maxCells) { if (maxCells > 1 && startCell > 0) { xenapiSessionErrorHandler(conn, VIR_ERR_NO_SUPPORT, NULL); @@ -1970,9 +1970,9 @@ static virDriver xenapiDriver = { * Returns the driver priority or -1 in case of error. */ int -xenapiRegister (void) +xenapiRegister(void) { - return virRegisterDriver (&xenapiDriver); + return virRegisterDriver(&xenapiDriver); } /* diff --git a/src/xenapi/xenapi_utils.c b/src/xenapi/xenapi_utils.c index fd881f3..6edf756 100644 --- a/src/xenapi/xenapi_utils.c +++ b/src/xenapi/xenapi_utils.c @@ -306,7 +306,7 @@ getCpuBitMapfromString(char *mask, unsigned char *cpumap, int maplen) if (virStrToLong_i(num, NULL, 10, &pos) < 0) return; if (pos < 0 || pos > max_bits - 1) - VIR_WARN ("number in str %d exceeds cpumap's max bits %d", pos, max_bits); + VIR_WARN("number in str %d exceeds cpumap's max bits %d", pos, max_bits); else (cpumap)[pos / 8] |= (1 << (pos % 8)); num = strtok_r(NULL, ",", &bp); @@ -342,7 +342,7 @@ mapPowerState(enum xen_vm_power_state state) /* allocate a flexible array and fill values(key,val) */ int -allocStringMap (xen_string_string_map **strings, char *key, char *val) +allocStringMap(xen_string_string_map **strings, char *key, char *val) { int sz = ((*strings) == NULL) ? 0 : (*strings)->size; sz++; @@ -383,8 +383,8 @@ xenapiSessionErrorHandle(virConnectPtr conn, virErrorNumber errNum, /* creates network intereface for VM */ static int -createVifNetwork (virConnectPtr conn, xen_vm vm, int device, - char *bridge, char *mac) +createVifNetwork(virConnectPtr conn, xen_vm vm, int device, + char *bridge, char *mac) { xen_session *session = ((struct _xenapiPrivate *)(conn->privateData))->session; xen_vm xvm = NULL; @@ -446,8 +446,8 @@ createVifNetwork (virConnectPtr conn, xen_vm vm, int device, /* Create a VM record from the XML description */ int -createVMRecordFromXml (virConnectPtr conn, virDomainDefPtr def, - xen_vm_record **record, xen_vm *vm) +createVMRecordFromXml(virConnectPtr conn, virDomainDefPtr def, + xen_vm_record **record, xen_vm *vm) { char uuidStr[VIR_UUID_STRING_BUFLEN]; xen_string_string_map *strings = NULL; diff --git a/src/xenxs/xen_sxpr.c b/src/xenxs/xen_sxpr.c index 6ac7dff..4a7a0c7 100644 --- a/src/xenxs/xen_sxpr.c +++ b/src/xenxs/xen_sxpr.c @@ -425,8 +425,8 @@ xenParseSxprDisks(virDomainDefPtr def, src = offset + 1; - if (STREQ (disk->driverName, "tap") || - STREQ (disk->driverName, "tap2")) { + if (STREQ(disk->driverName, "tap") || + STREQ(disk->driverName, "tap2")) { offset = strchr(src, ':'); if (!offset) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -463,7 +463,7 @@ xenParseSxprDisks(virDomainDefPtr def, disk->type = VIR_DOMAIN_DISK_TYPE_FILE; } - if (STREQLEN (dst, "ioemu:", 6)) + if (STREQLEN(dst, "ioemu:", 6)) dst += 6; disk->device = VIR_DOMAIN_DISK_DEVICE_DISK; @@ -471,9 +471,9 @@ xenParseSxprDisks(virDomainDefPtr def, if (xendConfigVersion >= XEND_CONFIG_VERSION_3_0_3) { offset = strrchr(dst, ':'); if (offset) { - if (STREQ (offset, ":cdrom")) { + if (STREQ(offset, ":cdrom")) { disk->device = VIR_DOMAIN_DISK_DEVICE_CDROM; - } else if (STREQ (offset, ":disk")) { + } else if (STREQ(offset, ":disk")) { /* The default anyway */ } else { /* Unknown, lets pretend its a disk too */ diff --git a/tests/commandtest.c b/tests/commandtest.c index cba6cb6..19bf9ba 100644 --- a/tests/commandtest.c +++ b/tests/commandtest.c @@ -625,12 +625,12 @@ static int test16(const void *unused ATTRIBUTE_UNUSED) } if ((fd = open(abs_builddir "/commandhelper.log", O_CREAT | O_TRUNC | O_WRONLY, 0600)) < 0) { - printf("Cannot open log file: %s\n", strerror (errno)); + printf("Cannot open log file: %s\n", strerror(errno)); goto cleanup; } virCommandWriteArgLog(cmd, fd); if (VIR_CLOSE(fd) < 0) { - printf("Cannot close log file: %s\n", strerror (errno)); + printf("Cannot close log file: %s\n", strerror(errno)); goto cleanup; } diff --git a/tests/conftest.c b/tests/conftest.c index 6514f4d..4342a52 100644 --- a/tests/conftest.c +++ b/tests/conftest.c @@ -36,7 +36,7 @@ int main(int argc, char **argv) } virConfFree(conf); if (fwrite(buffer, 1, len, stdout) != len) { - fprintf(stderr, "Write failed: %s\n", strerror (errno)); + fprintf(stderr, "Write failed: %s\n", strerror(errno)); goto cleanup; } diff --git a/tests/seclabeltest.c b/tests/seclabeltest.c index 81ef323..7033293 100644 --- a/tests/seclabeltest.c +++ b/tests/seclabeltest.c @@ -9,7 +9,7 @@ #include "virrandom.h" int -main (int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) +main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { virSecurityManagerPtr mgr; const char *doi, *model; @@ -19,23 +19,23 @@ main (int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) mgr = virSecurityManagerNew(NULL, "QEMU", false, true, false); if (mgr == NULL) { - fprintf (stderr, "Failed to start security driver"); + fprintf(stderr, "Failed to start security driver"); exit(EXIT_FAILURE); } model = virSecurityManagerGetModel(mgr); if (!model) { - fprintf (stderr, "Failed to copy secModel model: %s", - strerror (errno)); + fprintf(stderr, "Failed to copy secModel model: %s", + strerror(errno)); exit(EXIT_FAILURE); } doi = virSecurityManagerGetDOI(mgr); if (!doi) { - fprintf (stderr, "Failed to copy secModel DOI: %s", - strerror (errno)); + fprintf(stderr, "Failed to copy secModel DOI: %s", + strerror(errno)); exit(EXIT_FAILURE); } diff --git a/tests/testutils.c b/tests/testutils.c index 2a9102b..0177423 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -216,12 +216,12 @@ virtTestLoadFile(const char *file, char **buf) int len, tmplen, buflen; if (!fp) { - fprintf (stderr, "%s: failed to open: %s\n", file, strerror(errno)); + fprintf(stderr, "%s: failed to open: %s\n", file, strerror(errno)); return -1; } if (fstat(fileno(fp), &st) < 0) { - fprintf (stderr, "%s: failed to fstat: %s\n", file, strerror(errno)); + fprintf(stderr, "%s: failed to fstat: %s\n", file, strerror(errno)); VIR_FORCE_FCLOSE(fp); return -1; } @@ -229,7 +229,7 @@ virtTestLoadFile(const char *file, char **buf) tmplen = buflen = st.st_size + 1; if (VIR_ALLOC_N(*buf, buflen) < 0) { - fprintf (stderr, "%s: larger than available memory (> %d)\n", file, buflen); + fprintf(stderr, "%s: larger than available memory (> %d)\n", file, buflen); VIR_FORCE_FCLOSE(fp); return -1; } @@ -253,7 +253,7 @@ virtTestLoadFile(const char *file, char **buf) tmplen -= len; } if (ferror(fp)) { - fprintf (stderr, "%s: read failed: %s\n", file, strerror(errno)); + fprintf(stderr, "%s: read failed: %s\n", file, strerror(errno)); VIR_FORCE_FCLOSE(fp); VIR_FREE(*buf); return -1; @@ -282,7 +282,7 @@ void virtTestCaptureProgramExecChild(const char *const argv[], if ((stdinfd = open("/dev/null", O_RDONLY)) < 0) goto cleanup; - open_max = sysconf (_SC_OPEN_MAX); + open_max = sysconf(_SC_OPEN_MAX); for (i = 0; i < open_max; i++) { if (i != stdinfd && i != pipefd) { diff --git a/tests/testutilsxen.c b/tests/testutilsxen.c index 7d5a872..b5f20cb 100644 --- a/tests/testutilsxen.c +++ b/tests/testutilsxen.c @@ -27,7 +27,7 @@ virCapsPtr testXenCapsInit(void) { "xenpv" }; - uname (&utsname); + uname(&utsname); if ((caps = virCapabilitiesNew(utsname.machine, 0, 0)) == NULL) return NULL; diff --git a/tests/viratomictest.c b/tests/viratomictest.c index d813dbc..88f387b 100644 --- a/tests/viratomictest.c +++ b/tests/viratomictest.c @@ -36,7 +36,7 @@ testTypes(const void *data ATTRIBUTE_UNUSED) bool res; #define virAssertCmpInt(a, op, b) \ - if (!((a) op (b))) \ + if (!(a op b)) \ return -1; virAtomicIntSet(&u, 5); u2 = virAtomicIntGet(&u); diff --git a/tests/virhashtest.c b/tests/virhashtest.c index be82281..721e877 100644 --- a/tests/virhashtest.c +++ b/tests/virhashtest.c @@ -501,14 +501,14 @@ static int testHashGetItemsCompKey(const virHashKeyValuePairPtr a, const virHashKeyValuePairPtr b) { - return strcmp (a->key, b->key); + return strcmp(a->key, b->key); } static int testHashGetItemsCompValue(const virHashKeyValuePairPtr a, const virHashKeyValuePairPtr b) { - return strcmp (a->value, b->value); + return strcmp(a->value, b->value); } static int diff --git a/tools/console.c b/tools/console.c index 8b377dd..40de8eb 100644 --- a/tools/console.c +++ b/tools/console.c @@ -83,7 +83,7 @@ static void do_signal(int sig ATTRIBUTE_UNUSED) { # ifndef HAVE_CFMAKERAW static void -cfmakeraw (struct termios *attr) +cfmakeraw(struct termios *attr) { attr->c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON); diff --git a/tools/virsh-edit.c b/tools/virsh-edit.c index 61008a9..9d612a3 100644 --- a/tools/virsh-edit.c +++ b/tools/virsh-edit.c @@ -147,7 +147,7 @@ edit_cleanup: VIR_FREE(doc_edited); VIR_FREE(doc_reread); if (tmp) { - unlink (tmp); + unlink(tmp); VIR_FREE(tmp); } diff --git a/tools/virsh-host.c b/tools/virsh-host.c index 106f5e9..1bb8f02 100644 --- a/tools/virsh-host.c +++ b/tools/virsh-host.c @@ -777,7 +777,7 @@ cmdHostname(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) return false; } - vshPrint (ctl, "%s\n", hostname); + vshPrint(ctl, "%s\n", hostname); VIR_FREE(hostname); return true; diff --git a/tools/virsh-interface.c b/tools/virsh-interface.c index c27b6bc..9ceb122 100644 --- a/tools/virsh-interface.c +++ b/tools/virsh-interface.c @@ -774,7 +774,7 @@ cmdInterfaceBridge(vshControl *ctl, const vshCmd *cmd) /* Set stp and delay attributes in <bridge> according to the * commandline options. */ - if (!xmlSetProp(br_node, BAD_CAST "stp", BAD_CAST (stp ? "on" : "off"))) { + if (!xmlSetProp(br_node, BAD_CAST "stp", BAD_CAST(stp ? "on" : "off"))) { vshError(ctl, "%s", _("Failed to set stp attribute in xml document")); goto cleanup; } diff --git a/tools/virsh.c b/tools/virsh.c index f0ec625..3e5dcd8 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -559,7 +559,7 @@ vshEditWriteToTempFile(vshControl *ctl, const char *doc) int fd; char ebuf[1024]; - tmpdir = getenv ("TMPDIR"); + tmpdir = getenv("TMPDIR"); if (!tmpdir) tmpdir = "/tmp"; if (virAsprintf(&ret, "%s/virshXXXXXX.xml", tmpdir) < 0) { vshError(ctl, "%s", _("out of memory")); -- 1.7.11.2

On 10/17/2012 11:31 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
The libvirt coding standard is to use 'function(...args...)' instead of 'function (...args...)'. A non-trivial number of places did not follow this rule and are fixed in this patch.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- [...] diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c index 09f2a92..dc8d1bd 100644 --- a/src/qemu/qemu_monitor_text.c +++ b/src/qemu/qemu_monitor_text.c @@ -609,10 +609,10 @@ static int parseMemoryStat(char **text, unsigned int tag, char *dummy; unsigned long long value;
- if (STRPREFIX (*text, search)) { + if (STRPREFIX(*text, search)) { *text += strlen(search); if (virStrToLong_ull (*text, &dummy, 10, &value)) {
missed line, space still here ^
- VIR_DEBUG ("error reading %s: %s", search, *text); + VIR_DEBUG("error reading %s: %s", search, *text); return 0; }
[...]
diff --git a/tests/viratomictest.c b/tests/viratomictest.c index d813dbc..88f387b 100644 --- a/tests/viratomictest.c +++ b/tests/viratomictest.c @@ -36,7 +36,7 @@ testTypes(const void *data ATTRIBUTE_UNUSED) bool res;
#define virAssertCmpInt(a, op, b) \ - if (!((a) op (b))) \ + if (!(a op b)) \
I believe these should be kept where they are, since there can be expression used as a argument to this macro.
return -1; virAtomicIntSet(&u, 5); u2 = virAtomicIntGet(&u);
Other than those two things, the patch is ok, I'd ACK it, but please postpone the push until there are at least less people waiting for back-portable patches. Martin

From: "Daniel P. Berrange" <berrange@redhat.com> Checking for 'function (...args...)' is quite difficult since it needs to ignore valid usage with keywords like 'if (...test...)' and while/for/switch. It must also ignore source comments and quoted strings. It is not possible todo this with a simple regex in the normal syntax-check style. So a short Perl script is created instead to analyse the source. In practice this works well enough. The only thing it can't cope with is multi-line quoted strings of the form "start of string\ more lines\ more line\ the end" but this can and should be written as "start of string" "more lines" "more line" "the end" with this simple change, the bracket checking script does not have any false positives across libvirt source, provided it is only run against .c files. --- build-aux/bracket-spacing.pl | 75 ++++++++++++++++++++++++++++++++++++++++++++ cfg.mk | 7 ++++- 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100755 build-aux/bracket-spacing.pl diff --git a/build-aux/bracket-spacing.pl b/build-aux/bracket-spacing.pl new file mode 100755 index 0000000..65f500e --- /dev/null +++ b/build-aux/bracket-spacing.pl @@ -0,0 +1,75 @@ +#!/usr/bin/perl +# +# bracket-spacing.pl: Report any usage of 'function (..args..)' +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library. If not, see +# <http://www.gnu.org/licenses/>. +# +# Authors: +# Daniel P. Berrange <berrange@redhat.com> + +use strict; +use warnings; + +my $ret = 0; +my $incomment = 0; + +foreach my $file (@ARGV) { + open FILE, $file; + + while (defined (my $line = <FILE>)) { + my $data = $line; + + # Kill any quoted strongs + $data =~ s,".*?","XXX",g; + + # Kill any C++ style comments + $data =~ s,//.*$,,; + + next if $data =~ /^#/; + + # Kill C style multi-line comments + if ($incomment) { + if ($data =~ m,\*/,) { + $incomment = 0; + $data =~ s,^.*\*/,,; + } else { + $data = ""; + } + } + + if ($data =~ m,/\*.*\*/,) { + $data =~ s,/\*.*\*/,,; + } elsif ($data =~ m,/\*,) { + $incomment = 1; + $data =~ s,/\*.*,,; + } + + while ($data =~ /(\w+)\s\((?!\*)/) { + + my $kw = $1; + # Allow space after keywords only + if ($kw =~ /^(if|for|while|switch|return)$/) { + $data =~ s/($kw\s\()/XXX(/; + } else { + print "$file:$.: $line"; + $ret = 1; + last; + } + } + } + close FILE; +} + +exit $ret; diff --git a/cfg.mk b/cfg.mk index e1fbf4f..10d1d13 100644 --- a/cfg.mk +++ b/cfg.mk @@ -726,7 +726,12 @@ sc_check_author_list: test $$fail = 0 # regenerate HACKING as part of the syntax-check -syntax-check: $(top_srcdir)/HACKING +syntax-check: $(top_srcdir)/HACKING bracket-spacing-check + +bracket-spacing-check: + $(AM_V_GEN)files=`$(VC_LIST) | grep '\.c$$'`; \ + $(PERL) $(top_srcdir)/build-aux/bracket-spacing.pl $$files || \ + (echo $(ME): no whitespace allowed between function name and '(' && exit 1) # sc_po_check can fail if generated files are not built first sc_po_check: \ -- 1.7.11.2

On 10/17/2012 11:31 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
Checking for 'function (...args...)' is quite difficult since it needs to ignore valid usage with keywords like 'if (...test...)' and while/for/switch. It must also ignore source comments and quoted strings.
It is not possible todo this with a simple regex in the normal syntax-check style. So a short Perl script is created instead to analyse the source. In practice this works well enough. The only thing it can't cope with is multi-line quoted strings of the form
"start of string\ more lines\ more line\ the end"
but this can and should be written as
"start of string" "more lines" "more line" "the end"
with this simple change, the bracket checking script does not have any false positives across libvirt source, provided it
Unfortunately there's a false negative, see my comment to other patch.
is only run against .c files.
Why not .h files?
--- build-aux/bracket-spacing.pl | 75 ++++++++++++++++++++++++++++++++++++++++++++ cfg.mk | 7 ++++- 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100755 build-aux/bracket-spacing.pl
Sorry, I really don't feel competent enough to review the perl part, since the last perl line I wrote was more than 5 years ago. Martin
participants (2)
-
Daniel P. Berrange
-
Martin Kletzander