int (*privateDataXMLFormat)(virBufferPtr, void *);
int (*privateDataXMLParse)(xmlXPathContextPtr, void *);
bool hasWideScsiBus;
+ const char *defaultInitPath;
virDomainXMLNamespace ns;
};
if (STREQ(def->os.type, "exe")) {
def->os.init = virXPathString("string(./os/init[1])", ctxt);
+ if (!def->os.init) {
+ if (caps->defaultInitPath) {
+ def->os.init = strdup(caps->defaultInitPath);
+ if (!def->os.init) {
+ goto no_memory;
+ }
+ } else {
+ virDomainReportError(VIR_ERR_XML_ERROR, "%s",
+ _("init binary must be specified"));
+ goto error;
+ }
+ }
}
if (STREQ(def->os.type, "xen") ||
0,
NULL) == NULL)
goto no_memory;
- return caps;
+ caps->defaultInitPath = "/sbin/init";
+
+ return caps;
no_memory:
virCapabilitiesFree(caps);
return NULL;
VIR_DOMAIN_XML_INACTIVE)) == NULL)
goto cleanup;
- if (vmdef->os.init == NULL) {
- if (!(vmdef->os.init = strdup("/sbin/init"))) {
- virReportOOMError();
- goto cleanup;
- }
- }
-
vm = virDomainFindByName(&driver->domains, vmdef->name);
if (vm) {
openvzError(VIR_ERR_OPERATION_FAILED,
VIR_DOMAIN_XML_INACTIVE)) == NULL)
goto cleanup;
- if (vmdef->os.init == NULL) {
- if (!(vmdef->os.init = strdup("/sbin/init"))) {
- virReportOOMError();
- goto cleanup;
- }
- }
-
vm = virDomainFindByName(&driver->domains, vmdef->name);
if (vm) {
openvzError(VIR_ERR_OPERATION_FAILED,