|
Lines 595-630
cleanup:
Link Here
|
| 595 |
return rc; |
595 |
return rc; |
| 596 |
} |
596 |
} |
| 597 |
|
597 |
|
| 598 |
#if HAVE_FUSE |
|
|
| 599 |
static int lxcContainerMountProcFuse(virDomainDefPtr def, |
| 600 |
const char *srcprefix) |
| 601 |
{ |
| 602 |
int ret; |
| 603 |
char *meminfo_path = NULL; |
| 604 |
|
| 605 |
if ((ret = virAsprintf(&meminfo_path, |
| 606 |
"%s/%s/%s/meminfo", |
| 607 |
srcprefix, LXC_STATE_DIR, |
| 608 |
def->name)) < 0) |
| 609 |
return ret; |
| 610 |
|
| 611 |
if ((ret = mount(meminfo_path, "/proc/meminfo", |
| 612 |
NULL, MS_BIND, NULL)) < 0) { |
| 613 |
virReportSystemError(errno, |
| 614 |
_("Failed to mount %s on /proc/meminfo"), |
| 615 |
meminfo_path); |
| 616 |
} |
| 617 |
|
| 618 |
VIR_FREE(meminfo_path); |
| 619 |
return ret; |
| 620 |
} |
| 621 |
#else |
| 622 |
static int lxcContainerMountProcFuse(virDomainDefPtr def ATTRIBUTE_UNUSED, |
| 623 |
const char *srcprefix ATTRIBUTE_UNUSED) |
| 624 |
{ |
| 625 |
return 0; |
| 626 |
} |
| 627 |
#endif |
| 628 |
|
598 |
|
| 629 |
static int lxcContainerMountFSDevPTS(virDomainFSDefPtr root) |
599 |
static int lxcContainerMountFSDevPTS(virDomainFSDefPtr root) |
| 630 |
{ |
600 |
{ |
|
Lines 1584-1593
static int lxcContainerSetupPivotRoot(virDomainDefPtr vmDef,
Link Here
|
| 1584 |
if (lxcContainerMountBasicFS(true, sec_mount_options) < 0) |
1554 |
if (lxcContainerMountBasicFS(true, sec_mount_options) < 0) |
| 1585 |
goto cleanup; |
1555 |
goto cleanup; |
| 1586 |
|
1556 |
|
| 1587 |
/* Mounts /proc/meminfo etc sysinfo */ |
|
|
| 1588 |
if (lxcContainerMountProcFuse(vmDef, "/.oldroot") < 0) |
| 1589 |
goto cleanup; |
| 1590 |
|
| 1591 |
/* Now we can re-mount the cgroups controllers in the |
1557 |
/* Now we can re-mount the cgroups controllers in the |
| 1592 |
* same configuration as before */ |
1558 |
* same configuration as before */ |
| 1593 |
if (lxcContainerMountCGroups(mounts, nmounts, |
1559 |
if (lxcContainerMountCGroups(mounts, nmounts, |
|
Lines 1684-1693
static int lxcContainerSetupExtraMounts(virDomainDefPtr vmDef,
Link Here
|
| 1684 |
if (lxcContainerMountBasicFS(false, sec_mount_options) < 0) |
1650 |
if (lxcContainerMountBasicFS(false, sec_mount_options) < 0) |
| 1685 |
goto cleanup; |
1651 |
goto cleanup; |
| 1686 |
|
1652 |
|
| 1687 |
/* Mounts /proc/meminfo etc sysinfo */ |
|
|
| 1688 |
if (lxcContainerMountProcFuse(vmDef, "/.oldroot") < 0) |
| 1689 |
goto cleanup; |
| 1690 |
|
| 1691 |
/* Now we can re-mount the cgroups controllers in the |
1653 |
/* Now we can re-mount the cgroups controllers in the |
| 1692 |
* same configuration as before */ |
1654 |
* same configuration as before */ |
| 1693 |
if (lxcContainerMountCGroups(mounts, nmounts, |
1655 |
if (lxcContainerMountCGroups(mounts, nmounts, |