mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 09:53:10 +00:00
conf: Rename virDomainCapsFeature to virDomainProcessCapsFeature
The enum name sounds too generic. It in fact describes the capabilities of the process, thus add 'Process' to the name. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
2ac56edbf8
commit
d95eded4bb
@ -211,8 +211,8 @@ VIR_ENUM_IMPL(virDomainMsrsUnknown,
|
|||||||
"fault",
|
"fault",
|
||||||
);
|
);
|
||||||
|
|
||||||
VIR_ENUM_IMPL(virDomainCapsFeature,
|
VIR_ENUM_IMPL(virDomainProcessCapsFeature,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_LAST,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_LAST,
|
||||||
"audit_control",
|
"audit_control",
|
||||||
"audit_write",
|
"audit_write",
|
||||||
"block_suspend",
|
"block_suspend",
|
||||||
@ -20616,7 +20616,7 @@ virDomainDefParseXML(xmlDocPtr xml,
|
|||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
int val = virDomainCapsFeatureTypeFromString((const char *)nodes[i]->name);
|
int val = virDomainProcessCapsFeatureTypeFromString((const char *)nodes[i]->name);
|
||||||
if (val < 0) {
|
if (val < 0) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("unexpected capability feature '%s'"), nodes[i]->name);
|
_("unexpected capability feature '%s'"), nodes[i]->name);
|
||||||
@ -20627,7 +20627,7 @@ virDomainDefParseXML(xmlDocPtr xml,
|
|||||||
if ((def->caps_features[val] = virTristateSwitchTypeFromString(tmp)) == -1) {
|
if ((def->caps_features[val] = virTristateSwitchTypeFromString(tmp)) == -1) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("unknown state attribute '%s' of feature capability '%s'"),
|
_("unknown state attribute '%s' of feature capability '%s'"),
|
||||||
tmp, virDomainCapsFeatureTypeToString(val));
|
tmp, virDomainProcessCapsFeatureTypeToString(val));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
VIR_FREE(tmp);
|
VIR_FREE(tmp);
|
||||||
@ -28295,10 +28295,10 @@ virDomainDefFormatFeatures(virBufferPtr buf,
|
|||||||
case VIR_DOMAIN_FEATURE_CAPABILITIES:
|
case VIR_DOMAIN_FEATURE_CAPABILITIES:
|
||||||
virBufferSetChildIndent(&tmpChildBuf, &childBuf);
|
virBufferSetChildIndent(&tmpChildBuf, &childBuf);
|
||||||
|
|
||||||
for (j = 0; j < VIR_DOMAIN_CAPS_FEATURE_LAST; j++) {
|
for (j = 0; j < VIR_DOMAIN_PROCES_CAPS_FEATURE_LAST; j++) {
|
||||||
if (def->caps_features[j] != VIR_TRISTATE_SWITCH_ABSENT)
|
if (def->caps_features[j] != VIR_TRISTATE_SWITCH_ABSENT)
|
||||||
virBufferAsprintf(&tmpChildBuf, "<%s state='%s'/>\n",
|
virBufferAsprintf(&tmpChildBuf, "<%s state='%s'/>\n",
|
||||||
virDomainCapsFeatureTypeToString(j),
|
virDomainProcessCapsFeatureTypeToString(j),
|
||||||
virTristateSwitchTypeToString(def->caps_features[j]));
|
virTristateSwitchTypeToString(def->caps_features[j]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1817,45 +1817,45 @@ typedef enum {
|
|||||||
|
|
||||||
/* The capabilities are ordered alphabetically to help check for new ones */
|
/* The capabilities are ordered alphabetically to help check for new ones */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
VIR_DOMAIN_CAPS_FEATURE_AUDIT_CONTROL = 0,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_AUDIT_CONTROL = 0,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_AUDIT_WRITE,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_AUDIT_WRITE,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_BLOCK_SUSPEND,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_BLOCK_SUSPEND,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_CHOWN,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_CHOWN,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_DAC_OVERRIDE,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_DAC_OVERRIDE,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_DAC_READ_SEARCH,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_DAC_READ_SEARCH,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_FOWNER,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_FOWNER,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_FSETID,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_FSETID,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_IPC_LOCK,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_IPC_LOCK,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_IPC_OWNER,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_IPC_OWNER,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_KILL,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_KILL,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_LEASE,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_LEASE,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_LINUX_IMMUTABLE,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_LINUX_IMMUTABLE,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_MAC_ADMIN,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_MAC_ADMIN,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_MAC_OVERRIDE,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_MAC_OVERRIDE,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_MKNOD,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_MKNOD,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_NET_ADMIN,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_NET_ADMIN,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_NET_BIND_SERVICE,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_NET_BIND_SERVICE,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_NET_BROADCAST,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_NET_BROADCAST,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_NET_RAW,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_NET_RAW,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_SETGID,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SETGID,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_SETFCAP,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SETFCAP,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_SETPCAP,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SETPCAP,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_SETUID,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SETUID,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_SYS_ADMIN,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SYS_ADMIN,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_SYS_BOOT,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SYS_BOOT,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_SYS_CHROOT,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SYS_CHROOT,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_SYS_MODULE,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SYS_MODULE,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_SYS_NICE,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SYS_NICE,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_SYS_PACCT,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SYS_PACCT,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_SYS_PTRACE,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SYS_PTRACE,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_SYS_RAWIO,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SYS_RAWIO,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_SYS_RESOURCE,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SYS_RESOURCE,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_SYS_TIME,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SYS_TIME,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_SYS_TTY_CONFIG,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SYS_TTY_CONFIG,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_SYSLOG,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SYSLOG,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_WAKE_ALARM,
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_WAKE_ALARM,
|
||||||
VIR_DOMAIN_CAPS_FEATURE_LAST
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_LAST
|
||||||
} virDomainCapsFeature;
|
} virDomainProcessCapsFeature;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
VIR_DOMAIN_LOCK_FAILURE_DEFAULT,
|
VIR_DOMAIN_LOCK_FAILURE_DEFAULT,
|
||||||
@ -2420,7 +2420,7 @@ struct _virDomainDef {
|
|||||||
* to handle support. A few assign specific data values to the option.
|
* to handle support. A few assign specific data values to the option.
|
||||||
* See virDomainDefFeaturesCheckABIStability() for details. */
|
* See virDomainDefFeaturesCheckABIStability() for details. */
|
||||||
int features[VIR_DOMAIN_FEATURE_LAST];
|
int features[VIR_DOMAIN_FEATURE_LAST];
|
||||||
int caps_features[VIR_DOMAIN_CAPS_FEATURE_LAST];
|
int caps_features[VIR_DOMAIN_PROCES_CAPS_FEATURE_LAST];
|
||||||
int hyperv_features[VIR_DOMAIN_HYPERV_LAST];
|
int hyperv_features[VIR_DOMAIN_HYPERV_LAST];
|
||||||
int kvm_features[VIR_DOMAIN_KVM_LAST];
|
int kvm_features[VIR_DOMAIN_KVM_LAST];
|
||||||
int msrs_features[VIR_DOMAIN_MSRS_LAST];
|
int msrs_features[VIR_DOMAIN_MSRS_LAST];
|
||||||
@ -3394,7 +3394,7 @@ VIR_ENUM_DECL(virDomainVirt);
|
|||||||
VIR_ENUM_DECL(virDomainBoot);
|
VIR_ENUM_DECL(virDomainBoot);
|
||||||
VIR_ENUM_DECL(virDomainFeature);
|
VIR_ENUM_DECL(virDomainFeature);
|
||||||
VIR_ENUM_DECL(virDomainCapabilitiesPolicy);
|
VIR_ENUM_DECL(virDomainCapabilitiesPolicy);
|
||||||
VIR_ENUM_DECL(virDomainCapsFeature);
|
VIR_ENUM_DECL(virDomainProcessCapsFeature);
|
||||||
VIR_ENUM_DECL(virDomainLifecycle);
|
VIR_ENUM_DECL(virDomainLifecycle);
|
||||||
VIR_ENUM_DECL(virDomainLifecycleAction);
|
VIR_ENUM_DECL(virDomainLifecycleAction);
|
||||||
VIR_ENUM_DECL(virDomainDevice);
|
VIR_ENUM_DECL(virDomainDevice);
|
||||||
|
@ -217,7 +217,6 @@ virDomainBlockedReasonTypeToString;
|
|||||||
virDomainBootTypeFromString;
|
virDomainBootTypeFromString;
|
||||||
virDomainBootTypeToString;
|
virDomainBootTypeToString;
|
||||||
virDomainCapabilitiesPolicyTypeToString;
|
virDomainCapabilitiesPolicyTypeToString;
|
||||||
virDomainCapsFeatureTypeToString;
|
|
||||||
virDomainChrConsoleTargetTypeFromString;
|
virDomainChrConsoleTargetTypeFromString;
|
||||||
virDomainChrConsoleTargetTypeToString;
|
virDomainChrConsoleTargetTypeToString;
|
||||||
virDomainChrDefForeach;
|
virDomainChrDefForeach;
|
||||||
@ -543,6 +542,7 @@ virDomainPausedReasonTypeFromString;
|
|||||||
virDomainPausedReasonTypeToString;
|
virDomainPausedReasonTypeToString;
|
||||||
virDomainPMSuspendedReasonTypeFromString;
|
virDomainPMSuspendedReasonTypeFromString;
|
||||||
virDomainPMSuspendedReasonTypeToString;
|
virDomainPMSuspendedReasonTypeToString;
|
||||||
|
virDomainProcessCapsFeatureTypeToString;
|
||||||
virDomainRedirdevBusTypeFromString;
|
virDomainRedirdevBusTypeFromString;
|
||||||
virDomainRedirdevBusTypeToString;
|
virDomainRedirdevBusTypeToString;
|
||||||
virDomainRedirdevDefFind;
|
virDomainRedirdevDefFind;
|
||||||
|
@ -305,7 +305,7 @@ virLXCTeardownHostUSBDeviceCgroup(virUSBDevicePtr dev G_GNUC_UNUSED,
|
|||||||
static int virLXCCgroupSetupDeviceACL(virDomainDefPtr def,
|
static int virLXCCgroupSetupDeviceACL(virDomainDefPtr def,
|
||||||
virCgroupPtr cgroup)
|
virCgroupPtr cgroup)
|
||||||
{
|
{
|
||||||
int capMknod = def->caps_features[VIR_DOMAIN_CAPS_FEATURE_MKNOD];
|
int capMknod = def->caps_features[VIR_DOMAIN_PROCES_CAPS_FEATURE_MKNOD];
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
size_t i;
|
size_t i;
|
||||||
static virLXCCgroupDevicePolicy devices[] = {
|
static virLXCCgroupDevicePolicy devices[] = {
|
||||||
|
@ -1950,7 +1950,7 @@ static int lxcContainerDropCapabilities(virDomainDefPtr def,
|
|||||||
size_t i;
|
size_t i;
|
||||||
int policy = def->features[VIR_DOMAIN_FEATURE_CAPABILITIES];
|
int policy = def->features[VIR_DOMAIN_FEATURE_CAPABILITIES];
|
||||||
|
|
||||||
/* Maps virDomainCapsFeature to CAPS_* */
|
/* Maps virDomainProcessCapsFeature to CAPS_* */
|
||||||
static int capsMapping[] = {CAP_AUDIT_CONTROL,
|
static int capsMapping[] = {CAP_AUDIT_CONTROL,
|
||||||
CAP_AUDIT_WRITE,
|
CAP_AUDIT_WRITE,
|
||||||
CAP_BLOCK_SUSPEND,
|
CAP_BLOCK_SUSPEND,
|
||||||
@ -1996,7 +1996,7 @@ static int lxcContainerDropCapabilities(virDomainDefPtr def,
|
|||||||
capng_clear(CAPNG_SELECT_BOTH);
|
capng_clear(CAPNG_SELECT_BOTH);
|
||||||
|
|
||||||
/* Apply all single capabilities changes */
|
/* Apply all single capabilities changes */
|
||||||
for (i = 0; i < VIR_DOMAIN_CAPS_FEATURE_LAST; i++) {
|
for (i = 0; i < VIR_DOMAIN_PROCES_CAPS_FEATURE_LAST; i++) {
|
||||||
bool toDrop = false;
|
bool toDrop = false;
|
||||||
int state = def->caps_features[i];
|
int state = def->caps_features[i];
|
||||||
|
|
||||||
@ -2013,21 +2013,21 @@ static int lxcContainerDropCapabilities(virDomainDefPtr def,
|
|||||||
capsMapping[i])) < 0) {
|
capsMapping[i])) < 0) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Failed to add capability %s: %d"),
|
_("Failed to add capability %s: %d"),
|
||||||
virDomainCapsFeatureTypeToString(i), ret);
|
virDomainProcessCapsFeatureTypeToString(i), ret);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_CAPABILITIES_POLICY_DEFAULT:
|
case VIR_DOMAIN_CAPABILITIES_POLICY_DEFAULT:
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case VIR_DOMAIN_CAPS_FEATURE_SYS_BOOT: /* No use of reboot */
|
case VIR_DOMAIN_PROCES_CAPS_FEATURE_SYS_BOOT: /* No use of reboot */
|
||||||
toDrop = !keepReboot && (state != VIR_TRISTATE_SWITCH_ON);
|
toDrop = !keepReboot && (state != VIR_TRISTATE_SWITCH_ON);
|
||||||
break;
|
break;
|
||||||
case VIR_DOMAIN_CAPS_FEATURE_SYS_MODULE: /* No kernel module loading */
|
case VIR_DOMAIN_PROCES_CAPS_FEATURE_SYS_MODULE: /* No kernel module loading */
|
||||||
case VIR_DOMAIN_CAPS_FEATURE_SYS_TIME: /* No changing the clock */
|
case VIR_DOMAIN_PROCES_CAPS_FEATURE_SYS_TIME: /* No changing the clock */
|
||||||
case VIR_DOMAIN_CAPS_FEATURE_MKNOD: /* No creating device nodes */
|
case VIR_DOMAIN_PROCES_CAPS_FEATURE_MKNOD: /* No creating device nodes */
|
||||||
case VIR_DOMAIN_CAPS_FEATURE_AUDIT_CONTROL: /* No messing with auditing status */
|
case VIR_DOMAIN_PROCES_CAPS_FEATURE_AUDIT_CONTROL: /* No messing with auditing status */
|
||||||
case VIR_DOMAIN_CAPS_FEATURE_MAC_ADMIN: /* No messing with LSM config */
|
case VIR_DOMAIN_PROCES_CAPS_FEATURE_MAC_ADMIN: /* No messing with LSM config */
|
||||||
toDrop = (state != VIR_TRISTATE_SWITCH_ON);
|
toDrop = (state != VIR_TRISTATE_SWITCH_ON);
|
||||||
break;
|
break;
|
||||||
default: /* User specified capabilities to drop */
|
default: /* User specified capabilities to drop */
|
||||||
@ -2045,7 +2045,7 @@ static int lxcContainerDropCapabilities(virDomainDefPtr def,
|
|||||||
capsMapping[i])) < 0) {
|
capsMapping[i])) < 0) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Failed to remove capability %s: %d"),
|
_("Failed to remove capability %s: %d"),
|
||||||
virDomainCapsFeatureTypeToString(i), ret);
|
virDomainProcessCapsFeatureTypeToString(i), ret);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1043,8 +1043,8 @@ lxcSetCapDrop(virDomainDefPtr def, virConfPtr properties)
|
|||||||
if (virConfGetValueString(properties, "lxc.cap.drop", &value) > 0)
|
if (virConfGetValueString(properties, "lxc.cap.drop", &value) > 0)
|
||||||
toDrop = virStringSplit(value, " ", 0);
|
toDrop = virStringSplit(value, " ", 0);
|
||||||
|
|
||||||
for (i = 0; i < VIR_DOMAIN_CAPS_FEATURE_LAST; i++) {
|
for (i = 0; i < VIR_DOMAIN_PROCES_CAPS_FEATURE_LAST; i++) {
|
||||||
capString = virDomainCapsFeatureTypeToString(i);
|
capString = virDomainProcessCapsFeatureTypeToString(i);
|
||||||
if (toDrop != NULL &&
|
if (toDrop != NULL &&
|
||||||
virStringListHasString((const char **)toDrop, capString))
|
virStringListHasString((const char **)toDrop, capString))
|
||||||
def->caps_features[i] = VIR_TRISTATE_SWITCH_OFF;
|
def->caps_features[i] = VIR_TRISTATE_SWITCH_OFF;
|
||||||
|
Loading…
Reference in New Issue
Block a user