mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-24 13:35:17 +00:00
conf: move filesystem target validation
Check the presence of the target in the validation phase. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
fb1289c155
commit
2dabd16588
@ -9896,12 +9896,6 @@ virDomainFSDefParseXML(virDomainXMLOption *xmlopt,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target == NULL && !sock) {
|
|
||||||
virReportError(VIR_ERR_NO_TARGET,
|
|
||||||
source ? "%s" : NULL, source);
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (def->type == VIR_DOMAIN_FS_TYPE_RAM) {
|
if (def->type == VIR_DOMAIN_FS_TYPE_RAM) {
|
||||||
if (!usage) {
|
if (!usage) {
|
||||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||||
|
@ -2036,6 +2036,14 @@ virDomainShmemDefValidate(const virDomainShmemDef *shmem)
|
|||||||
static int
|
static int
|
||||||
virDomainFSDefValidate(const virDomainFSDef *fs)
|
virDomainFSDefValidate(const virDomainFSDef *fs)
|
||||||
{
|
{
|
||||||
|
if (fs->dst == NULL && !fs->sock) {
|
||||||
|
const char *source = fs->src->path;
|
||||||
|
|
||||||
|
virReportError(VIR_ERR_NO_TARGET,
|
||||||
|
source ? "%s" : NULL, source);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (fs->info.bootIndex &&
|
if (fs->info.bootIndex &&
|
||||||
fs->fsdriver != VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIOFS) {
|
fs->fsdriver != VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIOFS) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user