[Libvir] PATCH: 10/16: general purpose helper APIs

Jim Meyering jim at meyering.net
Fri Feb 15 21:53:47 UTC 2008


"Daniel P. Berrange" <berrange at redhat.com> wrote:
> This patch provides a couple of helper APIs used by the forthcoming
> driver backends.
>
>    - virStorageBackendUpdateVolInfo - take a filename and virStorageVolPtr
>      and update the capacity/allocation information based on the file
>      stat() results. Also update the permissions data on owner/mode
>      and SELinux label.
>
>    - virStorageBackendUpdateVolInfoFD - same as above but with a pre-opened
>      filehandle
>
>    - virStorageBackendStablePath - given a /dev/XXX node, and a directory
>      of symlinks (eg /dev/disk/by-path), attempts to find a symlink pointing
>      to the desired file.
>
>    - virStorageBackendRunProgRegex - given one or more regexes and a command
>      line argv[], execute the program and attempt to match its STDOUT against
>      the regex. When complete matches are found invoke a callback.
>
>    - virStorageBackendRunProgNul - given a command line argv[] and an expected
>      number of fields per record, tokenize the STDOUT into records splitting
>      on NULL, and invoke the callback per record.
>
> The SELinux code is optional, and can be replaced with calls to any other
> library which can provide MAC file labels, or just disabled completely..

ACK




More information about the libvir-list mailing list