Keep line length <= 80 cols.
Signed-off-by: John Ferlan <jferlan@redhat.com>
---
src/qemu/qemu_conf.c | 93 ++++++++++++++++++++++++++++++++++------------------
1 file changed, 62 insertions(+), 31 deletions(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 73c33d6..94e00b2 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -467,23 +467,28 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
if (!(conf = virConfReadFile(filename, 0)))
goto cleanup;
- if (virConfGetValueString(conf, "default_tls_x509_cert_dir", &cfg->defaultTLSx509certdir) < 0)
+ if (virConfGetValueString(conf, "default_tls_x509_cert_dir",
+ &cfg->defaultTLSx509certdir) < 0)
goto cleanup;
- if (virConfGetValueBool(conf, "default_tls_x509_verify", &cfg->defaultTLSx509verify) < 0)
+ if (virConfGetValueBool(conf, "default_tls_x509_verify",
+ &cfg->defaultTLSx509verify) < 0)
goto cleanup;
if (virConfGetValueString(conf, "default_tls_x509_secret_uuid",
&cfg->defaultTLSx509secretUUID) < 0)
goto cleanup;
- if (virConfGetValueBool(conf, "vnc_auto_unix_socket", &cfg->vncAutoUnixSocket) < 0)
+ if (virConfGetValueBool(conf, "vnc_auto_unix_socket",
+ &cfg->vncAutoUnixSocket) < 0)
goto cleanup;
if (virConfGetValueBool(conf, "vnc_tls", &cfg->vncTLS) < 0)
goto cleanup;
- if ((rv = virConfGetValueBool(conf, "vnc_tls_x509_verify", &cfg->vncTLSx509verify)) < 0)
+ if ((rv = virConfGetValueBool(conf, "vnc_tls_x509_verify",
+ &cfg->vncTLSx509verify)) < 0)
goto cleanup;
if (rv == 0)
cfg->vncTLSx509verify = cfg->defaultTLSx509verify;
- if (virConfGetValueString(conf, "vnc_tls_x509_cert_dir", &cfg->vncTLSx509certdir) < 0)
+ if (virConfGetValueString(conf, "vnc_tls_x509_cert_dir",
+ &cfg->vncTLSx509certdir) < 0)
goto cleanup;
if (virConfGetValueString(conf, "vnc_listen", &cfg->vncListen) < 0)
goto cleanup;
@@ -493,16 +498,20 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
goto cleanup;
if (virConfGetValueString(conf, "vnc_sasl_dir", &cfg->vncSASLdir) < 0)
goto cleanup;
- if (virConfGetValueBool(conf, "vnc_allow_host_audio", &cfg->vncAllowHostAudio) < 0)
+ if (virConfGetValueBool(conf, "vnc_allow_host_audio",
+ &cfg->vncAllowHostAudio) < 0)
goto cleanup;
- if (virConfGetValueBool(conf, "nographics_allow_host_audio", &cfg->nogfxAllowHostAudio) < 0)
+ if (virConfGetValueBool(conf, "nographics_allow_host_audio",
+ &cfg->nogfxAllowHostAudio) < 0)
goto cleanup;
- if (virConfGetValueStringList(conf, "security_driver", true, &cfg->securityDriverNames) < 0)
+ if (virConfGetValueStringList(conf, "security_driver", true,
+ &cfg->securityDriverNames) < 0)
goto cleanup;
- for (i = 0; cfg->securityDriverNames && cfg->securityDriverNames[i] != NULL; i++) {
+ for (i = 0;
+ cfg->securityDriverNames && cfg->securityDriverNames[i] != NULL; i++) {
for (j = i + 1; cfg->securityDriverNames[j] != NULL; j++) {
if (STREQ(cfg->securityDriverNames[i],
cfg->securityDriverNames[j])) {
@@ -514,14 +523,17 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
}
}
- if (virConfGetValueBool(conf, "security_default_confined", &cfg->securityDefaultConfined) < 0)
+ if (virConfGetValueBool(conf, "security_default_confined",
+ &cfg->securityDefaultConfined) < 0)
goto cleanup;
- if (virConfGetValueBool(conf, "security_require_confined", &cfg->securityRequireConfined) < 0)
+ if (virConfGetValueBool(conf, "security_require_confined",
+ &cfg->securityRequireConfined) < 0)
goto cleanup;
if (virConfGetValueBool(conf, "spice_tls", &cfg->spiceTLS) < 0)
goto cleanup;
- if (virConfGetValueString(conf, "spice_tls_x509_cert_dir", &cfg->spiceTLSx509certdir) < 0)
+ if (virConfGetValueString(conf, "spice_tls_x509_cert_dir",
+ &cfg->spiceTLSx509certdir) < 0)
goto cleanup;
if (virConfGetValueBool(conf, "spice_sasl", &cfg->spiceSASL) < 0)
goto cleanup;
@@ -531,7 +543,8 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
goto cleanup;
if (virConfGetValueString(conf, "spice_password", &cfg->spicePassword) < 0)
goto cleanup;
- if (virConfGetValueBool(conf, "spice_auto_unix_socket", &cfg->spiceAutoUnixSocket) < 0)
+ if (virConfGetValueBool(conf, "spice_auto_unix_socket",
+ &cfg->spiceAutoUnixSocket) < 0)
goto cleanup;
#define GET_CONFIG_TLS_CERTINFO(val) \
@@ -564,7 +577,8 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
#undef GET_CONFIG_TLS_CERTINFO
- if (virConfGetValueUInt(conf, "remote_websocket_port_min", &cfg->webSocketPortMin) < 0)
+ if (virConfGetValueUInt(conf, "remote_websocket_port_min",
+ &cfg->webSocketPortMin) < 0)
goto cleanup;
if (cfg->webSocketPortMin < QEMU_WEBSOCKET_PORT_MIN) {
/* if the port is too low, we can't get the display name
@@ -577,7 +591,8 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
goto cleanup;
}
- if (virConfGetValueUInt(conf, "remote_websocket_port_max", &cfg->webSocketPortMax) < 0)
+ if (virConfGetValueUInt(conf, "remote_websocket_port_max",
+ &cfg->webSocketPortMax) < 0)
goto cleanup;
if (cfg->webSocketPortMax > QEMU_WEBSOCKET_PORT_MAX ||
cfg->webSocketPortMax < cfg->webSocketPortMin) {
@@ -595,7 +610,8 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
goto cleanup;
}
- if (virConfGetValueUInt(conf, "remote_display_port_min", &cfg->remotePortMin) < 0)
+ if (virConfGetValueUInt(conf, "remote_display_port_min",
+ &cfg->remotePortMin) < 0)
goto cleanup;
if (cfg->remotePortMin < QEMU_REMOTE_PORT_MIN) {
/* if the port is too low, we can't get the display name
@@ -608,7 +624,8 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
goto cleanup;
}
- if (virConfGetValueUInt(conf, "remote_display_port_max", &cfg->remotePortMax) < 0)
+ if (virConfGetValueUInt(conf, "remote_display_port_max",
+ &cfg->remotePortMax) < 0)
goto cleanup;
if (cfg->remotePortMax > QEMU_REMOTE_PORT_MAX ||
cfg->remotePortMax < cfg->remotePortMin) {
@@ -626,7 +643,8 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
goto cleanup;
}
- if (virConfGetValueUInt(conf, "migration_port_min", &cfg->migrationPortMin) < 0)
+ if (virConfGetValueUInt(conf, "migration_port_min",
+ &cfg->migrationPortMin) < 0)
goto cleanup;
if (cfg->migrationPortMin <= 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -635,7 +653,8 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
goto cleanup;
}
- if (virConfGetValueUInt(conf, "migration_port_max", &cfg->migrationPortMax) < 0)
+ if (virConfGetValueUInt(conf, "migration_port_max",
+ &cfg->migrationPortMax) < 0)
goto cleanup;
if (cfg->migrationPortMax > 65535 ||
cfg->migrationPortMax < cfg->migrationPortMin) {
@@ -656,7 +675,8 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
if (group && virGetGroupID(group, &cfg->group) < 0)
goto cleanup;
- if (virConfGetValueBool(conf, "dynamic_ownership", &cfg->dynamicOwnership) < 0)
+ if (virConfGetValueBool(conf, "dynamic_ownership",
+ &cfg->dynamicOwnership) < 0)
goto cleanup;
if (virConfGetValueStringList(conf, "cgroup_controllers", false,
@@ -681,18 +701,23 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
&cfg->cgroupDeviceACL) < 0)
goto cleanup;
- if (virConfGetValueString(conf, "save_image_format", &cfg->saveImageFormat) < 0)
+ if (virConfGetValueString(conf, "save_image_format",
+ &cfg->saveImageFormat) < 0)
goto cleanup;
- if (virConfGetValueString(conf, "dump_image_format", &cfg->dumpImageFormat) < 0)
+ if (virConfGetValueString(conf, "dump_image_format",
+ &cfg->dumpImageFormat) < 0)
goto cleanup;
- if (virConfGetValueString(conf, "snapshot_image_format", &cfg->snapshotImageFormat) < 0)
+ if (virConfGetValueString(conf, "snapshot_image_format",
+ &cfg->snapshotImageFormat) < 0)
goto cleanup;
if (virConfGetValueString(conf, "auto_dump_path", &cfg->autoDumpPath) < 0)
goto cleanup;
- if (virConfGetValueBool(conf, "auto_dump_bypass_cache", &cfg->autoDumpBypassCache) < 0)
+ if (virConfGetValueBool(conf, "auto_dump_bypass_cache",
+ &cfg->autoDumpBypassCache) < 0)
goto cleanup;
- if (virConfGetValueBool(conf, "auto_start_bypass_cache", &cfg->autoStartBypassCache) < 0)
+ if (virConfGetValueBool(conf, "auto_start_bypass_cache",
+ &cfg->autoStartBypassCache) < 0)
goto cleanup;
if (virConfGetValueStringList(conf, "hugetlbfs_mount", true,
@@ -718,7 +743,8 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
}
}
- if (virConfGetValueString(conf, "bridge_helper", &cfg->bridgeHelperName) < 0)
+ if (virConfGetValueString(conf, "bridge_helper",
+ &cfg->bridgeHelperName) < 0)
goto cleanup;
if (virConfGetValueBool(conf, "mac_filter", &cfg->macFilter) < 0)
@@ -726,9 +752,11 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
if (virConfGetValueBool(conf, "relaxed_acs_check", &cfg->relaxedACS) < 0)
goto cleanup;
- if (virConfGetValueBool(conf, "clear_emulator_capabilities", &cfg->clearEmulatorCapabilities) < 0)
+ if (virConfGetValueBool(conf, "clear_emulator_capabilities",
+ &cfg->clearEmulatorCapabilities) < 0)
goto cleanup;
- if (virConfGetValueBool(conf, "allow_disk_format_probing", &cfg->allowDiskFormatProbing) < 0)
+ if (virConfGetValueBool(conf, "allow_disk_format_probing",
+ &cfg->allowDiskFormatProbing) < 0)
goto cleanup;
if (virConfGetValueBool(conf, "set_process_name", &cfg->setProcessName) < 0)
goto cleanup;
@@ -777,7 +805,8 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
if (virConfGetValueUInt(conf, "max_queued", &cfg->maxQueuedJobs) < 0)
goto cleanup;
- if (virConfGetValueInt(conf, "keepalive_interval", &cfg->keepAliveInterval) < 0)
+ if (virConfGetValueInt(conf, "keepalive_interval",
+ &cfg->keepAliveInterval) < 0)
goto cleanup;
if (virConfGetValueUInt(conf, "keepalive_count", &cfg->keepAliveCount) < 0)
goto cleanup;
@@ -830,7 +859,8 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
goto cleanup;
}
}
- if (virConfGetValueUInt(conf, "gluster_debug_level", &cfg->glusterDebugLevel) < 0)
+ if (virConfGetValueUInt(conf, "gluster_debug_level",
+ &cfg->glusterDebugLevel) < 0)
goto cleanup;
if (virConfGetValueStringList(conf, "namespaces", false, &namespaces) < 0)
@@ -871,7 +901,8 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
}
}
- if (virConfGetValueString(conf, "memory_backing_dir", &cfg->memoryBackingDir) < 0)
+ if (virConfGetValueString(conf, "memory_backing_dir",
+ &cfg->memoryBackingDir) < 0)
goto cleanup;
ret = 0;
--
2.9.4
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
On Wed, 2017-06-28 at 15:30 -0400, John Ferlan wrote: > Keep line length <= 80 cols. > > Signed-off-by: John Ferlan <jferlan@redhat.com> > --- > src/qemu/qemu_conf.c | 93 ++++++++++++++++++++++++++++++++++------------------ > 1 file changed, 62 insertions(+), 31 deletions(-) I'm pretty sure we agreed that the 80 column limit is not something we're interested in enforcing: if anything, we're actually moving away from it when changing existing code. -- Andrea Bolognani / Red Hat / Virtualization -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
On 06/29/2017 07:17 AM, Andrea Bolognani wrote: > On Wed, 2017-06-28 at 15:30 -0400, John Ferlan wrote: >> Keep line length <= 80 cols. >> >> Signed-off-by: John Ferlan <jferlan@redhat.com> >> --- >> src/qemu/qemu_conf.c | 93 ++++++++++++++++++++++++++++++++++------------------ >> 1 file changed, 62 insertions(+), 31 deletions(-) > > I'm pretty sure we agreed that the 80 column limit is not > something we're interested in enforcing: if anything, we're > actually moving away from it when changing existing code. > > -- > Andrea Bolognani / Red Hat / Virtualization > The collective "we"? Not sure I agree. I was under the impression that it wasn't a requirement to change existing code to wrap at 80 cols, rather it was something that one could do and if they did so it should be a separate patch rather than interspersing within other changes. I think if it's one or two characters, then it's not such a huge deal, but having long lines that wrap in code is unreadable especially for those of us using 80xNN windows. Those that use 100xNN or 132xNN with 8pt fonts will eventually need an 80xNN window with 18pt fonts ;-). Still, I'm not really interested in a long debate on this, so I can drop this patch even though I find the code to be unreadable as is. John -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
On Thu, Jun 29, 2017 at 13:17:56 +0200, Andrea Bolognani wrote: > On Wed, 2017-06-28 at 15:30 -0400, John Ferlan wrote: > > Keep line length <= 80 cols. > > > > Signed-off-by: John Ferlan <jferlan@redhat.com> > > --- > > src/qemu/qemu_conf.c | 93 ++++++++++++++++++++++++++++++++++------------------ > > 1 file changed, 62 insertions(+), 31 deletions(-) > > I'm pretty sure we agreed that the 80 column limit is not > something we're interested in enforcing: if anything, we're > actually moving away from it when changing existing code. That very much depends on the circumstances. If the line can be easily and cleanly broken we should stick to 80. If it would break coding style and/or not align properly I'm fine with exceding it. In the patch above, most of the changes breaking the argument on a second line are fine, but the line which breaks up the 'for' loop is not okay in this regard, since most for loops are with all three arguments on a single line. The 80 col boudnary has a good buffer zone until it starts running into border of various users and still motivates us to keep the lines short. -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
© 2016 - 2025 Red Hat, Inc.