xmlStrEqual(cur->name, BAD_CAST "driver")) {
driverName = virXMLPropString(cur, "name");
driverType = virXMLPropString(cur, "type");
+ if (STREQ_NULLABLE(driverType, "aio")) {
+ /* In-place conversion to "raw", for Xen back-compat */
+ driverType[0] = 'r';
+ driverType[1] = 'a';
+ driverType[2] = 'w';
+ }
cachetag = virXMLPropString(cur, "cache");
error_policy = virXMLPropString(cur, "error_policy");
rerror_policy = virXMLPropString(cur, "rerror_policy");
if (disk->driverType) {
const char *formatStr = disk->driverType;
- if (STREQ(formatStr, "aio"))
- formatStr = "raw"; /* Xen compat */
if ((format = virStorageFileFormatTypeFromString(formatStr)) <= 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
src);
goto error;
}
+ if (STREQ(disk->driverType, "aio")) {
+ /* In-place conversion to "raw" */
+ disk->driverType[0] = 'r';
+ disk->driverType[1] = 'a';
+ disk->driverType[2] = 'w';
+ }
src = offset + 1;
/* Its possible to use blktap driver for block devs
if (def->driverName) {
if (STREQ(def->driverName, "tap") ||
STREQ(def->driverName, "tap2")) {
+ const char *type = def->driverType ? def->driverType : "aio";
+ if (STREQ(type, "raw"))
+ type = "aio";
virBufferEscapeSexpr(buf, "(uname '%s:", def->driverName);
- virBufferEscapeSexpr(buf, "%s:",
- def->driverType ? def->driverType : "aio");
+ virBufferEscapeSexpr(buf, "%s:", type);
virBufferEscapeSexpr(buf, "%s')", def->src);
} else {
virBufferEscapeSexpr(buf, "(uname '%s:", def->driverName);
disk->src);
goto cleanup;
}
+ if (STREQ(disk->driverType, "aio")) {
+ /* In-place conversion to "raw" */
+ disk->driverType[0] = 'r';
+ disk->driverType[1] = 'a';
+ disk->driverType[2] = 'w';
+ }
/* Strip the prefix we found off the source file name */
memmove(disk->src, disk->src+(tmp-disk->src)+1,
if(disk->src) {
if (disk->driverName) {
+ const char *type = disk->driverType ? disk->driverType : "aio";
+ if (STREQ(type, "raw"))
+ type = "aio";
virBufferAsprintf(&buf, "%s:", disk->driverName);
if (STREQ(disk->driverName, "tap"))
- virBufferAsprintf(&buf, "%s:", disk->driverType ? disk->driverType : "aio");
+ virBufferAsprintf(&buf, "%s:", type);
} else {
switch (disk->type) {
case VIR_DOMAIN_DISK_TYPE_FILE:
<on_crash>restart</on_crash>
<devices>
<disk type='file' device='disk'>
- <driver name='tap' type='aio'/>
+ <driver name='tap' type='raw'/>
<source file='/xen/rhel5.img'/>
<target dev='xvda' bus='xen'/>
</disk>
<on_crash>restart</on_crash>
<devices>
<disk type='file' device='disk'>
- <driver name='tap' type='aio'/>
+ <driver name='tap' type='raw'/>
<source file='/var/lib/xen/images/rhel5pv.img'/>
<target dev='xvda' bus='xen'/>
<shareable/>
<on_crash>destroy</on_crash>
<devices>
<disk type='file' device='disk'>
- <driver name='tap' type='aio'/>
+ <driver name='tap' type='raw'/>
<source file='/root/some.img'/>
<target dev='xvda' bus='xen'/>
</disk>
<on_crash>destroy</on_crash>
<devices>
<disk type='file' device='disk'>
- <driver name='tap2' type='aio'/>
+ <driver name='tap2' type='raw'/>
<source file='/root/some.img'/>
<target dev='xvda' bus='xen'/>
</disk>