2019-11-28 15:22:49 +03:00
|
|
|
/*
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
* FUSE: Filesystem in Userspace
|
|
|
|
* Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
|
|
|
|
*
|
|
|
|
* Helper functions to create (simple) standalone programs. With the
|
|
|
|
* aid of these functions it should be possible to create full FUSE
|
|
|
|
* file system by implementing nothing but the request handlers.
|
2019-11-28 15:22:49 +03:00
|
|
|
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
* This program can be distributed under the terms of the GNU LGPLv2.
|
|
|
|
* See the file COPYING.LIB.
|
|
|
|
*/
|
2019-11-28 15:22:49 +03:00
|
|
|
|
2019-02-08 14:48:42 +03:00
|
|
|
#include "qemu/osdep.h"
|
2019-11-28 15:22:49 +03:00
|
|
|
#include "fuse_i.h"
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
#include "fuse_lowlevel.h"
|
2019-11-28 15:22:49 +03:00
|
|
|
#include "fuse_misc.h"
|
|
|
|
#include "fuse_opt.h"
|
|
|
|
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
#include <errno.h>
|
|
|
|
#include <limits.h>
|
|
|
|
#include <stddef.h>
|
2019-11-28 15:22:49 +03:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <sys/param.h>
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
#include <unistd.h>
|
2019-11-28 15:22:49 +03:00
|
|
|
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
#define FUSE_HELPER_OPT(t, p) \
|
|
|
|
{ \
|
|
|
|
t, offsetof(struct fuse_cmdline_opts, p), 1 \
|
|
|
|
}
|
2019-11-28 15:22:49 +03:00
|
|
|
|
|
|
|
static const struct fuse_opt fuse_helper_opts[] = {
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
FUSE_HELPER_OPT("-h", show_help),
|
|
|
|
FUSE_HELPER_OPT("--help", show_help),
|
|
|
|
FUSE_HELPER_OPT("-V", show_version),
|
|
|
|
FUSE_HELPER_OPT("--version", show_version),
|
|
|
|
FUSE_HELPER_OPT("-d", debug),
|
|
|
|
FUSE_HELPER_OPT("debug", debug),
|
|
|
|
FUSE_HELPER_OPT("-d", foreground),
|
|
|
|
FUSE_HELPER_OPT("debug", foreground),
|
|
|
|
FUSE_OPT_KEY("-d", FUSE_OPT_KEY_KEEP),
|
|
|
|
FUSE_OPT_KEY("debug", FUSE_OPT_KEY_KEEP),
|
|
|
|
FUSE_HELPER_OPT("-f", foreground),
|
|
|
|
FUSE_HELPER_OPT("fsname=", nodefault_subtype),
|
|
|
|
FUSE_OPT_KEY("fsname=", FUSE_OPT_KEY_KEEP),
|
|
|
|
FUSE_HELPER_OPT("subtype=", nodefault_subtype),
|
|
|
|
FUSE_OPT_KEY("subtype=", FUSE_OPT_KEY_KEEP),
|
|
|
|
FUSE_HELPER_OPT("max_idle_threads=%u", max_idle_threads),
|
|
|
|
FUSE_OPT_END
|
2019-11-28 15:22:49 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
struct fuse_conn_info_opts {
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
int atomic_o_trunc;
|
|
|
|
int no_remote_posix_lock;
|
|
|
|
int no_remote_flock;
|
|
|
|
int splice_write;
|
|
|
|
int splice_move;
|
|
|
|
int splice_read;
|
|
|
|
int no_splice_write;
|
|
|
|
int no_splice_move;
|
|
|
|
int no_splice_read;
|
|
|
|
int auto_inval_data;
|
|
|
|
int no_auto_inval_data;
|
|
|
|
int no_readdirplus;
|
|
|
|
int no_readdirplus_auto;
|
|
|
|
int async_dio;
|
|
|
|
int no_async_dio;
|
|
|
|
int writeback_cache;
|
|
|
|
int no_writeback_cache;
|
|
|
|
int async_read;
|
|
|
|
int sync_read;
|
|
|
|
unsigned max_write;
|
|
|
|
unsigned max_readahead;
|
|
|
|
unsigned max_background;
|
|
|
|
unsigned congestion_threshold;
|
|
|
|
unsigned time_gran;
|
|
|
|
int set_max_write;
|
|
|
|
int set_max_readahead;
|
|
|
|
int set_max_background;
|
|
|
|
int set_congestion_threshold;
|
|
|
|
int set_time_gran;
|
2019-11-28 15:22:49 +03:00
|
|
|
};
|
|
|
|
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
#define CONN_OPTION(t, p, v) \
|
|
|
|
{ \
|
|
|
|
t, offsetof(struct fuse_conn_info_opts, p), v \
|
|
|
|
}
|
2019-11-28 15:22:49 +03:00
|
|
|
static const struct fuse_opt conn_info_opt_spec[] = {
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
CONN_OPTION("max_write=%u", max_write, 0),
|
|
|
|
CONN_OPTION("max_write=", set_max_write, 1),
|
|
|
|
CONN_OPTION("max_readahead=%u", max_readahead, 0),
|
|
|
|
CONN_OPTION("max_readahead=", set_max_readahead, 1),
|
|
|
|
CONN_OPTION("max_background=%u", max_background, 0),
|
|
|
|
CONN_OPTION("max_background=", set_max_background, 1),
|
|
|
|
CONN_OPTION("congestion_threshold=%u", congestion_threshold, 0),
|
|
|
|
CONN_OPTION("congestion_threshold=", set_congestion_threshold, 1),
|
|
|
|
CONN_OPTION("sync_read", sync_read, 1),
|
|
|
|
CONN_OPTION("async_read", async_read, 1),
|
|
|
|
CONN_OPTION("atomic_o_trunc", atomic_o_trunc, 1),
|
|
|
|
CONN_OPTION("no_remote_lock", no_remote_posix_lock, 1),
|
|
|
|
CONN_OPTION("no_remote_lock", no_remote_flock, 1),
|
|
|
|
CONN_OPTION("no_remote_flock", no_remote_flock, 1),
|
|
|
|
CONN_OPTION("no_remote_posix_lock", no_remote_posix_lock, 1),
|
|
|
|
CONN_OPTION("splice_write", splice_write, 1),
|
|
|
|
CONN_OPTION("no_splice_write", no_splice_write, 1),
|
|
|
|
CONN_OPTION("splice_move", splice_move, 1),
|
|
|
|
CONN_OPTION("no_splice_move", no_splice_move, 1),
|
|
|
|
CONN_OPTION("splice_read", splice_read, 1),
|
|
|
|
CONN_OPTION("no_splice_read", no_splice_read, 1),
|
|
|
|
CONN_OPTION("auto_inval_data", auto_inval_data, 1),
|
|
|
|
CONN_OPTION("no_auto_inval_data", no_auto_inval_data, 1),
|
|
|
|
CONN_OPTION("readdirplus=no", no_readdirplus, 1),
|
|
|
|
CONN_OPTION("readdirplus=yes", no_readdirplus, 0),
|
|
|
|
CONN_OPTION("readdirplus=yes", no_readdirplus_auto, 1),
|
|
|
|
CONN_OPTION("readdirplus=auto", no_readdirplus, 0),
|
|
|
|
CONN_OPTION("readdirplus=auto", no_readdirplus_auto, 0),
|
|
|
|
CONN_OPTION("async_dio", async_dio, 1),
|
|
|
|
CONN_OPTION("no_async_dio", no_async_dio, 1),
|
|
|
|
CONN_OPTION("writeback_cache", writeback_cache, 1),
|
|
|
|
CONN_OPTION("no_writeback_cache", no_writeback_cache, 1),
|
|
|
|
CONN_OPTION("time_gran=%u", time_gran, 0),
|
|
|
|
CONN_OPTION("time_gran=", set_time_gran, 1),
|
|
|
|
FUSE_OPT_END
|
2019-11-28 15:22:49 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
void fuse_cmdline_help(void)
|
|
|
|
{
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
printf(
|
|
|
|
" -h --help print help\n"
|
|
|
|
" -V --version print version\n"
|
|
|
|
" -d -o debug enable debug output (implies -f)\n"
|
|
|
|
" -f foreground operation\n"
|
|
|
|
" -o max_idle_threads the maximum number of idle worker threads\n"
|
|
|
|
" allowed (default: 10)\n");
|
2019-11-28 15:22:49 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static int fuse_helper_opt_proc(void *data, const char *arg, int key,
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
struct fuse_args *outargs)
|
2019-11-28 15:22:49 +03:00
|
|
|
{
|
2019-03-08 16:24:31 +03:00
|
|
|
(void)data;
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
(void)outargs;
|
|
|
|
|
|
|
|
switch (key) {
|
|
|
|
case FUSE_OPT_KEY_NONOPT:
|
2019-03-08 16:24:31 +03:00
|
|
|
fuse_log(FUSE_LOG_ERR, "fuse: invalid argument `%s'\n", arg);
|
|
|
|
return -1;
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
|
|
|
|
default:
|
|
|
|
/* Pass through unknown options */
|
|
|
|
return 1;
|
|
|
|
}
|
2019-11-28 15:22:49 +03:00
|
|
|
}
|
|
|
|
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
int fuse_parse_cmdline(struct fuse_args *args, struct fuse_cmdline_opts *opts)
|
2019-11-28 15:22:49 +03:00
|
|
|
{
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
memset(opts, 0, sizeof(struct fuse_cmdline_opts));
|
2019-11-28 15:22:49 +03:00
|
|
|
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
opts->max_idle_threads = 10;
|
2019-11-28 15:22:49 +03:00
|
|
|
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
if (fuse_opt_parse(args, opts, fuse_helper_opts, fuse_helper_opt_proc) ==
|
|
|
|
-1) {
|
|
|
|
return -1;
|
|
|
|
}
|
2019-11-28 15:22:49 +03:00
|
|
|
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
return 0;
|
2019-11-28 15:22:49 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int fuse_daemonize(int foreground)
|
|
|
|
{
|
2019-02-08 19:05:24 +03:00
|
|
|
int ret = 0, rett;
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
if (!foreground) {
|
|
|
|
int nullfd;
|
|
|
|
int waiter[2];
|
|
|
|
char completed;
|
|
|
|
|
|
|
|
if (pipe(waiter)) {
|
|
|
|
perror("fuse_daemonize: pipe");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* demonize current process by forking it and killing the
|
|
|
|
* parent. This makes current process as a child of 'init'.
|
|
|
|
*/
|
|
|
|
switch (fork()) {
|
|
|
|
case -1:
|
|
|
|
perror("fuse_daemonize: fork");
|
|
|
|
return -1;
|
|
|
|
case 0:
|
|
|
|
break;
|
|
|
|
default:
|
2019-02-08 19:05:24 +03:00
|
|
|
_exit(read(waiter[0], &completed,
|
|
|
|
sizeof(completed) != sizeof(completed)));
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (setsid() == -1) {
|
|
|
|
perror("fuse_daemonize: setsid");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2019-02-08 19:05:24 +03:00
|
|
|
ret = chdir("/");
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
|
|
|
|
nullfd = open("/dev/null", O_RDWR, 0);
|
|
|
|
if (nullfd != -1) {
|
2019-02-08 19:05:24 +03:00
|
|
|
rett = dup2(nullfd, 0);
|
|
|
|
if (!ret) {
|
|
|
|
ret = rett;
|
|
|
|
}
|
|
|
|
rett = dup2(nullfd, 1);
|
|
|
|
if (!ret) {
|
|
|
|
ret = rett;
|
|
|
|
}
|
|
|
|
rett = dup2(nullfd, 2);
|
|
|
|
if (!ret) {
|
|
|
|
ret = rett;
|
|
|
|
}
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
if (nullfd > 2) {
|
|
|
|
close(nullfd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Propagate completion of daemon initialization */
|
|
|
|
completed = 1;
|
2019-02-08 19:05:24 +03:00
|
|
|
rett = write(waiter[1], &completed, sizeof(completed));
|
|
|
|
if (!ret) {
|
|
|
|
ret = rett;
|
|
|
|
}
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
close(waiter[0]);
|
|
|
|
close(waiter[1]);
|
|
|
|
} else {
|
2019-02-08 19:05:24 +03:00
|
|
|
ret = chdir("/");
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
}
|
2019-02-08 19:05:24 +03:00
|
|
|
return ret;
|
2019-11-28 15:22:49 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void fuse_apply_conn_info_opts(struct fuse_conn_info_opts *opts,
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
struct fuse_conn_info *conn)
|
2019-11-28 15:22:49 +03:00
|
|
|
{
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
if (opts->set_max_write) {
|
|
|
|
conn->max_write = opts->max_write;
|
|
|
|
}
|
|
|
|
if (opts->set_max_background) {
|
|
|
|
conn->max_background = opts->max_background;
|
|
|
|
}
|
|
|
|
if (opts->set_congestion_threshold) {
|
|
|
|
conn->congestion_threshold = opts->congestion_threshold;
|
|
|
|
}
|
|
|
|
if (opts->set_time_gran) {
|
|
|
|
conn->time_gran = opts->time_gran;
|
|
|
|
}
|
|
|
|
if (opts->set_max_readahead) {
|
|
|
|
conn->max_readahead = opts->max_readahead;
|
|
|
|
}
|
|
|
|
|
|
|
|
#define LL_ENABLE(cond, cap) \
|
|
|
|
if (cond) \
|
|
|
|
conn->want |= (cap)
|
|
|
|
#define LL_DISABLE(cond, cap) \
|
|
|
|
if (cond) \
|
|
|
|
conn->want &= ~(cap)
|
|
|
|
|
|
|
|
LL_ENABLE(opts->splice_read, FUSE_CAP_SPLICE_READ);
|
|
|
|
LL_DISABLE(opts->no_splice_read, FUSE_CAP_SPLICE_READ);
|
|
|
|
|
|
|
|
LL_ENABLE(opts->splice_write, FUSE_CAP_SPLICE_WRITE);
|
|
|
|
LL_DISABLE(opts->no_splice_write, FUSE_CAP_SPLICE_WRITE);
|
|
|
|
|
|
|
|
LL_ENABLE(opts->splice_move, FUSE_CAP_SPLICE_MOVE);
|
|
|
|
LL_DISABLE(opts->no_splice_move, FUSE_CAP_SPLICE_MOVE);
|
|
|
|
|
|
|
|
LL_ENABLE(opts->auto_inval_data, FUSE_CAP_AUTO_INVAL_DATA);
|
|
|
|
LL_DISABLE(opts->no_auto_inval_data, FUSE_CAP_AUTO_INVAL_DATA);
|
|
|
|
|
|
|
|
LL_DISABLE(opts->no_readdirplus, FUSE_CAP_READDIRPLUS);
|
|
|
|
LL_DISABLE(opts->no_readdirplus_auto, FUSE_CAP_READDIRPLUS_AUTO);
|
|
|
|
|
|
|
|
LL_ENABLE(opts->async_dio, FUSE_CAP_ASYNC_DIO);
|
|
|
|
LL_DISABLE(opts->no_async_dio, FUSE_CAP_ASYNC_DIO);
|
|
|
|
|
|
|
|
LL_ENABLE(opts->writeback_cache, FUSE_CAP_WRITEBACK_CACHE);
|
|
|
|
LL_DISABLE(opts->no_writeback_cache, FUSE_CAP_WRITEBACK_CACHE);
|
|
|
|
|
|
|
|
LL_ENABLE(opts->async_read, FUSE_CAP_ASYNC_READ);
|
|
|
|
LL_DISABLE(opts->sync_read, FUSE_CAP_ASYNC_READ);
|
|
|
|
|
|
|
|
LL_DISABLE(opts->no_remote_posix_lock, FUSE_CAP_POSIX_LOCKS);
|
|
|
|
LL_DISABLE(opts->no_remote_flock, FUSE_CAP_FLOCK_LOCKS);
|
2019-11-28 15:22:49 +03:00
|
|
|
}
|
|
|
|
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
struct fuse_conn_info_opts *fuse_parse_conn_info_opts(struct fuse_args *args)
|
2019-11-28 15:22:49 +03:00
|
|
|
{
|
virtiofsd: Format imported files to qemu style
Mostly using a set like:
indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file
clang-format -style=file -i -- file
clang-tidy -fix-errors -checks=readability-braces-around-statements file
clang-format -style=file -i -- file
With manual cleanups.
The .clang-format used is below.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterStruct: false
AfterUnion: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [
'CPU_FOREACH',
'CPU_FOREACH_REVERSE',
'CPU_FOREACH_SAFE',
'IOMMU_NOTIFIER_FOREACH',
'QLIST_FOREACH',
'QLIST_FOREACH_ENTRY',
'QLIST_FOREACH_RCU',
'QLIST_FOREACH_SAFE',
'QLIST_FOREACH_SAFE_RCU',
'QSIMPLEQ_FOREACH',
'QSIMPLEQ_FOREACH_SAFE',
'QSLIST_FOREACH',
'QSLIST_FOREACH_SAFE',
'QTAILQ_FOREACH',
'QTAILQ_FOREACH_REVERSE',
'QTAILQ_FOREACH_SAFE',
'QTAILQ_RAW_FOREACH',
'RAMBLOCK_FOREACH'
]
IncludeCategories:
- Regex: '^"qemu/osdep.h'
Priority: -3
- Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/'
Priority: -2
- Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
UseTab: Never
...
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-12-09 22:53:47 +03:00
|
|
|
struct fuse_conn_info_opts *opts;
|
|
|
|
|
|
|
|
opts = calloc(1, sizeof(struct fuse_conn_info_opts));
|
|
|
|
if (opts == NULL) {
|
|
|
|
fuse_log(FUSE_LOG_ERR, "calloc failed\n");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (fuse_opt_parse(args, opts, conn_info_opt_spec, NULL) == -1) {
|
|
|
|
free(opts);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
return opts;
|
2019-11-28 15:22:49 +03:00
|
|
|
}
|