Hi all,
I'm trying to call the libvirt API from my Windows machine.
When i try to create to a Domain using "virDomainDefineXML" function
I have to pass an XML file containing the Description of the Domain.
Here is the part of the XML file that im using:
<domain type='qemu' id='1'>
..
..
..
<devices>
<emulator>/usr/bin/qemu</emulator>
<disk type='file' device='disk'>
<source file='/var/lib/libvirt/images/WinXp.img'/>
<target dev='hda' bus='ide'/>
</disk>
<disk type='file' device='cdrom'>
<source file='/home/anuj/ISOs/WinXpSp3/Windows_XP_SP3.iso'/>
<target dev='hdc' bus='ide'/>
<readonly/>
</disk>
..
<emulator>/usr/bin/qemu</emulator>
<disk type='file' device='disk'>
<source file='/var/lib/libvirt/images/WinXp.img'/>
<target dev='hda' bus='ide'/>
</disk>
<disk type='file' device='cdrom'>
<source file='/home/anuj/ISOs/WinXpSp3/Windows_XP_SP3.iso'/>
<target dev='hdc' bus='ide'/>
<readonly/>
</disk>
..
..
</domain>
</domain>
<source file='/var/lib/libvirt/images/WinXp.img'/>
This is the path which contains the img file for the Domain.
This is the path which contains the img file for the Domain.
I have created this file using this command:
qemu-img create -f raw /var/lib/libvirt/images/WinXp.img 10G
Now: my question is:
Is there a way by which i can create this img file using some libvirt call directly and then use this for my domain creation.
Or modify the XML file itself so that virDomainDefineXML call creates the img file at the path and the size that i specify.
Could someone also give me some example for the same.
Regards
Anuj
-- Libvir-list mailing list Libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list