[libvirt] [PATCH] Remove duplicate empty lines and correct indentation and style

No functional change included. --- python/libvirt-override.c | 1 - src/conf/domain_conf.c | 1 - src/conf/interface_conf.c | 1 - src/conf/network_conf.c | 1 - src/conf/node_device_conf.c | 4 - src/conf/storage_conf.c | 1 - src/interface/netcf_driver.c | 16 ++---- src/libxl/libxl_driver.c | 2 +- src/lxc/lxc_driver.c | 2 +- src/node_device/node_device_driver.c | 2 - src/node_device/node_device_linux_sysfs.c | 2 - src/nwfilter/nwfilter_ebiptables_driver.c | 2 - src/openvz/openvz_driver.c | 87 ++++++++++++++--------------- src/qemu/qemu_capabilities.c | 2 +- src/qemu/qemu_command.c | 2 +- src/qemu/qemu_driver.c | 10 +-- src/qemu/qemu_process.c | 1 - src/rpc/virnetclient.c | 2 - src/rpc/virnetserverservice.c | 2 - src/uml/uml_driver.c | 2 - src/xen/xen_driver.c | 1 - src/xen/xs_internal.c | 12 ++-- src/xenxs/xen_xm.c | 1 - tests/virnetsockettest.c | 3 - 24 files changed, 60 insertions(+), 100 deletions(-) diff --git a/python/libvirt-override.c b/python/libvirt-override.c index 2b88796..64d793d 100644 --- a/python/libvirt-override.c +++ b/python/libvirt-override.c @@ -2572,7 +2572,6 @@ libvirt_virConnectDomainEventCallback(virConnectPtr conn ATTRIBUTE_UNUSED, ret = 0; } - cleanup: LIBVIRT_RELEASE_THREAD_STATE; return ret; diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 7bcdcaf..83930c1 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9806,7 +9806,6 @@ char *virDomainDefFormat(virDomainDefPtr def, if (virDomainFSDefFormat(&buf, def->fss[n], flags) < 0) goto cleanup; - for (n = 0 ; n < def->nnets ; n++) if (virDomainNetDefFormat(&buf, def->nets[n], flags) < 0) goto cleanup; diff --git a/src/conf/interface_conf.c b/src/conf/interface_conf.c index 10377e7..99c3052 100644 --- a/src/conf/interface_conf.c +++ b/src/conf/interface_conf.c @@ -1300,7 +1300,6 @@ virInterfaceObjPtr virInterfaceAssignDef(virInterfaceObjListPtr interfaces, interfaces->count++; return iface; - } void virInterfaceRemove(virInterfaceObjListPtr interfaces, diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index ae479bf..3aeec7e 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -1155,7 +1155,6 @@ int virNetworkSaveXML(const char *configDir, cleanup: VIR_FORCE_CLOSE(fd); - VIR_FREE(configFile); return ret; diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c index dde2921..1ea122e 100644 --- a/src/conf/node_device_conf.c +++ b/src/conf/node_device_conf.c @@ -746,11 +746,8 @@ virNodeDevCapScsiHostParseXML(xmlXPathContextPtr ctxt, } if (STREQ(type, "vport_ops")) { - data->scsi_host.flags |= VIR_NODE_DEV_CAP_FLAG_HBA_VPORT_OPS; - } else if (STREQ(type, "fc_host")) { - xmlNodePtr orignode2; data->scsi_host.flags |= VIR_NODE_DEV_CAP_FLAG_HBA_FC_HOST; @@ -775,7 +772,6 @@ virNodeDevCapScsiHostParseXML(xmlXPathContextPtr ctxt, } ctxt->node = orignode2; - } else { virNodeDeviceReportError(VIR_ERR_INTERNAL_ERROR, _("unknown SCSI host capability type '%s' for '%s'"), diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index f6f8be1..21d39a8 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -1203,7 +1203,6 @@ virStorageVolTargetDefFormat(virStorageVolOptionsPtr options, virBufferAsprintf(buf," <group>%d</group>\n", def->perms.gid); - if (def->perms.label) virBufferAsprintf(buf," <label>%s</label>\n", def->perms.label); diff --git a/src/interface/netcf_driver.c b/src/interface/netcf_driver.c index dd15c9d..5a549db 100644 --- a/src/interface/netcf_driver.c +++ b/src/interface/netcf_driver.c @@ -125,22 +125,19 @@ static virDrvOpenStatus interfaceOpenInterface(virConnectPtr conn, { struct interface_driver *driverState; - if (VIR_ALLOC(driverState) < 0) - { + if (VIR_ALLOC(driverState) < 0) { virReportOOMError(); goto alloc_error; } /* initialize non-0 stuff in driverState */ - if (virMutexInit(&driverState->lock) < 0) - { + if (virMutexInit(&driverState->lock) < 0) { /* what error to report? */ goto mutex_error; } /* open netcf */ - if (ncf_init(&driverState->netcf, NULL) != 0) - { + if (ncf_init(&driverState->netcf, NULL) != 0) { /* what error to report? */ goto netcf_error; } @@ -149,8 +146,7 @@ static virDrvOpenStatus interfaceOpenInterface(virConnectPtr conn, return VIR_DRV_OPEN_SUCCESS; netcf_error: - if (driverState->netcf) - { + if (driverState->netcf) { ncf_close(driverState->netcf); } virMutexDestroy (&driverState->lock); @@ -162,9 +158,7 @@ alloc_error: static int interfaceCloseInterface(virConnectPtr conn) { - - if (conn->interfacePrivateData != NULL) - { + if (conn->interfacePrivateData != NULL) { struct interface_driver *driver = conn->interfacePrivateData; /* close netcf instance */ diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index ade69d8..4926398 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -2671,7 +2671,7 @@ libxlDomainDefineXML(virConnectPtr conn, const char *xml) VIR_DOMAIN_XML_INACTIVE))) goto cleanup; - if ((dupVM = virDomainObjIsDuplicate(&driver->domains, def, 0)) < 0) + if ((dupVM = virDomainObjIsDuplicate(&driver->domains, def, 0)) < 0) goto cleanup; if (!(vm = virDomainAssignDef(driver->caps, diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index ffcfe4d..2b1585b 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -412,7 +412,7 @@ static virDomainPtr lxcDomainDefine(virConnectPtr conn, const char *xml) VIR_DOMAIN_XML_INACTIVE))) goto cleanup; - if ((dupVM = virDomainObjIsDuplicate(&driver->domains, def, 0)) < 0) + if ((dupVM = virDomainObjIsDuplicate(&driver->domains, def, 0)) < 0) goto cleanup; if ((def->nets != NULL) && !(driver->have_netns)) { diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c index 842f903..62ceee7 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -220,13 +220,11 @@ nodeDeviceLookupByWWN(virConnectPtr conn, nodeDeviceLock(driver); for (i = 0; i < devs->count; i++) { - obj = devs->objs[i]; virNodeDeviceObjLock(obj); cap = obj->def->caps; while (cap) { - if (cap->type == VIR_NODE_DEV_CAP_SCSI_HOST) { check_fc_host(&cap->data); if (cap->data.scsi_host.flags & diff --git a/src/node_device/node_device_linux_sysfs.c b/src/node_device/node_device_linux_sysfs.c index 34e4501..eab5158 100644 --- a/src/node_device/node_device_linux_sysfs.c +++ b/src/node_device/node_device_linux_sysfs.c @@ -270,13 +270,11 @@ static int get_sriov_function(const char *device_link, device_link); if (!virFileExists(device_link)) { - VIR_DEBUG("SR IOV function link '%s' does not exist", device_link); /* Not an SR IOV device, not an error, either. */ ret = SRIOV_NOT_FOUND; goto out; - } device_path = canonicalize_file_name (device_link); diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfilter_ebiptables_driver.c index c9b60da..7321c2a 100644 --- a/src/nwfilter/nwfilter_ebiptables_driver.c +++ b/src/nwfilter/nwfilter_ebiptables_driver.c @@ -922,7 +922,6 @@ iptablesHandleIpHdr(virBufferPtr buf, ipaddr); if (HAS_ENTRY_ITEM(&ipHdr->dataSrcIPTo)) { - if (printDataType(vars, ipaddr, sizeof(ipaddr), &ipHdr->dataSrcIPTo)) @@ -1584,7 +1583,6 @@ _iptablesCreateRuleInstance(int directionIn, } else final = &buf; - return ebiptablesAddRuleInst(res, virBufferContentAndReset(final), nwfilter->chainsuffix, diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index c13f346..d62b91f 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -177,18 +177,14 @@ static int openvzSetInitialConfig(virDomainDefPtr vmdef) if (vmdef->nfss == 1 && vmdef->fss[0]->type != VIR_DOMAIN_FS_TYPE_TEMPLATE && - vmdef->fss[0]->type != VIR_DOMAIN_FS_TYPE_MOUNT) - { + vmdef->fss[0]->type != VIR_DOMAIN_FS_TYPE_MOUNT) { openvzError(VIR_ERR_INTERNAL_ERROR, "%s", _("filesystem is not of type 'template' or 'mount'")); goto cleanup; } - if (vmdef->nfss == 1 && - vmdef->fss[0]->type == VIR_DOMAIN_FS_TYPE_MOUNT) - { - + vmdef->fss[0]->type == VIR_DOMAIN_FS_TYPE_MOUNT) { if (virStrToLong_i(vmdef->name, NULL, 10, &vpsid) < 0) { openvzError(VIR_ERR_INTERNAL_ERROR, "%s", _("Could not convert domain name to VEID")); @@ -206,9 +202,7 @@ static int openvzSetInitialConfig(virDomainDefPtr vmdef) _("Could not set the source dir for the filesystem")); goto cleanup; } - } - else - { + } else { if (openvzDomainDefineCmd(prog, OPENVZ_MAX_ARG, vmdef) < 0) { VIR_ERROR(_("Error creating command for container")); goto cleanup; @@ -222,9 +216,9 @@ static int openvzSetInitialConfig(virDomainDefPtr vmdef) ret = 0; cleanup: - VIR_FREE(confdir); - cmdExecFree(prog); - return ret; + VIR_FREE(confdir); + cmdExecFree(prog); + return ret; } @@ -537,42 +531,43 @@ cleanup: return ret; } -static int openvzDomainResume(virDomainPtr dom) { - struct openvz_driver *driver = dom->conn->privateData; - virDomainObjPtr vm; - const char *prog[] = {VZCTL, "--quiet", "chkpnt", PROGRAM_SENTINAL, "--resume", NULL}; - int ret = -1; - - openvzDriverLock(driver); - vm = virDomainFindByUUID(&driver->domains, dom->uuid); - openvzDriverUnlock(driver); - - if (!vm) { - openvzError(VIR_ERR_NO_DOMAIN, "%s", - _("no domain with matching uuid")); - goto cleanup; - } - - if (!virDomainObjIsActive(vm)) { - openvzError(VIR_ERR_OPERATION_INVALID, "%s", - _("Domain is not running")); - goto cleanup; - } - - if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) { - openvzSetProgramSentinal(prog, vm->def->name); - if (virRun(prog, NULL) < 0) { - goto cleanup; - } - virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, VIR_DOMAIN_RUNNING_UNPAUSED); - } - - ret = 0; +static int openvzDomainResume(virDomainPtr dom) +{ + struct openvz_driver *driver = dom->conn->privateData; + virDomainObjPtr vm; + const char *prog[] = {VZCTL, "--quiet", "chkpnt", PROGRAM_SENTINAL, "--resume", NULL}; + int ret = -1; + + openvzDriverLock(driver); + vm = virDomainFindByUUID(&driver->domains, dom->uuid); + openvzDriverUnlock(driver); + + if (!vm) { + openvzError(VIR_ERR_NO_DOMAIN, "%s", + _("no domain with matching uuid")); + goto cleanup; + } + + if (!virDomainObjIsActive(vm)) { + openvzError(VIR_ERR_OPERATION_INVALID, "%s", + _("Domain is not running")); + goto cleanup; + } + + if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) { + openvzSetProgramSentinal(prog, vm->def->name); + if (virRun(prog, NULL) < 0) { + goto cleanup; + } + virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, VIR_DOMAIN_RUNNING_UNPAUSED); + } + + ret = 0; cleanup: - if (vm) - virDomainObjUnlock(vm); - return ret; + if (vm) + virDomainObjUnlock(vm); + return ret; } static int openvzDomainShutdown(virDomainPtr dom) { diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index ad62a07..778def4 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1025,7 +1025,7 @@ qemuCapsComputeCmdFlags(const char *help, * two features. The benefits of JSON mode now outweigh * the downside. */ - if (version >= 13000) + if (version >= 13000) qemuCapsSet(flags, QEMU_CAPS_MONITOR_JSON); if (version >= 13000) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 6e4480e..b47368c 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -662,7 +662,7 @@ qemuAssignDeviceAliases(virDomainDefPtr def, virBitmapPtr qemuCaps) return 0; - no_memory: +no_memory: virReportOOMError(); return -1; } diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 52b7dfd..2301424 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -8027,8 +8027,7 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, event = virDomainEventNewFromObj(vm, VIR_DOMAIN_EVENT_STARTED, VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT); - } - else { + } else { /* qemu is a little funny with running guests and the restoration * of snapshots. If the snapshot was taken online, * then after a "loadvm" monitor command, the VM is set running @@ -8113,8 +8112,7 @@ static int qemuDomainSnapshotDiscard(struct qemud_driver *driver, } } } - } - else { + } else { priv = vm->privateData; qemuDomainObjEnterMonitorWithDriver(driver, vm); /* we continue on even in the face of error */ @@ -8135,9 +8133,9 @@ static int qemuDomainSnapshotDiscard(struct qemud_driver *driver, /* Now we set the new current_snapshot for the domain */ vm->current_snapshot = parentsnap; - } - else + } else { vm->current_snapshot = NULL; + } } if (virAsprintf(&snapFile, "%s/%s/%s.xml", driver->snapshotDir, diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index c9145cb..cdb0193 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -819,7 +819,6 @@ qemuConnectMonitor(struct qemud_driver *driver, virDomainObjPtr vm) qemuDomainObjExitMonitorWithDriver(driver, vm); error: - return ret; } diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c index 615de6c..e3217ac 100644 --- a/src/rpc/virnetclient.c +++ b/src/rpc/virnetclient.c @@ -936,7 +936,6 @@ static int virNetClientIOEventLoop(virNetClientPtr client, return 0; } - if (fds[0].revents & (POLLHUP | POLLERR)) { virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("received hangup / error event on socket")); @@ -944,7 +943,6 @@ static int virNetClientIOEventLoop(virNetClientPtr client, } } - error: client->waitDispatch = thiscall->next; VIR_DEBUG("Giving up the buck due to I/O error %p %p", thiscall, client->waitDispatch); diff --git a/src/rpc/virnetserverservice.c b/src/rpc/virnetserverservice.c index 8c250e2..dae172c 100644 --- a/src/rpc/virnetserverservice.c +++ b/src/rpc/virnetserverservice.c @@ -131,7 +131,6 @@ virNetServerServicePtr virNetServerServiceNewTCP(const char *nodename, goto error; } - return svc; no_memory: @@ -187,7 +186,6 @@ virNetServerServicePtr virNetServerServiceNewUNIX(const char *path, goto error; } - return svc; no_memory: diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index f0f053b..2fb31cb 100644 --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -1762,7 +1762,6 @@ static int umlDomainAttachUmlDisk(struct uml_driver *driver, return 0; error: - VIR_FREE(reply); VIR_FREE(cmd); @@ -1818,7 +1817,6 @@ static int umlDomainAttachDevice(virDomainPtr dom, const char *xml) } cleanup: - virDomainDeviceDefFree(dev); if (vm) virDomainObjUnlock(vm); diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c index 88febba..af83e8e 100644 --- a/src/xen/xen_driver.c +++ b/src/xen/xen_driver.c @@ -347,7 +347,6 @@ xenUnifiedOpen (virConnectPtr conn, virConnectAuthPtr auth, int flags) priv->xendConfigVersion = -1; priv->xshandle = NULL; - /* Hypervisor is only run with privilege & required to succeed */ if (xenHavePrivilege()) { VIR_DEBUG("Trying hypervisor sub-driver"); diff --git a/src/xen/xs_internal.c b/src/xen/xs_internal.c index 04bf93a..e7aaf60 100644 --- a/src/xen/xs_internal.c +++ b/src/xen/xs_internal.c @@ -1333,7 +1333,7 @@ retry: if (new_domain_cnt < 0) return -1; - if( VIR_ALLOC_N(new_domids,new_domain_cnt) < 0 ) { + if (VIR_ALLOC_N(new_domids, new_domain_cnt) < 0) { virReportOOMError(); return -1; } @@ -1345,9 +1345,9 @@ retry: } missing = 0; - for (i=0 ; i < new_domain_cnt ; i++) { + for (i = 0; i < new_domain_cnt; i++) { found = 0; - for (j = 0 ; j < priv->activeDomainList->count ; j++) { + for (j = 0; j < priv->activeDomainList->count; j++) { if (priv->activeDomainList->doms[j]->id == new_domids[i]) { found = 1; break; @@ -1416,7 +1416,7 @@ retry: if (new_domain_cnt < 0) return -1; - if( VIR_ALLOC_N(new_domids,new_domain_cnt) < 0 ) { + if (VIR_ALLOC_N(new_domids, new_domain_cnt) < 0 ) { virReportOOMError(); return -1; } @@ -1428,9 +1428,9 @@ retry: } removed = 0; - for (j=0 ; j < priv->activeDomainList->count ; j++) { + for (j = 0; j < priv->activeDomainList->count; j++) { found = 0; - for (i=0 ; i < new_domain_cnt ; i++) { + for (i = 0; i < new_domain_cnt; i++) { if (priv->activeDomainList->doms[j]->id == new_domids[i]) { found = 1; break; diff --git a/src/xenxs/xen_xm.c b/src/xenxs/xen_xm.c index 0ad2179..511d1f5 100644 --- a/src/xenxs/xen_xm.c +++ b/src/xenxs/xen_xm.c @@ -1426,7 +1426,6 @@ virConfPtr xenFormatXM(virConnectPtr conn, if (!(conf = virConfNew())) goto cleanup; - if (xenXMConfigSetString(conf, "name", def->name) < 0) goto no_memory; diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c index f6c7274..34b1df7 100644 --- a/tests/virnetsockettest.c +++ b/tests/virnetsockettest.c @@ -292,13 +292,11 @@ static int testSocketUNIXAddrs(const void *data ATTRIBUTE_UNUSED) goto cleanup; } - if (virNetSocketAccept(lsock, &ssock) < 0) { VIR_DEBUG("Unexpected client socket missing"); goto cleanup; } - if (STRNEQ(virNetSocketLocalAddrString(ssock), "127.0.0.1;0")) { VIR_DEBUG("Unexpected local address"); goto cleanup; @@ -309,7 +307,6 @@ static int testSocketUNIXAddrs(const void *data ATTRIBUTE_UNUSED) goto cleanup; } - ret = 0; cleanup: -- 1.7.4.1

On 07/07/2011 03:24 AM, Matthias Bolte wrote:
No functional change included. --- python/libvirt-override.c | 1 - src/conf/domain_conf.c | 1 - src/conf/interface_conf.c | 1 - src/conf/network_conf.c | 1 - src/conf/node_device_conf.c | 4 - src/conf/storage_conf.c | 1 - src/interface/netcf_driver.c | 16 ++---- src/libxl/libxl_driver.c | 2 +- src/lxc/lxc_driver.c | 2 +- src/node_device/node_device_driver.c | 2 - src/node_device/node_device_linux_sysfs.c | 2 - src/nwfilter/nwfilter_ebiptables_driver.c | 2 - src/openvz/openvz_driver.c | 87 ++++++++++++++--------------- src/qemu/qemu_capabilities.c | 2 +- src/qemu/qemu_command.c | 2 +- src/qemu/qemu_driver.c | 10 +-- src/qemu/qemu_process.c | 1 - src/rpc/virnetclient.c | 2 - src/rpc/virnetserverservice.c | 2 - src/uml/uml_driver.c | 2 - src/xen/xen_driver.c | 1 - src/xen/xs_internal.c | 12 ++-- src/xenxs/xen_xm.c | 1 - tests/virnetsockettest.c | 3 - 24 files changed, 60 insertions(+), 100 deletions(-)
diff --git a/python/libvirt-override.c b/python/libvirt-override.c
True, there don't appear to be any functional changes, and it's nice to have a consistent style to the code. My only problem with this type of commit is that it increases the chances of merge conflicts now and in the future (when someone tries to backport a bugfix to some stable downstream release.) (I periodically have a desire to make similar changes, but then discourage myself for that reason; maybe I'm just too conservative) I assume these were found by an automated tool - do just these changes make all of the source in libvirt consistent to "the style"? Especially if that's the case, I lean more towards pushing them than not; hopefully any merge conflicts that come up will be easy to solve (definitely easier than the ones caused by actual functional changes in the code!), and we can start enforcing the style. So, 1/2 ACK, but wait for someone else to give their 1/2 ACK.

On Thu, Jul 07, 2011 at 03:55:01AM -0400, Laine Stump wrote:
On 07/07/2011 03:24 AM, Matthias Bolte wrote:
No functional change included. --- python/libvirt-override.c | 1 - src/conf/domain_conf.c | 1 - src/conf/interface_conf.c | 1 - src/conf/network_conf.c | 1 - src/conf/node_device_conf.c | 4 - src/conf/storage_conf.c | 1 - src/interface/netcf_driver.c | 16 ++---- src/libxl/libxl_driver.c | 2 +- src/lxc/lxc_driver.c | 2 +- src/node_device/node_device_driver.c | 2 - src/node_device/node_device_linux_sysfs.c | 2 - src/nwfilter/nwfilter_ebiptables_driver.c | 2 - src/openvz/openvz_driver.c | 87 ++++++++++++++--------------- src/qemu/qemu_capabilities.c | 2 +- src/qemu/qemu_command.c | 2 +- src/qemu/qemu_driver.c | 10 +-- src/qemu/qemu_process.c | 1 - src/rpc/virnetclient.c | 2 - src/rpc/virnetserverservice.c | 2 - src/uml/uml_driver.c | 2 - src/xen/xen_driver.c | 1 - src/xen/xs_internal.c | 12 ++-- src/xenxs/xen_xm.c | 1 - tests/virnetsockettest.c | 3 - 24 files changed, 60 insertions(+), 100 deletions(-)
diff --git a/python/libvirt-override.c b/python/libvirt-override.c
True, there don't appear to be any functional changes, and it's nice to have a consistent style to the code. My only problem with this type of commit is that it increases the chances of merge conflicts now and in the future (when someone tries to backport a bugfix to some stable downstream release.) (I periodically have a desire to make similar changes, but then discourage myself for that reason; maybe I'm just too conservative)
I assume these were found by an automated tool - do just these changes make all of the source in libvirt consistent to "the style"? Especially if that's the case, I lean more towards pushing them than not; hopefully any merge conflicts that come up will be easy to solve (definitely easier than the ones caused by actual functional changes in the code!), and we can start enforcing the style.
So, 1/2 ACK, but wait for someone else to give their 1/2 ACK.
ACK. Yes it causes merge pain, but we're usually better off over the long term with this sort of thing. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

2011/7/7 Daniel P. Berrange <berrange@redhat.com>:
On Thu, Jul 07, 2011 at 03:55:01AM -0400, Laine Stump wrote:
On 07/07/2011 03:24 AM, Matthias Bolte wrote:
No functional change included. --- python/libvirt-override.c | 1 - src/conf/domain_conf.c | 1 - src/conf/interface_conf.c | 1 - src/conf/network_conf.c | 1 - src/conf/node_device_conf.c | 4 - src/conf/storage_conf.c | 1 - src/interface/netcf_driver.c | 16 ++---- src/libxl/libxl_driver.c | 2 +- src/lxc/lxc_driver.c | 2 +- src/node_device/node_device_driver.c | 2 - src/node_device/node_device_linux_sysfs.c | 2 - src/nwfilter/nwfilter_ebiptables_driver.c | 2 - src/openvz/openvz_driver.c | 87 ++++++++++++++--------------- src/qemu/qemu_capabilities.c | 2 +- src/qemu/qemu_command.c | 2 +- src/qemu/qemu_driver.c | 10 +-- src/qemu/qemu_process.c | 1 - src/rpc/virnetclient.c | 2 - src/rpc/virnetserverservice.c | 2 - src/uml/uml_driver.c | 2 - src/xen/xen_driver.c | 1 - src/xen/xs_internal.c | 12 ++-- src/xenxs/xen_xm.c | 1 - tests/virnetsockettest.c | 3 - 24 files changed, 60 insertions(+), 100 deletions(-)
diff --git a/python/libvirt-override.c b/python/libvirt-override.c
True, there don't appear to be any functional changes, and it's nice to have a consistent style to the code. My only problem with this type of commit is that it increases the chances of merge conflicts now and in the future (when someone tries to backport a bugfix to some stable downstream release.) (I periodically have a desire to make similar changes, but then discourage myself for that reason; maybe I'm just too conservative)
Well, you have a point there.
I assume these were found by an automated tool - do just these changes make all of the source in libvirt consistent to "the style"?
No, this is just what I found during manual code inspection.
Especially if that's the case, I lean more towards pushing them than not; hopefully any merge conflicts that come up will be easy to solve (definitely easier than the ones caused by actual functional changes in the code!), and we can start enforcing the style.
So, 1/2 ACK, but wait for someone else to give their 1/2 ACK.
ACK. Yes it causes merge pain, but we're usually better off over the long term with this sort of thing.
This is just the tip of the iceberg. A while ago I tweak the config for uncrustify, a code formatter. Here's the diffstat after autoformatting the current codebase examples/domain-events/events-c/event-test.c | 173 ++-- examples/domsuspend/suspend.c | 2 +- examples/hellolibvirt/hellolibvirt.c | 2 +- examples/openauth/openauth.c | 8 +- python/libvirt-override.c | 388 ++++---- python/typewrappers.c | 4 +- python/typewrappers.h | 112 +- src/conf/capabilities.c | 68 +- src/conf/capabilities.h | 2 +- src/conf/cpu_conf.c | 65 +- src/conf/domain_conf.c | 557 +++++----- src/conf/domain_conf.h | 30 +- src/conf/domain_event.c | 46 +- src/conf/domain_event.h | 28 +- src/conf/domain_nwfilter.h | 2 +- src/conf/interface_conf.c | 429 ++++---- src/conf/interface_conf.h | 4 +- src/conf/network_conf.c | 64 +- src/conf/network_conf.h | 4 +- src/conf/node_device_conf.c | 79 +- src/conf/node_device_conf.h | 60 +- src/conf/nwfilter_conf.c | 734 +++++++------- src/conf/nwfilter_conf.h | 134 ++-- src/conf/nwfilter_params.h | 8 +- src/conf/secret_conf.c | 6 +- src/conf/secret_conf.h | 2 +- src/conf/storage_conf.c | 187 ++-- src/conf/storage_encryption_conf.c | 10 +- src/conf/storage_encryption_conf.h | 2 +- src/cpu/cpu.c | 44 +- src/cpu/cpu.h | 120 +- src/cpu/cpu_generic.c | 18 +- src/cpu/cpu_map.c | 14 +- src/cpu/cpu_map.h | 6 +- src/cpu/cpu_x86.c | 113 +- src/datatypes.c | 18 +- src/datatypes.h | 148 ++-- src/driver.h | 1506 +++++++++++++------------- src/esx/esx_driver.c | 260 +++--- src/esx/esx_storage_driver.c | 84 +- src/esx/esx_util.c | 14 +- src/esx/esx_vi.c | 464 ++++---- src/esx/esx_vi.h | 84 +- src/esx/esx_vi_methods.c | 98 +- src/esx/esx_vi_methods.h | 18 +- src/esx/esx_vi_types.c | 684 ++++++------ src/esx/esx_vi_types.h | 28 +- src/fdstream.c | 22 +- src/interface/netcf_driver.c | 75 +- src/internal.h | 30 +- src/libvirt.c | 1042 +++++++++--------- src/libvirt_internal.h | 56 +- src/libxl/libxl_conf.c | 217 ++-- src/libxl/libxl_conf.h | 2 +- src/libxl/libxl_driver.c | 547 +++++----- src/locking/domain_lock.c | 25 +- src/locking/lock_driver_sanlock.c | 22 +- src/locking/lock_manager.c | 14 +- src/lxc/lxc_conf.c | 6 +- src/lxc/lxc_container.c | 56 +- src/lxc/lxc_controller.c | 31 +- src/lxc/lxc_driver.c | 55 +- src/lxc/veth.c | 12 +- src/lxc/veth.h | 22 +- src/network/bridge_driver.c | 78 +- src/node_device/node_device_driver.c | 6 +- src/node_device/node_device_hal.c | 24 +- src/node_device/node_device_linux_sysfs.c | 10 +- src/node_device/node_device_udev.c | 55 +- src/nodeinfo.c | 78 +- src/nwfilter/nwfilter_driver.c | 18 +- src/nwfilter/nwfilter_ebiptables_driver.c | 459 ++++---- src/nwfilter/nwfilter_gentech_driver.c | 105 +- src/nwfilter/nwfilter_learnipaddr.c | 74 +- src/nwfilter/nwfilter_learnipaddr.h | 4 +- src/openvz/openvz_conf.c | 66 +- src/openvz/openvz_conf.h | 4 +- src/openvz/openvz_driver.c | 103 +- src/phyp/phyp_driver.c | 144 ++- src/qemu/qemu_audit.c | 10 +- src/qemu/qemu_audit.h | 30 +- src/qemu/qemu_bridge_filter.c | 22 +- src/qemu/qemu_bridge_filter.h | 8 +- src/qemu/qemu_capabilities.c | 29 +- src/qemu/qemu_cgroup.c | 14 +- src/qemu/qemu_command.c | 365 ++++--- src/qemu/qemu_command.h | 68 +- src/qemu/qemu_conf.c | 140 ++-- src/qemu/qemu_domain.c | 17 +- src/qemu/qemu_domain.h | 4 +- src/qemu/qemu_driver.c | 434 ++++---- src/qemu/qemu_hostdev.c | 6 +- src/qemu/qemu_hotplug.c | 58 +- src/qemu/qemu_migration.c | 91 +- src/qemu/qemu_migration.h | 6 +- src/qemu/qemu_monitor.c | 92 +- src/qemu/qemu_monitor.h | 12 +- src/qemu/qemu_monitor_json.c | 54 +- src/qemu/qemu_monitor_text.c | 154 ++-- src/qemu/qemu_monitor_text.h | 4 +- src/qemu/qemu_process.c | 104 +- src/remote/remote_driver.c | 948 ++++++++-------- src/remote/remote_driver.h | 2 +- src/rpc/virnetclient.c | 44 +- src/rpc/virnetclientprogram.c | 8 +- src/rpc/virnetclientstream.c | 10 +- src/rpc/virnetmessage.c | 10 +- src/rpc/virnetmessage.h | 20 +- src/rpc/virnetsaslcontext.c | 22 +- src/rpc/virnetsaslcontext.h | 2 +- src/rpc/virnetserver.c | 42 +- src/rpc/virnetserverclient.c | 12 +- src/rpc/virnetservermdns.c | 124 ++-- src/rpc/virnetserverprogram.c | 8 +- src/rpc/virnetserverservice.c | 8 +- src/rpc/virnetsocket.c | 22 +- src/rpc/virnettlscontext.c | 30 +- src/rpc/virnettlscontext.h | 4 +- src/secret/secret_driver.c | 18 +- src/security/security_apparmor.c | 48 +- src/security/security_apparmor.h | 2 +- src/security/security_dac.c | 32 +- src/security/security_driver.c | 2 +- src/security/security_driver.h | 98 +- src/security/security_nop.c | 4 +- src/security/security_selinux.c | 27 +- src/security/virt-aa-helper.c | 225 ++-- src/storage/parthelper.c | 4 +- src/storage/storage_backend.c | 86 +- src/storage/storage_backend.h | 8 +- src/storage/storage_backend_disk.c | 116 +- src/storage/storage_backend_fs.c | 35 +- src/storage/storage_backend_iscsi.c | 14 +- src/storage/storage_backend_logical.c | 27 +- src/storage/storage_backend_mpath.c | 2 +- src/storage/storage_backend_scsi.c | 5 +- src/storage/storage_driver.c | 50 +- src/test/test_driver.c | 341 +++--- src/uml/uml_conf.c | 67 +- src/uml/uml_conf.h | 4 +- src/uml/uml_driver.c | 72 +- src/util/authhelper.c | 4 +- src/util/bitmap.c | 4 +- src/util/bitmap.h | 8 +- src/util/bridge.c | 26 +- src/util/bridge.h | 110 +- src/util/buf.c | 15 +- src/util/buf.h | 10 +- src/util/cgroup.c | 42 +- src/util/command.c | 78 +- src/util/command.h | 20 +- src/util/conf.c | 158 ++-- src/util/conf.h | 55 +- src/util/dnsmasq.c | 18 +- src/util/dnsmasq.h | 10 +- src/util/ebtables.c | 24 +- src/util/ebtables.h | 24 +- src/util/event.c | 12 +- src/util/event_poll.c | 70 +- src/util/event_poll.h | 12 +- src/util/hash.c | 6 +- src/util/hash.h | 8 +- src/util/hooks.c | 26 +- src/util/hostusb.c | 10 +- src/util/hostusb.h | 2 +- src/util/interface.c | 22 +- src/util/iohelper.c | 7 +- src/util/iptables.c | 4 +- src/util/iptables.h | 152 ++-- src/util/json.c | 32 +- src/util/logging.c | 134 ++- src/util/logging.h | 16 +- src/util/macvtap.c | 69 +- src/util/macvtap.h | 10 +- src/util/memory.c | 16 +- src/util/memory.h | 16 +- src/util/netlink.c | 10 +- src/util/network.c | 42 +- src/util/network.h | 40 +- src/util/pci.c | 59 +- src/util/pci.h | 48 +- src/util/processinfo.c | 8 +- src/util/qparams.c | 96 +- src/util/qparams.h | 30 +- src/util/sexpr.c | 31 +- src/util/sexpr.h | 2 +- src/util/stats_linux.c | 26 +- src/util/storage_file.c | 166 ++-- src/util/sysinfo.c | 12 +- src/util/sysinfo.h | 2 +- src/util/threadpool.h | 2 +- src/util/threads-pthread.h | 6 +- src/util/threads-win32.c | 6 +- src/util/threads.h | 4 +- src/util/util.c | 133 ++- src/util/util.h | 52 +- src/util/uuid.c | 6 +- src/util/virtaudit.h | 10 +- src/util/virterror.c | 1273 ++++++++++++---------- src/util/virterror_internal.h | 16 +- src/util/xml.c | 14 +- src/util/xml.h | 20 +- src/vbox/vbox_MSCOMGlue.c | 14 +- src/vbox/vbox_V2_2.c | 2 +- src/vbox/vbox_V3_0.c | 2 +- src/vbox/vbox_V3_1.c | 2 +- src/vbox/vbox_V3_2.c | 2 +- src/vbox/vbox_V4_0.c | 2 +- src/vbox/vbox_XPCOMCGlue.c | 2 +- src/vbox/vbox_driver.c | 24 +- src/vbox/vbox_tmpl.c | 422 ++++---- src/vmware/vmware_conf.c | 20 +- src/vmware/vmware_conf.h | 6 +- src/vmware/vmware_driver.c | 48 +- src/vmx/vmx.c | 618 ++++++------ src/vmx/vmx.h | 2 +- src/xen/block_stats.c | 67 +- src/xen/block_stats.h | 6 +- src/xen/xen_driver.c | 431 ++++---- src/xen/xen_driver.h | 88 +- src/xen/xen_hypervisor.c | 783 +++++++------- src/xen/xen_hypervisor.h | 174 ++-- src/xen/xen_inotify.c | 44 +- src/xen/xen_inotify.h | 8 +- src/xen/xend_internal.c | 554 +++++----- src/xen/xend_internal.h | 56 +- src/xen/xm_internal.c | 81 +- src/xen/xm_internal.h | 6 +- src/xen/xs_internal.c | 115 +- src/xen/xs_internal.h | 80 +- src/xenapi/xenapi_driver.c | 216 ++-- src/xenapi/xenapi_utils.c | 45 +- src/xenapi/xenapi_utils.h | 6 +- src/xenxs/xen_sxpr.c | 242 ++--- src/xenxs/xen_sxpr.h | 4 +- src/xenxs/xen_xm.c | 205 ++-- tests/commandhelper.c | 14 +- tests/commandtest.c | 32 +- tests/conftest.c | 2 +- tests/cputest.c | 15 +- tests/esxutilstest.c | 35 +- tests/eventtest.c | 18 +- tests/hashdata.h | 150 ++-- tests/hashtest.c | 4 +- tests/interfacexml2xmltest.c | 8 +- tests/jsontest.c | 4 +- tests/networkxml2argvtest.c | 8 +- tests/networkxml2xmltest.c | 8 +- tests/nodedevxml2xmltest.c | 6 +- tests/nodeinfotest.c | 20 +- tests/nwfilterxml2xmltest.c | 4 +- tests/openvzutilstest.c | 12 +- tests/qemuargv2xmltest.c | 12 +- tests/qemuhelptest.c | 20 +- tests/qemuxml2argvtest.c | 38 +- tests/qemuxml2xmltest.c | 10 +- tests/qparamtest.c | 8 +- tests/seclabeltest.c | 24 +- tests/sexpr2xmltest.c | 116 +- tests/sockettest.c | 8 +- tests/ssh.c | 6 +- tests/statstest.c | 14 +- tests/storagepoolxml2xmltest.c | 8 +- tests/storagevolxml2xmltest.c | 8 +- tests/testutils.c | 67 +- tests/testutilsxen.c | 2 +- tests/utiltest.c | 14 +- tests/virbuftest.c | 2 +- tests/virnetmessagetest.c | 4 +- tests/virnetsockettest.c | 18 +- tests/virshtest.c | 134 ++-- tests/vmx2xmltest.c | 32 +- tests/xencapstest.c | 166 ++-- tests/xmconfigtest.c | 6 +- tests/xml2sexprtest.c | 52 +- tests/xml2vmxtest.c | 34 +- uncrustify.cfg | 1161 ++++++++++++++++++++ 277 files changed, 13209 insertions(+), 11534 deletions(-) create mode 100644 uncrustify.cfg uncrustify works pretty well, but ~3000 lines of the diff are due to false positives where uncrustify changes the style (but shouldn't) because I'm not finished with tweaking uncrustify yet. You can find this commit at https://gitorious.org/~photron/libvirt/photron-libvirt/commits/uncrustify as 94f7a6bff55df82d28a39a2782112f7b08e75f5d. -- Matthias Bolte http://photron.blogspot.com
participants (3)
-
Daniel P. Berrange
-
Laine Stump
-
Matthias Bolte