Introduce virDomainChrSourceDefNew for virDomainChrDefPtr

Change the virDomainChrDef to use a pointer to 'source' and allocate
that pointer during virDomainChrDefNew.

This has tremendous "fallout" in the rest of the code which mainly
has to change source.$field to source->$field.

Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
John Ferlan
2016-10-21 07:45:54 -04:00
parent 931864a3ea
commit 77a12987a4
31 changed files with 344 additions and 326 deletions

View File

@@ -202,17 +202,17 @@ testSELinuxLoadDef(const char *testname)
}
for (i = 0; i < def->nserials; i++) {
if (def->serials[i]->source.type != VIR_DOMAIN_CHR_TYPE_FILE &&
def->serials[i]->source.type != VIR_DOMAIN_CHR_TYPE_PIPE &&
def->serials[i]->source.type != VIR_DOMAIN_CHR_TYPE_DEV &&
def->serials[i]->source.type != VIR_DOMAIN_CHR_TYPE_UNIX)
if (def->serials[i]->source->type != VIR_DOMAIN_CHR_TYPE_FILE &&
def->serials[i]->source->type != VIR_DOMAIN_CHR_TYPE_PIPE &&
def->serials[i]->source->type != VIR_DOMAIN_CHR_TYPE_DEV &&
def->serials[i]->source->type != VIR_DOMAIN_CHR_TYPE_UNIX)
continue;
if (def->serials[i]->source.type == VIR_DOMAIN_CHR_TYPE_UNIX) {
if (testSELinuxMungePath(&def->serials[i]->source.data.nix.path) < 0)
if (def->serials[i]->source->type == VIR_DOMAIN_CHR_TYPE_UNIX) {
if (testSELinuxMungePath(&def->serials[i]->source->data.nix.path) < 0)
goto cleanup;
} else {
if (testSELinuxMungePath(&def->serials[i]->source.data.file.path) < 0)
if (testSELinuxMungePath(&def->serials[i]->source->data.file.path) < 0)
goto cleanup;
}
}