[libvirt] Create a Domain from windows client

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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>
..
..
</domain>
 
<source file='/var/lib/libvirt/images/WinXp.img'/>
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

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]