[libvirt-users] [API reference] Are there XML-handling API to retrieve info directly from xml configure file

Zhihua Che zhihua.che at gmail.com
Wed Apr 18 11:00:57 UTC 2012


在 2012年4月18日 下午6:52,Daniel P. Berrange <berrange at redhat.com> 写道:
> On Wed, Apr 18, 2012 at 06:48:56PM +0800, Zhihua Che wrote:
>> 在 2012年4月18日 下午6:13,Daniel P. Berrange <berrange at redhat.com> 写道:
>> > On Wed, Apr 18, 2012 at 06:09:35PM +0800, Zhihua Che wrote:
>> >> 在 2012年4月18日 下午5:47,Zhihua Che <zhihua.che at gmail.com> 写道:
>> >> > 在 2012年4月18日 下午5:31,Richard W.M. Jones <rjones at redhat.com> 写道:
>> >> >> On Wed, Apr 18, 2012 at 10:24:24AM +0800, Zhihua Che wrote:
>> >> >>>    I guess I miss another thing. I thought the domain xml config file
>> >> >>> was stored in etc/libvirt/qemu/ directory.
>> >> >>
>> >> >> libvirt manages the config files.  To edit them, DON'T edit them
>> >> >> directly, use 'virsh edit'.
>> >> >>
>> >> >> Rich.
>> >> >>
>> >>
>> >> Correction
>> >>
>> >>  I agree with you. But I wanna know where libvirt stores all the domains'
>> >>  config files.
>> >>  Image that if I uninstalled libvirt and reinstalled it, I wish I could
>> >>  manipulate all the previous domains.
>> >
>> > All the persistent configs are under /etc/libvirt
>> >
>> > When a guest is running, there is a second config stored in /var/run/libvirt
>> >
>>
>> I thought so. But I removed config file uder working/etc/libvirt and
>> It sill worked.
>
> Libvirtd loads all the configs under /etc/libvirt into memory, so if
> you delete them, libvirtd will still know about them until you restart
> it.
>
>> By the way, I installed my libvirt under directory working. Of course
>> I searched the whole system and found no other config files.
>
> If you are runing libvirtd as non-root then it uses $HOME/.libvirt
>
> If you built a custom libvirtd from source and run it as root, then
> it'll use $sysconfdir/libvirt  (where $sysconfdir is the --sysconfdir
> value passed to the configure script)
>

Yeah, you're right. I found it in $HOME/.libvirt/qemu.
I didn't search the hidden files. I made a mistake.:(




More information about the libvirt-users mailing list