mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
lxc: replace VIR_ALLOC/REALLOC with g_new0/renew
Reviewed-by: Laine Stump <laine@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
9bcd47cd7b
commit
edea0d9894
@ -27,7 +27,6 @@
|
|||||||
#include "virfile.h"
|
#include "virfile.h"
|
||||||
#include "virerror.h"
|
#include "virerror.h"
|
||||||
#include "virlog.h"
|
#include "virlog.h"
|
||||||
#include "viralloc.h"
|
|
||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
#include "virsystemd.h"
|
#include "virsystemd.h"
|
||||||
#include "virutil.h"
|
#include "virutil.h"
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
#include "lxc_domain.h"
|
#include "lxc_domain.h"
|
||||||
#include "virerror.h"
|
#include "virerror.h"
|
||||||
#include "virconf.h"
|
#include "virconf.h"
|
||||||
#include "viralloc.h"
|
|
||||||
#include "virlog.h"
|
#include "virlog.h"
|
||||||
#include "viruuid.h"
|
#include "viruuid.h"
|
||||||
#include "configmake.h"
|
#include "configmake.h"
|
||||||
@ -145,8 +144,7 @@ virCapsPtr virLXCDriverCapsInit(virLXCDriverPtr driver)
|
|||||||
VIR_DOMAIN_VIRT_LXC);
|
VIR_DOMAIN_VIRT_LXC);
|
||||||
type = virDomainVirtTypeToString(VIR_DOMAIN_VIRT_LXC);
|
type = virDomainVirtTypeToString(VIR_DOMAIN_VIRT_LXC);
|
||||||
/* Allocate the primary security driver for LXC. */
|
/* Allocate the primary security driver for LXC. */
|
||||||
if (VIR_ALLOC(caps->host.secModels) < 0)
|
caps->host.secModels = g_new0(virCapsHostSecModel, 1);
|
||||||
goto error;
|
|
||||||
caps->host.nsecModels = 1;
|
caps->host.nsecModels = 1;
|
||||||
caps->host.secModels[0].model = g_strdup(model);
|
caps->host.secModels[0].model = g_strdup(model);
|
||||||
caps->host.secModels[0].doi = g_strdup(doi);
|
caps->host.secModels[0].doi = g_strdup(doi);
|
||||||
|
@ -156,8 +156,7 @@ int lxcContainerHasReboot(void)
|
|||||||
}
|
}
|
||||||
cmd = v ? LINUX_REBOOT_CMD_CAD_ON : LINUX_REBOOT_CMD_CAD_OFF;
|
cmd = v ? LINUX_REBOOT_CMD_CAD_ON : LINUX_REBOOT_CMD_CAD_OFF;
|
||||||
|
|
||||||
if (VIR_ALLOC_N(stack, stacksize) < 0)
|
stack = g_new0(char, stacksize);
|
||||||
return -1;
|
|
||||||
|
|
||||||
childStack = stack + stacksize;
|
childStack = stack + stacksize;
|
||||||
|
|
||||||
@ -2322,8 +2321,7 @@ int lxcContainerStart(virDomainDefPtr def,
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* allocate a stack for the container */
|
/* allocate a stack for the container */
|
||||||
if (VIR_ALLOC_N(stack, stacksize) < 0)
|
stack = g_new0(char, stacksize);
|
||||||
return -1;
|
|
||||||
|
|
||||||
stacktop = stack + stacksize;
|
stacktop = stack + stacksize;
|
||||||
|
|
||||||
|
@ -189,13 +189,10 @@ virLXCControllerDriverFree(virLXCDriverPtr driver)
|
|||||||
|
|
||||||
static virLXCControllerPtr virLXCControllerNew(const char *name)
|
static virLXCControllerPtr virLXCControllerNew(const char *name)
|
||||||
{
|
{
|
||||||
virLXCControllerPtr ctrl = NULL;
|
virLXCControllerPtr ctrl = g_new0(virLXCController, 1);
|
||||||
virLXCDriverPtr driver = NULL;
|
virLXCDriverPtr driver = NULL;
|
||||||
g_autofree char *configFile = NULL;
|
g_autofree char *configFile = NULL;
|
||||||
|
|
||||||
if (VIR_ALLOC(ctrl) < 0)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
ctrl->timerShutdown = -1;
|
ctrl->timerShutdown = -1;
|
||||||
ctrl->firstClient = true;
|
ctrl->firstClient = true;
|
||||||
|
|
||||||
@ -2333,12 +2330,9 @@ virLXCControllerRun(virLXCControllerPtr ctrl)
|
|||||||
int rc = -1;
|
int rc = -1;
|
||||||
int control[2] = { -1, -1};
|
int control[2] = { -1, -1};
|
||||||
int containerhandshake[2] = { -1, -1 };
|
int containerhandshake[2] = { -1, -1 };
|
||||||
char **containerTTYPaths = NULL;
|
char **containerTTYPaths = g_new0(char *, ctrl->nconsoles);
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
if (VIR_ALLOC_N(containerTTYPaths, ctrl->nconsoles) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
if (socketpair(PF_UNIX, SOCK_STREAM, 0, control) < 0) {
|
if (socketpair(PF_UNIX, SOCK_STREAM, 0, control) < 0) {
|
||||||
virReportSystemError(errno, "%s",
|
virReportSystemError(errno, "%s",
|
||||||
_("sockpair failed"));
|
_("sockpair failed"));
|
||||||
@ -2530,14 +2524,12 @@ int main(int argc, char *argv[])
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'v':
|
case 'v':
|
||||||
if (VIR_REALLOC_N(veths, nveths+1) < 0)
|
veths = g_renew(char *, veths, nveths+1);
|
||||||
goto cleanup;
|
|
||||||
veths[nveths++] = g_strdup(optarg);
|
veths[nveths++] = g_strdup(optarg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'c':
|
case 'c':
|
||||||
if (VIR_REALLOC_N(ttyFDs, nttyFDs + 1) < 0)
|
ttyFDs = g_renew(int, ttyFDs, nttyFDs + 1);
|
||||||
goto cleanup;
|
|
||||||
if (virStrToLong_i(optarg, NULL, 10, &ttyFDs[nttyFDs++]) < 0) {
|
if (virStrToLong_i(optarg, NULL, 10, &ttyFDs[nttyFDs++]) < 0) {
|
||||||
fprintf(stderr, "malformed --console argument '%s'", optarg);
|
fprintf(stderr, "malformed --console argument '%s'", optarg);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -2545,8 +2537,7 @@ int main(int argc, char *argv[])
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'p':
|
case 'p':
|
||||||
if (VIR_REALLOC_N(passFDs, npassFDs + 1) < 0)
|
passFDs = g_renew(int, passFDs, npassFDs + 1);
|
||||||
goto cleanup;
|
|
||||||
if (virStrToLong_i(optarg, NULL, 10, &passFDs[npassFDs++]) < 0) {
|
if (virStrToLong_i(optarg, NULL, 10, &passFDs[npassFDs++]) < 0) {
|
||||||
fprintf(stderr, "malformed --passfd argument '%s'", optarg);
|
fprintf(stderr, "malformed --passfd argument '%s'", optarg);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -2661,8 +2652,7 @@ int main(int argc, char *argv[])
|
|||||||
if (ns_fd[i] != -1) {
|
if (ns_fd[i] != -1) {
|
||||||
if (!ctrl->nsFDs) {/*allocate only once */
|
if (!ctrl->nsFDs) {/*allocate only once */
|
||||||
size_t j = 0;
|
size_t j = 0;
|
||||||
if (VIR_ALLOC_N(ctrl->nsFDs, VIR_LXC_DOMAIN_NAMESPACE_LAST) < 0)
|
ctrl->nsFDs = g_new0(int, VIR_LXC_DOMAIN_NAMESPACE_LAST);
|
||||||
goto cleanup;
|
|
||||||
for (j = 0; j < VIR_LXC_DOMAIN_NAMESPACE_LAST; j++)
|
for (j = 0; j < VIR_LXC_DOMAIN_NAMESPACE_LAST; j++)
|
||||||
ctrl->nsFDs[j] = -1;
|
ctrl->nsFDs[j] = -1;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
|
|
||||||
#include "lxc_domain.h"
|
#include "lxc_domain.h"
|
||||||
|
|
||||||
#include "viralloc.h"
|
|
||||||
#include "virlog.h"
|
#include "virlog.h"
|
||||||
#include "virerror.h"
|
#include "virerror.h"
|
||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
@ -153,10 +152,7 @@ virLXCDomainObjEndJob(virLXCDriverPtr driver G_GNUC_UNUSED,
|
|||||||
static void *
|
static void *
|
||||||
virLXCDomainObjPrivateAlloc(void *opaque G_GNUC_UNUSED)
|
virLXCDomainObjPrivateAlloc(void *opaque G_GNUC_UNUSED)
|
||||||
{
|
{
|
||||||
virLXCDomainObjPrivatePtr priv;
|
virLXCDomainObjPrivatePtr priv = g_new0(virLXCDomainObjPrivate, 1);
|
||||||
|
|
||||||
if (VIR_ALLOC(priv) < 0)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
if (virLXCDomainObjInitJob(priv) < 0) {
|
if (virLXCDomainObjInitJob(priv) < 0) {
|
||||||
g_free(priv);
|
g_free(priv);
|
||||||
@ -208,7 +204,7 @@ static int
|
|||||||
lxcDomainDefNamespaceParse(xmlXPathContextPtr ctxt,
|
lxcDomainDefNamespaceParse(xmlXPathContextPtr ctxt,
|
||||||
void **data)
|
void **data)
|
||||||
{
|
{
|
||||||
lxcDomainDefPtr lxcDef = NULL;
|
lxcDomainDefPtr lxcDef = g_new0(lxcDomainDef, 1);
|
||||||
g_autofree xmlNodePtr *nodes = NULL;
|
g_autofree xmlNodePtr *nodes = NULL;
|
||||||
bool uses_lxc_ns = false;
|
bool uses_lxc_ns = false;
|
||||||
xmlNodePtr node;
|
xmlNodePtr node;
|
||||||
@ -216,9 +212,6 @@ lxcDomainDefNamespaceParse(xmlXPathContextPtr ctxt,
|
|||||||
int n;
|
int n;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
if (VIR_ALLOC(lxcDef) < 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
node = ctxt->node;
|
node = ctxt->node;
|
||||||
if ((n = virXPathNodeSet("./lxc:namespace/*", ctxt, &nodes)) < 0)
|
if ((n = virXPathNodeSet("./lxc:namespace/*", ctxt, &nodes)) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
@ -470,9 +463,8 @@ virLXCDomainSetRunlevel(virDomainObjPtr vm,
|
|||||||
for (nfifos = 0; virInitctlFifos[nfifos]; nfifos++)
|
for (nfifos = 0; virInitctlFifos[nfifos]; nfifos++)
|
||||||
;
|
;
|
||||||
|
|
||||||
if (VIR_ALLOC_N(data.st, nfifos) < 0 ||
|
data.st = g_new0(struct stat, nfifos);
|
||||||
VIR_ALLOC_N(data.st_valid, nfifos) < 0)
|
data.st_valid = g_new0(bool, nfifos);
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
for (i = 0; virInitctlFifos[i]; i++) {
|
for (i = 0; virInitctlFifos[i]; i++) {
|
||||||
const char *fifo = virInitctlFifos[i];
|
const char *fifo = virInitctlFifos[i];
|
||||||
|
@ -44,7 +44,6 @@
|
|||||||
#include "lxc_driver.h"
|
#include "lxc_driver.h"
|
||||||
#include "lxc_native.h"
|
#include "lxc_native.h"
|
||||||
#include "lxc_process.h"
|
#include "lxc_process.h"
|
||||||
#include "viralloc.h"
|
|
||||||
#include "virnetdevbridge.h"
|
#include "virnetdevbridge.h"
|
||||||
#include "virnetdevveth.h"
|
#include "virnetdevveth.h"
|
||||||
#include "virnetdevopenvswitch.h"
|
#include "virnetdevopenvswitch.h"
|
||||||
@ -1492,8 +1491,7 @@ static int lxcStateInitialize(bool privileged,
|
|||||||
return VIR_DRV_STATE_INIT_SKIPPED;
|
return VIR_DRV_STATE_INIT_SKIPPED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VIR_ALLOC(lxc_driver) < 0)
|
lxc_driver = g_new0(virLXCDriver, 1);
|
||||||
return VIR_DRV_STATE_INIT_ERROR;
|
|
||||||
lxc_driver->lockFD = -1;
|
lxc_driver->lockFD = -1;
|
||||||
if (virMutexInit(&lxc_driver->lock) < 0) {
|
if (virMutexInit(&lxc_driver->lock) < 0) {
|
||||||
g_free(lxc_driver);
|
g_free(lxc_driver);
|
||||||
@ -3398,8 +3396,9 @@ lxcDomainAttachDeviceDiskLive(virLXCDriverPtr driver,
|
|||||||
perms) < 0)
|
perms) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (VIR_REALLOC_N(vm->def->disks, vm->def->ndisks + 1) < 0)
|
vm->def->disks = g_renew(virDomainDiskDefPtr,
|
||||||
goto cleanup;
|
vm->def->disks,
|
||||||
|
vm->def->ndisks + 1);
|
||||||
|
|
||||||
file = g_strdup_printf("/dev/%s", def->dst);
|
file = g_strdup_printf("/dev/%s", def->dst);
|
||||||
|
|
||||||
@ -3451,8 +3450,9 @@ lxcDomainAttachDeviceNetLive(virLXCDriverPtr driver,
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* preallocate new slot for device */
|
/* preallocate new slot for device */
|
||||||
if (VIR_REALLOC_N(vm->def->nets, vm->def->nnets+1) < 0)
|
vm->def->nets = g_renew(virDomainNetDefPtr,
|
||||||
return -1;
|
vm->def->nets,
|
||||||
|
vm->def->nnets + 1);
|
||||||
|
|
||||||
/* If appropriate, grab a physical device from the configured
|
/* If appropriate, grab a physical device from the configured
|
||||||
* network's pool of devices, or resolve bridge device name
|
* network's pool of devices, or resolve bridge device name
|
||||||
@ -3606,8 +3606,9 @@ lxcDomainAttachDeviceHostdevSubsysUSBLive(virLXCDriverPtr driver,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VIR_REALLOC_N(vm->def->hostdevs, vm->def->nhostdevs + 1) < 0)
|
vm->def->hostdevs = g_renew(virDomainHostdevDefPtr,
|
||||||
goto cleanup;
|
vm->def->hostdevs,
|
||||||
|
vm->def->nhostdevs + 1);
|
||||||
|
|
||||||
if (virUSBDeviceFileIterate(usb,
|
if (virUSBDeviceFileIterate(usb,
|
||||||
virLXCSetupHostUSBDeviceCgroup,
|
virLXCSetupHostUSBDeviceCgroup,
|
||||||
@ -3675,8 +3676,9 @@ lxcDomainAttachDeviceHostdevStorageLive(virLXCDriverPtr driver,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VIR_REALLOC_N(vm->def->hostdevs, vm->def->nhostdevs+1) < 0)
|
vm->def->hostdevs = g_renew(virDomainHostdevDefPtr,
|
||||||
goto cleanup;
|
vm->def->hostdevs,
|
||||||
|
vm->def->nhostdevs + 1);
|
||||||
|
|
||||||
if (virCgroupAllowDevice(priv->cgroup,
|
if (virCgroupAllowDevice(priv->cgroup,
|
||||||
'b',
|
'b',
|
||||||
@ -3754,8 +3756,9 @@ lxcDomainAttachDeviceHostdevMiscLive(virLXCDriverPtr driver,
|
|||||||
VIR_CGROUP_DEVICE_RWM) < 0)
|
VIR_CGROUP_DEVICE_RWM) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (VIR_REALLOC_N(vm->def->hostdevs, vm->def->nhostdevs+1) < 0)
|
vm->def->hostdevs = g_renew(virDomainHostdevDefPtr,
|
||||||
goto cleanup;
|
vm->def->hostdevs,
|
||||||
|
vm->def->nhostdevs + 1);
|
||||||
|
|
||||||
if (lxcDomainAttachDeviceMknod(driver,
|
if (lxcDomainAttachDeviceMknod(driver,
|
||||||
0700 | S_IFBLK,
|
0700 | S_IFBLK,
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
#include "virfile.h"
|
#include "virfile.h"
|
||||||
#include "virbuffer.h"
|
#include "virbuffer.h"
|
||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
#include "viralloc.h"
|
|
||||||
#include "virutil.h"
|
#include "virutil.h"
|
||||||
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_LXC
|
#define VIR_FROM_THIS VIR_FROM_LXC
|
||||||
@ -284,10 +283,7 @@ int lxcSetupFuse(virLXCFusePtr *f, virDomainDefPtr def)
|
|||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
struct fuse_args args = FUSE_ARGS_INIT(0, NULL);
|
struct fuse_args args = FUSE_ARGS_INIT(0, NULL);
|
||||||
virLXCFusePtr fuse = NULL;
|
virLXCFusePtr fuse = g_new0(virLXCFuse, 1);
|
||||||
|
|
||||||
if (VIR_ALLOC(fuse) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
fuse->def = def;
|
fuse->def = def;
|
||||||
|
|
||||||
|
@ -50,6 +50,7 @@ struct virLXCFuse {
|
|||||||
struct fuse_chan *ch;
|
struct fuse_chan *ch;
|
||||||
virMutex lock;
|
virMutex lock;
|
||||||
};
|
};
|
||||||
|
typedef struct virLXCFuse virLXCFuse;
|
||||||
typedef struct virLXCFuse *virLXCFusePtr;
|
typedef struct virLXCFuse *virLXCFusePtr;
|
||||||
|
|
||||||
int lxcSetupFuse(virLXCFusePtr *f, virDomainDefPtr def);
|
int lxcSetupFuse(virLXCFusePtr *f, virDomainDefPtr def);
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
#include "lxc_hostdev.h"
|
#include "lxc_hostdev.h"
|
||||||
#include "viralloc.h"
|
|
||||||
#include "virlog.h"
|
#include "virlog.h"
|
||||||
#include "virerror.h"
|
#include "virerror.h"
|
||||||
#include "virhostdev.h"
|
#include "virhostdev.h"
|
||||||
|
@ -24,8 +24,6 @@
|
|||||||
#include "lxc_conf.h"
|
#include "lxc_conf.h"
|
||||||
#include "lxc_monitor_dispatch.h"
|
#include "lxc_monitor_dispatch.h"
|
||||||
|
|
||||||
#include "viralloc.h"
|
|
||||||
|
|
||||||
#include "virerror.h"
|
#include "virerror.h"
|
||||||
#include "virlog.h"
|
#include "virlog.h"
|
||||||
#include "virthread.h"
|
#include "virthread.h"
|
||||||
|
@ -151,9 +151,10 @@ lxcParseFstabLine(char *fstabLine)
|
|||||||
lxcFstabPtr fstab = NULL;
|
lxcFstabPtr fstab = NULL;
|
||||||
char **parts;
|
char **parts;
|
||||||
|
|
||||||
if (!fstabLine || VIR_ALLOC(fstab) < 0)
|
if (!fstabLine)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
fstab = g_new0(lxcFstab, 1);
|
||||||
if (!(parts = lxcStringSplit(fstabLine)))
|
if (!(parts = lxcStringSplit(fstabLine)))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
@ -561,10 +562,7 @@ lxcNetworkParseDataIPs(const char *name,
|
|||||||
{
|
{
|
||||||
int family = AF_INET;
|
int family = AF_INET;
|
||||||
char **ipparts = NULL;
|
char **ipparts = NULL;
|
||||||
g_autofree virNetDevIPAddrPtr ip = NULL;
|
g_autofree virNetDevIPAddrPtr ip = g_new0(virNetDevIPAddr, 1);
|
||||||
|
|
||||||
if (VIR_ALLOC(ip) < 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (STREQ(name, "ipv6") || STREQ(name, "ipv6.address"))
|
if (STREQ(name, "ipv6") || STREQ(name, "ipv6.address"))
|
||||||
family = AF_INET6;
|
family = AF_INET6;
|
||||||
@ -820,8 +818,7 @@ lxcCreateConsoles(virDomainDefPtr def, virConfPtr properties)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VIR_ALLOC_N(def->consoles, nbttys) < 0)
|
def->consoles = g_new0(virDomainChrDefPtr, nbttys);
|
||||||
return -1;
|
|
||||||
|
|
||||||
def->nconsoles = nbttys;
|
def->nconsoles = nbttys;
|
||||||
for (i = 0; i < nbttys; i++) {
|
for (i = 0; i < nbttys; i++) {
|
||||||
|
@ -550,8 +550,7 @@ virLXCProcessSetupInterfaces(virLXCDriverPtr driver,
|
|||||||
virConnectPtr netconn = NULL;
|
virConnectPtr netconn = NULL;
|
||||||
virErrorPtr save_err = NULL;
|
virErrorPtr save_err = NULL;
|
||||||
|
|
||||||
if (VIR_ALLOC_N(*veths, def->nnets + 1) < 0)
|
*veths = g_new0(char *, def->nnets + 1);
|
||||||
return -1;
|
|
||||||
|
|
||||||
for (i = 0; i < def->nnets; i++) {
|
for (i = 0; i < def->nnets; i++) {
|
||||||
char *veth = NULL;
|
char *veth = NULL;
|
||||||
@ -1246,10 +1245,7 @@ int virLXCProcessStart(virConnectPtr conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!vm->def->resource) {
|
if (!vm->def->resource) {
|
||||||
virDomainResourceDefPtr res;
|
virDomainResourceDefPtr res = g_new0(virDomainResourceDef, 1);
|
||||||
|
|
||||||
if (VIR_ALLOC(res) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
res->partition = g_strdup("/machine");
|
res->partition = g_strdup("/machine");
|
||||||
|
|
||||||
@ -1298,8 +1294,7 @@ int virLXCProcessStart(virConnectPtr conn,
|
|||||||
* and forward I/O between them.
|
* and forward I/O between them.
|
||||||
*/
|
*/
|
||||||
nttyFDs = vm->def->nconsoles;
|
nttyFDs = vm->def->nconsoles;
|
||||||
if (VIR_ALLOC_N(ttyFDs, nttyFDs) < 0)
|
ttyFDs = g_new0(int, nttyFDs);
|
||||||
goto cleanup;
|
|
||||||
for (i = 0; i < vm->def->nconsoles; i++)
|
for (i = 0; i < vm->def->nconsoles; i++)
|
||||||
ttyFDs[i] = -1;
|
ttyFDs[i] = -1;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user