Similar to a disk declaration for a domain, the choice of type controls
what additional sub-elements are needed to describe the destination.
+ ``index``
+ Output only. The value can be used to refer to the scratch or output
+ file of the backup in APIs such as ``virDomainSetBlockThreshold``.
+
``target``
Valid only for push mode backups, this is the primary sub-element that
describes the file name of the backup destination, similar to the
VIR_XPATH_NODE_AUTORESTORE(ctxt)
g_autofree char *type = NULL;
g_autofree char *format = NULL;
+ g_autofree char *idx = NULL;
g_autofree char *backup = NULL;
g_autofree char *state = NULL;
g_autofree char *backupmode = NULL;
type = virXMLPropString(node, "type");
format = virXPathString("string(./driver/@type)", ctxt);
+ if (internal)
+ idx = virXMLPropString(node, "index");
- if (!(def->store = virDomainStorageSourceParseBase(type, format, NULL)))
+ if (!(def->store = virDomainStorageSourceParseBase(type, format, idx)))
return -1;
if (def->store->type != VIR_STORAGE_TYPE_FILE &&
virBufferEscapeString(&attrBuf, " exportname='%s'", disk->exportname);
virBufferEscapeString(&attrBuf, " exportbitmap='%s'", disk->exportbitmap);
+ if (disk->store->id != 0)
+ virBufferAsprintf(&attrBuf, " index='%u'", disk->store->id);
+
if (disk->store->format > 0)
virBufferEscapeString(&childBuf, "<driver type='%s'/>\n",
virStorageFileFormatTypeToString(disk->store->format));
<incremental>12345</incremental>
<server transport='tcp' tls='yes' name='localhost' port='10809'/>
<disks>
- <disk name='vda' backup='yes' state='running' type='file'>
+ <disk name='vda' backup='yes' state='running' type='file' index='123'>
<scratch file='/path/to/file/'/>
</disk>
</disks>