mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-04-01 20:05:19 +00:00
conf: fs: fill out accessmode in post-parse
Move the default setting of accessmode to the post-parse phase. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
147f341185
commit
c70fbbbecc
@ -505,6 +505,7 @@ VIR_ENUM_IMPL(virDomainFSDriver,
|
||||
|
||||
VIR_ENUM_IMPL(virDomainFSAccessMode,
|
||||
VIR_DOMAIN_FS_ACCESSMODE_LAST,
|
||||
"",
|
||||
"passthrough",
|
||||
"mapped",
|
||||
"squash",
|
||||
@ -5512,6 +5513,16 @@ virDomainMemoryDefPostParse(virDomainMemoryDef *mem,
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
virDomainFSDefPostParse(virDomainFSDef *fs)
|
||||
{
|
||||
if (fs->accessmode == VIR_DOMAIN_FS_ACCESSMODE_DEFAULT)
|
||||
fs->accessmode = VIR_DOMAIN_FS_ACCESSMODE_PASSTHROUGH;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
virDomainDeviceDefPostParseCommon(virDomainDeviceDef *dev,
|
||||
const virDomainDef *def,
|
||||
@ -5557,8 +5568,11 @@ virDomainDeviceDefPostParseCommon(virDomainDeviceDef *dev,
|
||||
ret = virDomainMemoryDefPostParse(dev->data.memory, def);
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_DEVICE_LEASE:
|
||||
case VIR_DOMAIN_DEVICE_FS:
|
||||
ret = virDomainFSDefPostParse(dev->data.fs);
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_DEVICE_LEASE:
|
||||
case VIR_DOMAIN_DEVICE_NET:
|
||||
case VIR_DOMAIN_DEVICE_INPUT:
|
||||
case VIR_DOMAIN_DEVICE_SOUND:
|
||||
@ -10042,7 +10056,7 @@ virDomainFSDefParseXML(virDomainXMLOption *xmlopt,
|
||||
goto error;
|
||||
}
|
||||
} else {
|
||||
def->accessmode = VIR_DOMAIN_FS_ACCESSMODE_PASSTHROUGH;
|
||||
def->accessmode = VIR_DOMAIN_FS_ACCESSMODE_DEFAULT;
|
||||
}
|
||||
|
||||
fmode = virXMLPropString(node, "fmode");
|
||||
|
@ -804,6 +804,7 @@ typedef enum {
|
||||
|
||||
/* Filesystem mount access mode */
|
||||
typedef enum {
|
||||
VIR_DOMAIN_FS_ACCESSMODE_DEFAULT = 0,
|
||||
VIR_DOMAIN_FS_ACCESSMODE_PASSTHROUGH,
|
||||
VIR_DOMAIN_FS_ACCESSMODE_MAPPED,
|
||||
VIR_DOMAIN_FS_ACCESSMODE_SQUASH,
|
||||
|
Loading…
x
Reference in New Issue
Block a user