<acpi/>
<apic/>
<hap/>
+ <privnet/>
</features>
...</pre>
<dd>Enable Viridian hypervisor extensions for paravirtualizing
guest operating systems
</dd>
+ <dt><code>privnet</code></dt>
+ <dd>Always create a private network namespace. This is
+ automatically set if any interface devices are defined.
+ This feature is only relevant for container based
+ virtualization drivers, such as LXC.
+ </dd>
</dl>
<h3><a name="elementsTime">Time keeping</a></h3>
*
* Returns 0 on success or nonzero in case of error
*/
-static int lxcContainerRenameAndEnableInterfaces(unsigned int nveths,
+static int lxcContainerRenameAndEnableInterfaces(bool privNet,
+ unsigned int nveths,
char **veths)
{
int rc = 0;
}
/* enable lo device only if there were other net devices */
- if (veths)
+ if (veths || privNet)
rc = virNetDevSetOnline("lo", true);
error_out:
VIR_DEBUG("Received container continue message");
/* rename and enable interfaces */
- if (lxcContainerRenameAndEnableInterfaces(argv->nveths,
+ if (lxcContainerRenameAndEnableInterfaces(!!(vmDef->features &
+ (1 << VIR_DOMAIN_FEATURE_PRIVNET)),
+ argv->nveths,
argv->veths) < 0) {
goto cleanup;
}
cflags |= CLONE_NEWUSER;
}
- if (def->nets != NULL) {
+ if (def->nets != NULL ||
+ (def->features & (1 << VIR_DOMAIN_FEATURE_PRIVNET))) {
VIR_DEBUG("Enable network namespaces");
cflags |= CLONE_NEWNET;
}