[libvirt] Create a Domain from windows client

anuj rampal rampal.anuj at gmail.com
Mon Aug 31 14:08:18 UTC 2009


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20090831/8179c3d2/attachment-0001.htm>


More information about the libvir-list mailing list