On 06.03.2013 16:37, Peter Krempa wrote: > --- > src/openvz/openvz_conf.c | 12 ++++++++++-- > src/openvz/openvz_conf.h | 3 +++ > src/openvz/openvz_driver.c | 16 ++++++++++------ > 3 files changed, 23 insertions(+), 8 deletions(-) > > diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c > index fde32ce..63663ab 100644 > --- a/src/openvz/openvz_conf.c > +++ b/src/openvz/openvz_conf.c > @@ -174,6 +174,14 @@ static int openvzDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED, > return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_OPENVZ; > } > > + > +virDomainXMLConfPtr > +openvzDomainXMLConfInit(void) > +{ > + return virDomainXMLConfNew(NULL, NULL); > +} Again. Is this wrapper really needed? Esp. when passing nothing but all NULLs. Moreover, are all these changes needed? Can't we just pass NULL to all changed functions to satisfy their prototype? Something what you are doing in phyp driver. > + > + > virCapsPtr openvzCapsInit(void) > { > virCapsPtr caps; > @@ -558,13 +566,13 @@ openvzFreeDriver(struct openvz_driver *driver) > if (!driver) > return; > > + virObjectUnref(driver->xmlconf); > virObjectUnref(driver->domains); > virObjectUnref(driver->caps); > VIR_FREE(driver); > } > > > - > int openvzLoadDomains(struct openvz_driver *driver) { > int veid, ret; > char *status; > @@ -648,7 +656,7 @@ int openvzLoadDomains(struct openvz_driver *driver) { > flags |= VIR_DOMAIN_OBJ_LIST_ADD_LIVE; > > if (!(dom = virDomainObjListAdd(driver->domains, > - driver->caps, > + driver->xmlconf, > def, > flags, > NULL))) > diff --git a/src/openvz/openvz_conf.h b/src/openvz/openvz_conf.h > index d7f21b3..87390a2 100644 > --- a/src/openvz/openvz_conf.h > +++ b/src/openvz/openvz_conf.h > @@ -45,6 +45,7 @@ struct openvz_driver { > virMutex lock; > > virCapsPtr caps; > + virDomainXMLConfPtr xmlconf; > virDomainObjListPtr domains; > int version; > }; > @@ -68,5 +69,7 @@ int openvzSetDefinedUUID(int vpsid, unsigned char *uuid); > unsigned int openvzGetNodeCPUs(void); > int openvzGetVEID(const char *name); > int openvzReadNetworkConf(virDomainDefPtr def, int veid); > +virDomainXMLConfPtr openvzDomainXMLConfInit(void); > + > > #endif /* OPENVZ_CONF_H */ > diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c > index 3865206..f3c183d 100644 > --- a/src/openvz/openvz_driver.c > +++ b/src/openvz/openvz_driver.c > @@ -955,8 +955,8 @@ openvzDomainDefineXML(virConnectPtr conn, const char *xml) > virDomainPtr dom = NULL; > > openvzDriverLock(driver); > - if ((vmdef = virDomainDefParseString(driver->caps, xml, > - 1 << VIR_DOMAIN_VIRT_OPENVZ, > + if ((vmdef = virDomainDefParseString(driver->caps, driver->xmlconf, > + xml, 1 << VIR_DOMAIN_VIRT_OPENVZ, > VIR_DOMAIN_XML_INACTIVE)) == NULL) > goto cleanup; > > @@ -968,7 +968,7 @@ openvzDomainDefineXML(virConnectPtr conn, const char *xml) > goto cleanup; > } > if (!(vm = virDomainObjListAdd(driver->domains, > - driver->caps, > + driver->xmlconf, > vmdef, 0, NULL))) > goto cleanup; > vmdef = NULL; > @@ -1042,8 +1042,8 @@ openvzDomainCreateXML(virConnectPtr conn, const char *xml, > virCheckFlags(0, NULL); > > openvzDriverLock(driver); > - if ((vmdef = virDomainDefParseString(driver->caps, xml, > - 1 << VIR_DOMAIN_VIRT_OPENVZ, > + if ((vmdef = virDomainDefParseString(driver->caps, driver->xmlconf, > + xml, 1 << VIR_DOMAIN_VIRT_OPENVZ, > VIR_DOMAIN_XML_INACTIVE)) == NULL) > goto cleanup; > > @@ -1055,7 +1055,7 @@ openvzDomainCreateXML(virConnectPtr conn, const char *xml, > goto cleanup; > } > if (!(vm = virDomainObjListAdd(driver->domains, > - driver->caps, > + driver->xmlconf, > vmdef, > VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE, > NULL))) > @@ -1453,6 +1453,9 @@ static virDrvOpenStatus openvzOpen(virConnectPtr conn, > if (!(driver->caps = openvzCapsInit())) > goto cleanup; > > + if (!(driver->xmlconf = openvzDomainXMLConfInit())) > + goto cleanup; > + > if (openvzLoadDomains(driver) < 0) > goto cleanup; > > @@ -2076,6 +2079,7 @@ openvzDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml, > } > > if (virDomainLiveConfigHelperMethod(driver->caps, > + driver->xmlconf, > vm, > &flags, > &vmdef) < 0) > -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list