<div dir="ltr"><div>Hi!</div><div><br></div><div>I'm working on supporting a new FT/HA solution for qemu called COLO</div><div>(<a href="http://wiki.qemu.org/Features/COLO">http://wiki.qemu.org/Features/COLO</a>). The part that is currently being focused </div><div>on for libvirt integration is Block Replication</div><div>(<a href="http://wiki.qemu.org/Features/BlockReplication">http://wiki.qemu.org/Features/BlockReplication</a>) which enables guest state</div><div>synchronization for disks.</div><div><br></div><div>Right now there are three issues that I'd like to get your input on:</div><div><br></div><div>1.</div><div>As you can see on the block replication wiki-page we need to reference the</div><div>secondary disk id.</div><div><br></div><div>Example from the wiki:</div><div>-drive if=none,driver=raw,file.filename=1.raw,id=colo1 \</div><div>-drive if=xxx,driver=replication,mode=secondary,\</div><div>     ...</div><div>     file.backing.backing=colo1</div><div><br></div><div>My initial thought was to manually set the alias of the</div><div>disk and add a new reference element to the backingStore:</div><div><disk type='file' device='disk'></div><div>  ...</div><div>  <alias name='colo1'/></div><div></disk></div><div><disk type='file' device='disk'></div><div>  ...</div><div>  <backingStore type='file'></div><div>    ...</div><div>    <reference name='colo1'/></div><div>  </backingStore></div><div></disk></div><div><br></div><div>Though, I quickly realized that setting the alias is only done by the</div><div>hypervisor and is therefore not an option with the current code.</div><div><br></div><div>Would it be bad letting the user set the alias, and if so, do you have any</div><div>ideas of how to solve the referencing?</div><div><br></div><div><br></div><div>2.</div><div>The format of the disk and the driver type currently shares the same</div><div>attribute in libvirt (the type attribute on driver XML element). However, with</div><div>the new replication disk driver you need to be able to set both the disk format</div><div>and also the driver name.</div><div><br></div><div>Example from the wiki:</div><div>-drive if=xxx,driver=replication,mode=secondary,\</div><div>         file.file.filename=active_disk.qcow2,\</div><div>         file.driver=qcow2,\</div><div>         ...</div><div><br></div><div>I saw that there was a function in libvirt called virStorageFileProbeFormat</div><div>that could let us get the format of the disk without stating it in the XML. But</div><div>as I'm sure you know, it's strongly advised not to be used since you can trick</div><div>the function by modifying the disk file.</div><div><br></div><div><br></div><div>3.</div><div>When using the replication driver the secondary disk is supposed to be added</div><div>but not attached.</div><div>Example from the wiki:</div><div>-drive if=none,driver=raw,file.filename=1.raw,id=colo1 \</div><div>-drive if=xxx,driver=replication,mode=secondary,\</div><div>    ...</div><div><br></div><div>Clearly, trying to setup a disk without a target is not allowed at the moment.</div><div>Is there any better way of doing it?</div><div><br></div><div><br></div><div><br></div><div>Any comments and insights in general are also greatly appreciated!</div><div><br></div><div>/Simon</div></div>