[libvirt] [PATCH 0/3] security_dac: trivial cleanups

A while back, Michal Privoznik posted a small series to honor the DAC norelabel attribute https://www.redhat.com/archives/libvir-list/2014-April/msg00196.html When reviewing patch 1, Jan Tomko noted that trivial whitespace changes and the like should be separate from changes to the callback parameter passing. This small series contains the most trivial changes Michal made to patch 1. By "most trivial", I mean these could probably be pushed under the trivail rule, but posting for a quick review nonetheless. Jim Fehlig (3): security_dac: Remove unnecessary ATTRIBUTE_UNUSED security_dac: Remove unnecessary curly braces security_dac: Fix indentation src/security/security_dac.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) -- 1.8.1.4

Remove ATTRIBUTE_UNUSED on several function parameters that are actually used. Signed-off-by: Jim Fehlig <jfehlig@suse.com> --- src/security/security_dac.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/security/security_dac.c b/src/security/security_dac.c index 8512767..3dc1504 100644 --- a/src/security/security_dac.c +++ b/src/security/security_dac.c @@ -880,7 +880,7 @@ virSecurityDACRestoreSecurityAllLabel(virSecurityManagerPtr mgr, static int -virSecurityDACSetChardevCallback(virDomainDefPtr def ATTRIBUTE_UNUSED, +virSecurityDACSetChardevCallback(virDomainDefPtr def, virDomainChrDefPtr dev, void *opaque) { @@ -984,7 +984,7 @@ virSecurityDACRestoreSavedStateLabel(virSecurityManagerPtr mgr, static int virSecurityDACSetProcessLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def ATTRIBUTE_UNUSED) + virDomainDefPtr def) { uid_t user; gid_t group; @@ -1007,7 +1007,7 @@ virSecurityDACSetProcessLabel(virSecurityManagerPtr mgr, static int virSecurityDACSetChildProcessLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def ATTRIBUTE_UNUSED, + virDomainDefPtr def, virCommandPtr cmd) { uid_t user; @@ -1119,9 +1119,9 @@ virSecurityDACReserveLabel(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED, static int virSecurityDACGetProcessLabel(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED, - virDomainDefPtr def ATTRIBUTE_UNUSED, + virDomainDefPtr def, pid_t pid ATTRIBUTE_UNUSED, - virSecurityLabelPtr seclabel ATTRIBUTE_UNUSED) + virSecurityLabelPtr seclabel) { virSecurityLabelDefPtr secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_DAC_NAME); -- 1.8.1.4

Signed-off-by: Jim Fehlig <jfehlig@suse.com> --- src/security/security_dac.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/security/security_dac.c b/src/security/security_dac.c index 3dc1504..39bd6cb 100644 --- a/src/security/security_dac.c +++ b/src/security/security_dac.c @@ -1042,9 +1042,8 @@ virSecurityDACGenLabel(virSecurityManagerPtr mgr, virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); seclabel = virDomainDefGetSecurityLabelDef(def, SECURITY_DAC_NAME); - if (seclabel == NULL) { + if (seclabel == NULL) return rc; - } if (seclabel->imagelabel) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -- 1.8.1.4

Signed-off-by: Jim Fehlig <jfehlig@suse.com> --- src/security/security_dac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/security/security_dac.c b/src/security/security_dac.c index 39bd6cb..ed79857 100644 --- a/src/security/security_dac.c +++ b/src/security/security_dac.c @@ -750,7 +750,7 @@ virSecurityDACRestoreChardevLabel(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED, if (virFileExists(in) && virFileExists(out)) { if ((virSecurityDACRestoreSecurityFileLabel(out) < 0) || (virSecurityDACRestoreSecurityFileLabel(in) < 0)) { - goto done; + goto done; } } else if (virSecurityDACRestoreSecurityFileLabel(dev->data.file.path) < 0) { goto done; -- 1.8.1.4

Jim Fehlig wrote:
A while back, Michal Privoznik posted a small series to honor the DAC norelabel attribute
https://www.redhat.com/archives/libvir-list/2014-April/msg00196.html
When reviewing patch 1, Jan Tomko noted that trivial whitespace changes and the like should be separate from changes to the callback parameter passing. This small series contains the most trivial changes Michal made to patch 1. By "most trivial", I mean these could probably be pushed under the trivail rule, but posting for a quick review nonetheless.
Forgot to mention, I'm working on a V3 of Michal's series, which I hope to post in the next day or so. Regards, Jim
Jim Fehlig (3): security_dac: Remove unnecessary ATTRIBUTE_UNUSED security_dac: Remove unnecessary curly braces security_dac: Fix indentation
src/security/security_dac.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)

On 05/14/14 19:57, Jim Fehlig wrote:
A while back, Michal Privoznik posted a small series to honor the DAC norelabel attribute
https://www.redhat.com/archives/libvir-list/2014-April/msg00196.html
When reviewing patch 1, Jan Tomko noted that trivial whitespace changes and the like should be separate from changes to the callback parameter passing. This small series contains the most trivial changes Michal made to patch 1. By "most trivial", I mean these could probably be pushed under the trivail rule, but posting for a quick review nonetheless.
Jim Fehlig (3): security_dac: Remove unnecessary ATTRIBUTE_UNUSED security_dac: Remove unnecessary curly braces security_dac: Fix indentation
src/security/security_dac.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
ACK series. Peter

Peter Krempa wrote:
On 05/14/14 19:57, Jim Fehlig wrote:
A while back, Michal Privoznik posted a small series to honor the DAC norelabel attribute
https://www.redhat.com/archives/libvir-list/2014-April/msg00196.html
When reviewing patch 1, Jan Tomko noted that trivial whitespace changes and the like should be separate from changes to the callback parameter passing. This small series contains the most trivial changes Michal made to patch 1. By "most trivial", I mean these could probably be pushed under the trivail rule, but posting for a quick review nonetheless.
Jim Fehlig (3): security_dac: Remove unnecessary ATTRIBUTE_UNUSED security_dac: Remove unnecessary curly braces security_dac: Fix indentation
src/security/security_dac.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
ACK series.
Thanks, pushed. Regards, Jim
participants (2)
-
Jim Fehlig
-
Peter Krempa