RFC: get/set properties

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

 




  I'd like to get some comments on the following...

We would like to use libvirt to store some properties related to a domain. This can be done by adding a simple get/set API as follows:

/*
 * Domain property get/set interfaces
 *
 * For GetProp, the return value must be freed by the caller.
 */
char *          virDomainGetProp    (virDomainPtr domain,
                        const char *propName);

int         virDomainSetProp    (virDomainPtr domain,
                        const char *propName,
                        const char *value);


  Sample command-line usage:

virsh # setprop solaris-pv-0 foo bar

virsh # setprop solaris-pv-0 blah 3

virsh # getprop solaris-pv-0 foo
foo: bar

  The XML would look something like this:

virsh # dumpxml solaris-pv-0
<domain type='xen' id='-1'>
[ snip ]
  <properties>
    <blah value="3"/>
    <foo value="bar"/>
  </properties>
</domain>

Looking at the Xen code, I'll need to do a bit of work on that API before I can implement this. I don't know how well this will fit into the other hypervisors that Libvirt supports, so I'll leave those implementations up to someone else :)

  Any thoughts?

-Ryan

--
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]