Import Upstream version 0.3.4

This commit is contained in:
Cong Liu 2022-11-24 10:42:04 +08:00
commit 5524976246
124 changed files with 60723 additions and 0 deletions

2
AUTHORS Normal file
View File

@ -0,0 +1,2 @@
Christophe Fergeau <cfergeau@redhat.com>
Fabiano Fidêncio <fidencio@redhat.com>

510
COPYING Normal file
View File

@ -0,0 +1,510 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations
below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it
becomes a de-facto standard. To achieve this, non-free programs must
be allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control
compilation and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at least
three years, to give the same user the materials specified in
Subsection 6a, above, for a charge no more than the cost of
performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply, and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License
may add an explicit geographical distribution limitation excluding those
countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms
of the ordinary General Public License).
To apply these terms, attach the following notices to the library.
It is safest to attach them to the start of each source file to most
effectively convey the exclusion of warranty; and each file should
have at least the "copyright" line and a pointer to where the full
notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or
your school, if any, to sign a "copyright disclaimer" for the library,
if necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James
Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

0
ChangeLog Normal file
View File

370
INSTALL Normal file
View File

@ -0,0 +1,370 @@
Installation Instructions
*************************
Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without warranty of any kind.
Basic Installation
==================
Briefly, the shell command `./configure && make && make install'
should configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package. Some packages provide this
`INSTALL' file but do not implement all of the features documented
below. The lack of an optional feature in a given package is not
necessarily a bug. More recommendations for GNU packages can be found
in *note Makefile Conventions: (standards)Makefile Conventions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
Running `configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package, generally using the just-built uninstalled binaries.
4. Type `make install' to install the programs and any data files and
documentation. When installing into a prefix owned by root, it is
recommended that the package be configured and built as a regular
user, and only the `make install' phase executed with root
privileges.
5. Optionally, type `make installcheck' to repeat any self-tests, but
this time using the binaries in their final installed location.
This target does not install anything. Running this target as a
regular user, particularly if the prior `make install' required
root privileges, verifies that the installation completed
correctly.
6. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
7. Often, you can also type `make uninstall' to remove the installed
files again. In practice, not all packages have tested that
uninstallation works correctly, even though it is required by the
GNU Coding Standards.
8. Some packages, particularly those that use Automake, provide `make
distcheck', which can by used by developers to test that all other
targets like `make install' and `make uninstall' work correctly.
This target is generally not run by end users.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'. This
is known as a "VPATH" build.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.
On MacOS X 10.5 and later systems, you can create libraries and
executables that work on multiple system types--known as "fat" or
"universal" binaries--by specifying multiple `-arch' options to the
compiler but only a single `-arch' option to the preprocessor. Like
this:
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CPP="gcc -E" CXXCPP="g++ -E"
This is not guaranteed to produce working output in all cases, you
may have to build one architecture at a time and combine the results
using the `lipo' tool if you have problems.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX', where PREFIX must be an
absolute file name.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them. In general, the
default for these options is expressed in terms of `${prefix}', so that
specifying just `--prefix' will affect all of the other directory
specifications that were not explicitly provided.
The most portable way to affect installation locations is to pass the
correct locations to `configure'; however, many packages provide one or
both of the following shortcuts of passing variable assignments to the
`make install' command line to change installation locations without
having to reconfigure or recompile.
The first method involves providing an override variable for each
affected directory. For example, `make install
prefix=/alternate/directory' will choose an alternate location for all
directory configuration variables that were expressed in terms of
`${prefix}'. Any directories that were specified during `configure',
but not in terms of `${prefix}', must each be overridden at install
time for the entire installation to be relocated. The approach of
makefile variable overrides for each directory variable is required by
the GNU Coding Standards, and ideally causes no recompilation.
However, some platforms have known limitations with the semantics of
shared libraries that end up requiring recompilation when using this
method, particularly noticeable in packages that use GNU Libtool.
The second method involves providing the `DESTDIR' variable. For
example, `make install DESTDIR=/alternate/directory' will prepend
`/alternate/directory' before all installation names. The approach of
`DESTDIR' overrides is not required by the GNU Coding Standards, and
does not work on platforms that have drive letters. On the other hand,
it does better at avoiding recompilation issues, and works well even
when some directory options were not specified in terms of `${prefix}'
at `configure' time.
Optional Features
=================
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Some packages offer the ability to configure how verbose the
execution of `make' will be. For these packages, running `./configure
--enable-silent-rules' sets the default to minimal output, which can be
overridden with `make V=1'; while running `./configure
--disable-silent-rules' sets the default to verbose, which can be
overridden with `make V=0'.
Particular systems
==================
On HP-UX, the default C compiler is not ANSI C compatible. If GNU
CC is not installed, it is recommended to use the following options in
order to use an ANSI C compiler:
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
HP-UX `make' updates targets which have the same time stamps as
their prerequisites, which makes it generally unusable when shipped
generated files such as `configure' are involved. Use GNU `make'
instead.
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its `<wchar.h>' header file. The option `-nodtk' can be used as
a workaround. If GNU CC is not installed, it is therefore recommended
to try
./configure CC="cc"
and if that doesn't work, try
./configure CC="cc -nodtk"
On Solaris, don't put `/usr/ucb' early in your `PATH'. This
directory contains several dysfunctional programs; working variants of
these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
in your `PATH', put it _after_ `/usr/bin'.
On Haiku, software installed for all users goes in `/boot/common',
not `/usr/local'. It is recommended to use the following options:
./configure --prefix=/boot/common
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS
KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf limitation. Until the limitation is lifted, you can use
this workaround:
CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of all of the options to `configure', and exit.
`--help=short'
`--help=recursive'
Print a summary of the options unique to this package's
`configure', and exit. The `short' variant lists options used
only in the top level, while the `recursive' variant lists options
also present in any nested packages.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--prefix=DIR'
Use DIR as the installation prefix. *note Installation Names::
for more details, including other options available for fine-tuning
the installation locations.
`--no-create'
`-n'
Run the configure checks, but stop before creating any output
files.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.

1
MAINTAINERS Normal file
View File

@ -0,0 +1 @@
Christophe Fergeau <cfergeau@redhat.com>

61
Makefile.am Normal file
View File

@ -0,0 +1,61 @@
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
SUBDIRS = \
govirt \
examples \
po \
tests
INTLTOOL_FILES = \
intltool-extract.in \
intltool-merge.in \
intltool-update.in \
$(NULL)
DISTCLEANFILES = \
intltool-extract \
intltool-merge \
intltool-update \
$(NULL)
EXTRA_DIST = \
COPYING \
MAINTAINERS \
AUTHORS \
INSTALL \
README \
NEWS \
autogen.sh \
libgovirt.doap \
$(INTLTOOL_FILES) \
$(NULL)
MAINTAINERCLEANFILES = \
ChangeLog \
INSTALL \
aclocal.m4 \
build-aux/ \
config.h.in
distclean-local:
if test $(srdcir) = .; then :; else \
rm -f ChangeLog; \
fi
ChangeLog:
@echo Creating $@
@if test -d "$(srcdir)/.git"; then \
(GIT_DIR=$(top_srcdir)/.git ./missing --run git log e197d80c8937c622f21f569457d1bbd05746d951.. --stat -M -C --name-status --date=short --no-color) | fmt --split-only > $@.tmp \
&& mv -f $@.tmp $@ \
|| ($(RM) $@.tmp; \
echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \
(test -f $@ || echo git-log is required to generate this file >> $@)); \
else \
test -f $@ || \
(echo A git checkout and git-log is required to generate ChangeLog >&2 && \
echo A git checkout and git-log is required to generate this file >> $@); \
fi
.PHONY: ChangeLog
-include $(top_srcdir)/git.mk

917
Makefile.in Normal file
View File

@ -0,0 +1,917 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/intltool.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
cscope distdir dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
$(LISP)config.h.in
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/build-aux/compile \
$(top_srcdir)/build-aux/config.guess \
$(top_srcdir)/build-aux/config.sub \
$(top_srcdir)/build-aux/install-sh \
$(top_srcdir)/build-aux/ltmain.sh \
$(top_srcdir)/build-aux/missing AUTHORS COPYING ChangeLog \
INSTALL NEWS README build-aux/compile build-aux/config.guess \
build-aux/config.sub build-aux/install-sh build-aux/ltmain.sh \
build-aux/missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
if test -d "$(distdir)"; then \
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -rf "$(distdir)" \
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
am__post_remove_distdir = $(am__remove_distdir)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
GZIP_ENV = --best
DIST_ARCHIVES = $(distdir).tar.xz
DIST_TARGETS = dist-xz
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
ALL_LINGUAS = @ALL_LINGUAS@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_LIBS = @GLIB_LIBS@
GLIB_MKENUMS = @GLIB_MKENUMS@
GMSGFMT = @GMSGFMT@
GREP = @GREP@
G_OVIRT_MAJOR_VERSION = @G_OVIRT_MAJOR_VERSION@
G_OVIRT_MICRO_VERSION = @G_OVIRT_MICRO_VERSION@
G_OVIRT_MINOR_VERSION = @G_OVIRT_MINOR_VERSION@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
INTLTOOL_MERGE = @INTLTOOL_MERGE@
INTLTOOL_PERL = @INTLTOOL_PERL@
INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@
INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@
INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@
INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@
INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@
INTROSPECTION_LIBS = @INTROSPECTION_LIBS@
INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_AGE = @LT_AGE@
LT_CURRENT = @LT_CURRENT@
LT_REVISION = @LT_REVISION@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGMERGE = @MSGMERGE@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
REST_CFLAGS = @REST_CFLAGS@
REST_LIBS = @REST_LIBS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
WARNINGFLAGS_C = @WARNINGFLAGS_C@
XGETTEXT = @XGETTEXT@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
intltool__v_merge_options_ = @intltool__v_merge_options_@
intltool__v_merge_options_0 = @intltool__v_merge_options_0@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
SUBDIRS = \
govirt \
examples \
po \
tests
INTLTOOL_FILES = \
intltool-extract.in \
intltool-merge.in \
intltool-update.in \
$(NULL)
DISTCLEANFILES = \
intltool-extract \
intltool-merge \
intltool-update \
$(NULL)
EXTRA_DIST = \
COPYING \
MAINTAINERS \
AUTHORS \
INSTALL \
README \
NEWS \
autogen.sh \
libgovirt.doap \
$(INTLTOOL_FILES) \
$(NULL)
MAINTAINERCLEANFILES = \
ChangeLog \
INSTALL \
aclocal.m4 \
build-aux/ \
config.h.in
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
am--refresh: Makefile
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
$(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
config.h: stamp-h1
@test -f $@ || rm -f stamp-h1
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool config.lt
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscope: cscope.files
test ! -s cscope.files \
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
clean-cscope:
-rm -f cscope.files
cscope.files: clean-cscope cscopelist
cscopelist: cscopelist-recursive
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
distdir: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
-test -n "$(am__skip_mode_fix)" \
|| find "$(distdir)" -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__post_remove_distdir)
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__post_remove_distdir)
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
dist-tarZ: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__post_remove_distdir)
dist dist-all:
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
$(am__post_remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build/sub \
&& ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
&& cd "$$am__cwd" \
|| exit 1
$(am__post_remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@test -n '$(distuninstallcheck_dir)' || { \
echo 'ERROR: trying to run $@ with an empty' \
'$$(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
$(am__cd) '$(distuninstallcheck_dir)' || { \
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile config.h
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr \
distclean-libtool distclean-local distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am:
.MAKE: $(am__recursive_targets) all install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
am--refresh check check-am clean clean-cscope clean-generic \
clean-libtool cscope cscopelist-am ctags ctags-am dist \
dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
dist-xz dist-zip distcheck distclean distclean-generic \
distclean-hdr distclean-libtool distclean-local distclean-tags \
distcleancheck distdir distuninstallcheck dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am
.PRECIOUS: Makefile
distclean-local:
if test $(srdcir) = .; then :; else \
rm -f ChangeLog; \
fi
ChangeLog:
@echo Creating $@
@if test -d "$(srcdir)/.git"; then \
(GIT_DIR=$(top_srcdir)/.git ./missing --run git log e197d80c8937c622f21f569457d1bbd05746d951.. --stat -M -C --name-status --date=short --no-color) | fmt --split-only > $@.tmp \
&& mv -f $@.tmp $@ \
|| ($(RM) $@.tmp; \
echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \
(test -f $@ || echo git-log is required to generate this file >> $@)); \
else \
test -f $@ || \
(echo A git checkout and git-log is required to generate ChangeLog >&2 && \
echo A git checkout and git-log is required to generate this file >> $@); \
fi
.PHONY: ChangeLog
-include $(top_srcdir)/git.mk
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

128
NEWS Normal file
View File

@ -0,0 +1,128 @@
0.3.4 -
======================
Changes since 0.3.3
- API additions:
- ovirt_proxy_get_api()
- OvirtVmDisplay::ca-cert
- OvirtCollection::resources
- OvirtProxy::sso-token
- Fixes to CA certificate handling
- Fix crash when a REST API call returned multiple elements with the same
'name' attribute
- Various leak fixes
- Improved API documentation
- Fix GCancellable disconnection after async calls
- Translations:
* Chinese (Simplified) (Aron Xu)
* French (Erwan Georget)
* Lithuanian (Aurimas Černius)
* Occitan (Cédric Valmary)
* Polish (Piotr Drąg)
* Portuguese (Pedro Albuquerque)
* Swedish (Anders Jonsson)
0.3.3 - April 8th 2015
======================
Changes since 0.3.2:
- Add support for SPICE proxy
- Don't report REST call cancellations as an unexpected error
- Access REST API through /ovirt-engine/api rather than /api as the latter is
deprecated
- Parse status of storage domains
- Add support for GOVIRT_DISABLE_HTTPS and GOVIRT_NO_SSL_STRICT environment
variable in order to make it easier to lower security during development/testing
- Fix compilation with older glibs
- Fix mingw build
- Translations:
* Basque (Inaki Larranaga Murgoitio)
* Bosnian (Samir Ribic)
* Brazilian Portuguese (Rafael Ferreira)
* Greek (Dimitris Spingos)
* Hungarian (Balázs Úr)
* Slovenian (Matej Urbančič)
* Turkish (Muhammet Kara, Necdet Yücel)
* Russian (Yuri Myasoedov)
0.3.2 - October 9th 2014
========================
Changes since 0.3.1:
- Allow empty filenames in OvirtCdrom, this allows to remove the current CD
image from a VM
- Parse leading '~' when handling commandline filenames (Fabiano Fidêncio)
- Implemented ovirt_resource_delete() and its async variant
- Add translation support (Fabiano Fidêncio)
- Translations:
* Czech (Marek Černocký)
* German (Christian Kirbach)
* Indonesian (Andika Triwidada)
* Polish (Piotr Drąg)
* Serbian (Мирослав Николић)
* Slovenian (Matej Urbančič)
* Spanish (Daniel Mustieles)
- Bug fixes
0.3.1 - September 3rd 2014
==========================
Changes since 0.3.0:
- Handle cookies set by the oVirt instance in order to have some
'persistant' authentication through the JSESSIONID cookie
- Add support for VM pools (Iordan Iordanov)
- Added ovirt_resource_refresh{_async} in order to refetch a resource content
remotely
- Various leak/memory-handling related bug fixes
- ovirt_proxy_new now expects a hostname without the https:// and the /api part.
hostnames with http/https/api will still work fine but will cause runtime
warnings.
0.3.0 - October 29, 2013
========================
Changes since 0.2.0:
- Add support for listing storage domains and the files they contain
- Add support for changing the CDRom available in a VM
- Introduced an OvirtApi class which represents the toplevel oVirt
collection from which one can access VMs, storage domains, ...
This means that various OvirtProxy methods to fetch VMs have been deprecated
in favour of using OvirtApi + OvirtCollection methods
- Rework certificate handling, OvirtProxy now has a 'ssl-ca-file' property
that can be used to specify which CA certificate should be used to validate
remote certificates.
- Certificate checking is now enforced by default unless
OvirtProxy::ssl-strict is set to FALSE
- ABI/API hasn't been broken, even though some functions were deprecated
0.2.0 - July 5, 2013
====================
Changes since 0.1.0:
- Break ABI :(
- Switch back to using GSimpleAsyncResult (from GTask) to gain
compatibility with older glib versions
- Refactor internals to make it much easier to add support for more
REST collections
- Parse more VM states from the OvirtVm resource
0.1.0 - June 7, 2013
====================
Changes since 0.0.3:
- Add OvirtVmDisplay::host_subject property, this is required in some cases
to connect to a VM which is using SPICE
- Add OvirtVmDisplay::smartcard and OvirtVmDisplay::allow-override
properties
- Implement ovirt_vm_refresh_async()

10
README Normal file
View File

@ -0,0 +1,10 @@
GoVirt is a GObject wrapper for the oVirt REST API [1]. It will
only provide very basic functionality as the goal is to
autogenerate a full wrapper as it is already done for the python
bindings.
NB: at this time, govirt is *NOT* considered API/ABI stable. Future
releases may still include API/ABI incompatible changes.
[1] http://ovirt.org/wiki/Category:Api
[2] http://ovirt.org/wiki/API_-_oVirt_workshop_November_2011_Notes

1564
aclocal.m4 vendored Normal file

File diff suppressed because it is too large Load Diff

11
autogen.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
PKG_NAME="govirt"
srcdir=`dirname "$0"`
which gnome-autogen.sh || {
echo "You need to install gnome-common from the GNOME git"
exit 1
}
. gnome-autogen.sh "$@"

347
build-aux/compile Executable file
View File

@ -0,0 +1,347 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2012-10-14.11; # UTC
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
nl='
'
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" "" $nl"
file_conv=
# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv/,$2, in
*,$file_conv,*)
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
func_file_conv "$1"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
}
# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
lib=$1
found=no
save_IFS=$IFS
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
lib=$dir/$lib.dll.lib
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
lib=$dir/$lib.lib
break
fi
if test -f "$dir/lib$lib.a"; then
found=yes
lib=$dir/lib$lib.a
break
fi
done
IFS=$save_IFS
if test "$found" != yes; then
lib=$lib.lib
fi
}
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
# Assume a capable shell
lib_path=
shared=:
linker_opts=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
;;
*)
func_file_conv "$2"
set x "$@" -Fe"$file"
shift
;;
esac
;;
-I)
eat=1
func_file_conv "$2" mingw
set x "$@" -I"$file"
shift
;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
-l)
eat=1
func_cl_dashl "$2"
set x "$@" "$lib"
shift
;;
-l*)
func_cl_dashl "${1#-l}"
set x "$@" "$lib"
shift
;;
-L)
eat=1
func_cl_dashL "$2"
;;
-L*)
func_cl_dashL "${1#-L}"
;;
-static)
shared=false
;;
-Wl,*)
arg=${1#-Wl,}
save_ifs="$IFS"; IFS=','
for flag in $arg; do
IFS="$save_ifs"
linker_opts="$linker_opts $flag"
done
IFS="$save_ifs"
;;
-Xlinker)
eat=1
linker_opts="$linker_opts $2"
;;
-*)
set x "$@" "$1"
shift
;;
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
func_file_conv "$1"
set x "$@" -Tp"$file"
shift
;;
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
func_file_conv "$1" mingw
set x "$@" "$file"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -n "$linker_opts"; then
linker_opts="-link$linker_opts"
fi
exec "$@" $linker_opts
exit 1
}
eat=
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file 'INSTALL'.
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
ofile=
cfile=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
# So we strip '-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no '-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# '.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory.
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

1421
build-aux/config.guess vendored Executable file

File diff suppressed because it is too large Load Diff

1807
build-aux/config.sub vendored Executable file

File diff suppressed because it is too large Load Diff

791
build-aux/depcomp Executable file
View File

@ -0,0 +1,791 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2013-05-30.07; # UTC
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by 'PROGRAMS ARGS'.
object Object file output by 'PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputting dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
# Get the directory component of the given path, and save it in the
# global variables '$dir'. Note that this directory component will
# be either empty or ending with a '/' character. This is deliberate.
set_dir_from ()
{
case $1 in
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
*) dir=;;
esac
}
# Get the suffix-stripped basename of the given path, and save it the
# global variable '$base'.
set_base_from ()
{
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
}
# If no dependency file was actually created by the compiler invocation,
# we still have to create a dummy depfile, to avoid errors with the
# Makefile "include basename.Plo" scheme.
make_dummy_depfile ()
{
echo "#dummy" > "$depfile"
}
# Factor out some common post-processing of the generated depfile.
# Requires the auxiliary global variable '$tmpdepfile' to be set.
aix_post_process_depfile ()
{
# If the compiler actually managed to produce a dependency file,
# post-process it.
if test -f "$tmpdepfile"; then
# Each line is of the form 'foo.o: dependency.h'.
# Do two passes, one to just change these to
# $object: dependency.h
# and one to simply output
# dependency.h:
# which is needed to avoid the deleted-header problem.
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
} > "$depfile"
rm -f "$tmpdepfile"
else
make_dummy_depfile
fi
}
# A tabulation character.
tab=' '
# A newline character.
nl='
'
# Character ranges might be problematic outside the C locale.
# These definitions help.
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
lower=abcdefghijklmnopqrstuvwxyz
digits=0123456789
alpha=${upper}${lower}
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Avoid interferences from the environment.
gccflag= dashmflag=
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvisualcpp
fi
if test "$depmode" = msvc7msys; then
# This is just like msvc7 but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvc7
fi
if test "$depmode" = xlc; then
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
gccflag=-qmakedep=gcc,-MF
depmode=gcc
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
## (see the conditional assignment to $gccflag above).
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say). Also, it might not be
## supported by the other compilers which use the 'gcc' depmode.
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The second -e expression handles DOS-style file names with drive
# letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the "deleted header file" problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
## Some versions of gcc put a space before the ':'. On the theory
## that the space means something, we add a space to the output as
## well. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like '#:fec' to the end of the
# dependency line.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
| tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile"
;;
xlc)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts '$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
aix_post_process_depfile
;;
tcc)
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
# FIXME: That version still under development at the moment of writing.
# Make that this statement remains true also for stable, released
# versions.
# It will wrap lines (doesn't matter whether long or short) with a
# trailing '\', as in:
#
# foo.o : \
# foo.c \
# foo.h \
#
# It will put a trailing '\' even on the last line, and will use leading
# spaces rather than leading tabs (at least since its commit 0394caf7
# "Emit spaces for -MD").
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
# We have to change lines of the first kind to '$object: \'.
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
# And for each line of the second kind, we have to emit a 'dep.h:'
# dummy dependency, to avoid the deleted-header problem.
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
## The order of this option in the case statement is important, since the
## shell code in configure will try each of these formats in the order
## listed in this file. A plain '-MD' option would be understood by many
## compilers, so we must ensure this comes after the gcc and icc options.
pgcc)
# Portland's C compiler understands '-MD'.
# Will always output deps to 'file.d' where file is the root name of the
# source file under compilation, even if file resides in a subdirectory.
# The object file name does not affect the name of the '.d' file.
# pgcc 10.2 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using '\' :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
set_dir_from "$object"
# Use the source, not the object, to determine the base name, since
# that's sadly what pgcc will do too.
set_base_from "$source"
tmpdepfile=$base.d
# For projects that build the same source file twice into different object
# files, the pgcc approach of using the *source* file root name can cause
# problems in parallel builds. Use a locking strategy to avoid stomping on
# the same $tmpdepfile.
lockdir=$base.d-lock
trap "
echo '$0: caught signal, cleaning up...' >&2
rmdir '$lockdir'
exit 1
" 1 2 13 15
numtries=100
i=$numtries
while test $i -gt 0; do
# mkdir is a portable test-and-set.
if mkdir "$lockdir" 2>/dev/null; then
# This process acquired the lock.
"$@" -MD
stat=$?
# Release the lock.
rmdir "$lockdir"
break
else
# If the lock is being held by a different process, wait
# until the winning process is done or we timeout.
while test -d "$lockdir" && test $i -gt 0; do
sleep 1
i=`expr $i - 1`
done
fi
i=`expr $i - 1`
done
trap - 1 2 13 15
if test $i -le 0; then
echo "$0: failed to acquire lock after $numtries attempts" >&2
echo "$0: check lockdir '$lockdir'" >&2
exit 1
fi
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
# Add 'dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in 'foo.d' instead, so we check for that too.
# Subdirectories are respected.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
# Libtool generates 2 separate objects for the 2 libraries. These
# two compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir$base.o.d # libtool 1.5
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
# Same post-processing that is required for AIX mode.
aix_post_process_depfile
;;
msvc7)
if test "$libtool" = yes; then
showIncludes=-Wc,-showIncludes
else
showIncludes=-showIncludes
fi
"$@" $showIncludes > "$tmpdepfile"
stat=$?
grep -v '^Note: including file: ' "$tmpdepfile"
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The first sed program below extracts the file names and escapes
# backslashes for cygpath. The second sed program outputs the file
# name when reading, but also accumulates all include files in the
# hold buffer in order to output them again at the end. This only
# works with sed implementations that can handle large buffers.
sed < "$tmpdepfile" -n '
/^Note: including file: *\(.*\)/ {
s//\1/
s/\\/\\\\/g
p
}' | $cygpath_u | sort -u | sed -n '
s/ /\\ /g
s/\(.*\)/'"$tab"'\1 \\/p
s/.\(.*\) \\/\1:/
H
$ {
s/.*/'"$tab"'/
G
p
}' >> "$depfile"
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
rm -f "$tmpdepfile"
;;
msvc7msys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for ':'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
"$@" $dashmflag |
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this sed invocation
# correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no eat=no
for arg
do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
if test $eat = yes; then
eat=no
continue
fi
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-arch)
eat=yes ;;
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix=`echo "$object" | sed 's/^.*\././'`
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
# makedepend may prepend the VPATH from the source file name to the object.
# No need to regex-escape $object, excess matching of '.' is harmless.
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process the last invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed '1,2d' "$tmpdepfile" \
| tr ' ' "$nl" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E \
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
| sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
IFS=" "
for arg
do
case "$arg" in
-o)
shift
;;
$object)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
echo "$tab" >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvcmsys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

501
build-aux/install-sh Executable file
View File

@ -0,0 +1,501 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2013-12-25.23; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# 'make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
tab=' '
nl='
'
IFS=" $tab$nl"
# Set DOITPROG to "echo" to test this script.
doit=${DOITPROG-}
doit_exec=${doit:-exec}
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
is_target_a_directory=possibly
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t)
is_target_a_directory=always
dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.
if test -n "$dir_arg"; then
if test -n "$dst_arg"; then
echo "$0: target directory not allowed when installing a directory." >&2
exit 1
fi
fi
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
if test $# -gt 1 || test "$is_target_a_directory" = always; then
if test ! -d "$dst_arg"; then
echo "$0: $dst_arg: Is not a directory." >&2
exit 1
fi
fi
fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names problematic for 'test' and other utilities.
case $src in
-* | [=\(\)!]) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
dstdir=`dirname "$dst"`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
oIFS=$IFS
IFS=/
set -f
set fnord $dstdir
shift
set +f
IFS=$oIFS
prefixes=
for d
do
test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

11147
build-aux/ltmain.sh Normal file

File diff suppressed because it is too large Load Diff

215
build-aux/missing Executable file
View File

@ -0,0 +1,215 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
scriptversion=2013-10-28.13; # UTC
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try '$0 --help' for more information"
exit 1
fi
case $1 in
--is-lightweight)
# Used by our autoconf macros to check whether the available missing
# script is modern enough.
exit 0
;;
--run)
# Back-compat with the calling convention used by older automake.
shift
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
to PROGRAM being missing or too old.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
Supported PROGRAM values:
aclocal autoconf autoheader autom4te automake makeinfo
bison yacc flex lex help2man
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
'g' are ignored when checking the name.
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: unknown '$1' option"
echo 1>&2 "Try '$0 --help' for more information"
exit 1
;;
esac
# Run the given program, remember its exit status.
"$@"; st=$?
# If it succeeded, we are done.
test $st -eq 0 && exit 0
# Also exit now if we it failed (or wasn't found), and '--version' was
# passed; such an option is passed most likely to detect whether the
# program is present and works.
case $2 in --version|--help) exit $st;; esac
# Exit code 63 means version mismatch. This often happens when the user
# tries to use an ancient version of a tool on a file that requires a
# minimum version.
if test $st -eq 63; then
msg="probably too old"
elif test $st -eq 127; then
# Program was missing.
msg="missing on your system"
else
# Program was found and executed, but failed. Give up.
exit $st
fi
perl_URL=http://www.perl.org/
flex_URL=http://flex.sourceforge.net/
gnu_software_URL=http://www.gnu.org/software
program_details ()
{
case $1 in
aclocal|automake)
echo "The '$1' program is part of the GNU Automake package:"
echo "<$gnu_software_URL/automake>"
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/autoconf>"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
autoconf|autom4te|autoheader)
echo "The '$1' program is part of the GNU Autoconf package:"
echo "<$gnu_software_URL/autoconf/>"
echo "It also requires GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
esac
}
give_advice ()
{
# Normalize program name to check for.
normalized_program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
printf '%s\n' "'$1' is $msg."
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
case $normalized_program in
autoconf*)
echo "You should only need it if you modified 'configure.ac',"
echo "or m4 files included by it."
program_details 'autoconf'
;;
autoheader*)
echo "You should only need it if you modified 'acconfig.h' or"
echo "$configure_deps."
program_details 'autoheader'
;;
automake*)
echo "You should only need it if you modified 'Makefile.am' or"
echo "$configure_deps."
program_details 'automake'
;;
aclocal*)
echo "You should only need it if you modified 'acinclude.m4' or"
echo "$configure_deps."
program_details 'aclocal'
;;
autom4te*)
echo "You might have modified some maintainer files that require"
echo "the 'autom4te' program to be rebuilt."
program_details 'autom4te'
;;
bison*|yacc*)
echo "You should only need it if you modified a '.y' file."
echo "You may want to install the GNU Bison package:"
echo "<$gnu_software_URL/bison/>"
;;
lex*|flex*)
echo "You should only need it if you modified a '.l' file."
echo "You may want to install the Fast Lexical Analyzer package:"
echo "<$flex_URL>"
;;
help2man*)
echo "You should only need it if you modified a dependency" \
"of a man page."
echo "You may want to install the GNU Help2man package:"
echo "<$gnu_software_URL/help2man/>"
;;
makeinfo*)
echo "You should only need it if you modified a '.texi' file, or"
echo "any other file indirectly affecting the aspect of the manual."
echo "You might want to install the Texinfo package:"
echo "<$gnu_software_URL/texinfo/>"
echo "The spurious makeinfo call might also be the consequence of"
echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
echo "want to install GNU make:"
echo "<$gnu_software_URL/make/>"
;;
*)
echo "You might have modified some files without having the proper"
echo "tools for further handling them. Check the 'README' file, it"
echo "often tells you about the needed prerequisites for installing"
echo "this package. You may also peek at any GNU archive site, in"
echo "case some other package contains this missing '$1' program."
;;
esac
}
give_advice "$1" | sed -e '1s/^/WARNING: /' \
-e '2,$s/^/ /' >&2
# Propagate the correct exit status (expected to be 127 for a program
# not found, 63 for a program that failed due to version mismatch).
exit $st
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

148
build-aux/test-driver Executable file
View File

@ -0,0 +1,148 @@
#! /bin/sh
# test-driver - basic testsuite driver script.
scriptversion=2013-07-13.22; # UTC
# Copyright (C) 2011-2014 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
# Make unconditional expansion of undefined variables an error. This
# helps a lot in preventing typo-related bugs.
set -u
usage_error ()
{
echo "$0: $*" >&2
print_usage >&2
exit 2
}
print_usage ()
{
cat <<END
Usage:
test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
[--expect-failure={yes|no}] [--color-tests={yes|no}]
[--enable-hard-errors={yes|no}] [--]
TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
The '--test-name', '--log-file' and '--trs-file' options are mandatory.
END
}
test_name= # Used for reporting.
log_file= # Where to save the output of the test script.
trs_file= # Where to save the metadata of the test run.
expect_failure=no
color_tests=no
enable_hard_errors=yes
while test $# -gt 0; do
case $1 in
--help) print_usage; exit $?;;
--version) echo "test-driver $scriptversion"; exit $?;;
--test-name) test_name=$2; shift;;
--log-file) log_file=$2; shift;;
--trs-file) trs_file=$2; shift;;
--color-tests) color_tests=$2; shift;;
--expect-failure) expect_failure=$2; shift;;
--enable-hard-errors) enable_hard_errors=$2; shift;;
--) shift; break;;
-*) usage_error "invalid option: '$1'";;
*) break;;
esac
shift
done
missing_opts=
test x"$test_name" = x && missing_opts="$missing_opts --test-name"
test x"$log_file" = x && missing_opts="$missing_opts --log-file"
test x"$trs_file" = x && missing_opts="$missing_opts --trs-file"
if test x"$missing_opts" != x; then
usage_error "the following mandatory options are missing:$missing_opts"
fi
if test $# -eq 0; then
usage_error "missing argument"
fi
if test $color_tests = yes; then
# Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
red='' # Red.
grn='' # Green.
lgn='' # Light green.
blu='' # Blue.
mgn='' # Magenta.
std='' # No color.
else
red= grn= lgn= blu= mgn= std=
fi
do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
trap "st=129; $do_exit" 1
trap "st=130; $do_exit" 2
trap "st=141; $do_exit" 13
trap "st=143; $do_exit" 15
# Test script is run here.
"$@" >$log_file 2>&1
estatus=$?
if test $enable_hard_errors = no && test $estatus -eq 99; then
tweaked_estatus=1
else
tweaked_estatus=$estatus
fi
case $tweaked_estatus:$expect_failure in
0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
0:*) col=$grn res=PASS recheck=no gcopy=no;;
77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
*:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
*:*) col=$red res=FAIL recheck=yes gcopy=yes;;
esac
# Report the test outcome and exit status in the logs, so that one can
# know whether the test passed or failed simply by looking at the '.log'
# file, without the need of also peaking into the corresponding '.trs'
# file (automake bug#11814).
echo "$res $test_name (exit status: $estatus)" >>$log_file
# Report outcome to console.
echo "${col}${res}${std}: $test_name"
# Register the test result, and other relevant metadata.
echo ":test-result: $res" > $trs_file
echo ":global-test-result: $res" >> $trs_file
echo ":recheck: $recheck" >> $trs_file
echo ":copy-in-global-log: $gcopy" >> $trs_file
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

64
config.h.in Normal file
View File

@ -0,0 +1,64 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* The name of the gettext domain */
#undef GETTEXT_PACKAGE
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#undef LT_OBJDIR
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION

15450
configure vendored Executable file

File diff suppressed because it is too large Load Diff

140
configure.ac Normal file
View File

@ -0,0 +1,140 @@
# Copyright (C) 2010 Richard Hughes <richard@hughsie.com>
# Copyright (C) 2011 Christophe Fergeau <cfergeau@redhat.com>
AC_PREREQ(2.63)
m4_define([govirt_major_version], [0])
m4_define([govirt_minor_version], [3])
m4_define([govirt_micro_version], [4])
m4_define([govirt_version],
[govirt_major_version.govirt_minor_version.govirt_micro_version])
AC_INIT([libgovirt],[govirt_version])
AC_CONFIG_SRCDIR(govirt)
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz tar-ustar])
AM_SILENT_RULES([yes])
# use this in cd-version.h
G_OVIRT_MAJOR_VERSION=govirt_major_version
G_OVIRT_MINOR_VERSION=govirt_minor_version
G_OVIRT_MICRO_VERSION=govirt_micro_version
AC_SUBST(G_OVIRT_MAJOR_VERSION)
AC_SUBST(G_OVIRT_MINOR_VERSION)
AC_SUBST(G_OVIRT_MICRO_VERSION)
# libtool versioning - this applies to libgovirt
#
# See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91
# for details
#
# increment;
# CURRENT If the API or ABI interface has changed (reset REVISION to 0)
# REVISION If the API and ABI remains the same, but bugs are fixed.
# AGE Don't use.
LT_CURRENT=3
LT_REVISION=0
LT_AGE=1
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
# Check for programs
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_INSTALL
# Initialize libtool
LT_PREREQ([2.2])
LT_INIT
# i18 support
IT_PROG_INTLTOOL(0.40.0)
GETTEXT_PACKAGE=AC_PACKAGE_NAME
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[The name of the gettext domain])
dnl ---------------------------------------------------------------------------
dnl - Extra verbose warning switches
dnl ---------------------------------------------------------------------------
if test "$GCC" = "yes"; then
WARNINGFLAGS_C="$WARNINGFLAGS_C -Wall"
WARNINGFLAGS_C="$WARNINGFLAGS_C -Wcast-align -Wno-uninitialized"
WARNINGFLAGS_C="$WARNINGFLAGS_C -Wmissing-declarations"
WARNINGFLAGS_C="$WARNINGFLAGS_C -Wpointer-arith"
WARNINGFLAGS_C="$WARNINGFLAGS_C -Wcast-align"
WARNINGFLAGS_C="$WARNINGFLAGS_C -Wwrite-strings"
WARNINGFLAGS_C="$WARNINGFLAGS_C -Winit-self"
WARNINGFLAGS_C="$WARNINGFLAGS_C -Wreturn-type"
WARNINGFLAGS_C="$WARNINGFLAGS_C -Wformat-nonliteral"
WARNINGFLAGS_C="$WARNINGFLAGS_C -Wformat-security"
WARNINGFLAGS_C="$WARNINGFLAGS_C -Wmissing-include-dirs"
WARNINGFLAGS_C="$WARNINGFLAGS_C -Wmissing-format-attribute"
WARNINGFLAGS_C="$WARNINGFLAGS_C -Wclobbered"
WARNINGFLAGS_C="$WARNINGFLAGS_C -Wempty-body"
WARNINGFLAGS_C="$WARNINGFLAGS_C -Wignored-qualifiers"
WARNINGFLAGS_C="$WARNINGFLAGS_C -Wsign-compare"
WARNINGFLAGS_C="$WARNINGFLAGS_C -Wtype-limits"
WARNINGFLAGS_C="$WARNINGFLAGS_C -Wuninitialized"
WARNINGFLAGS_C="$WARNINGFLAGS_C -Waggregate-return"
WARNINGFLAGS_C="$WARNINGFLAGS_C -Wdeclaration-after-statement"
WARNINGFLAGS_C="$WARNINGFLAGS_C -Wshadow"
WARNINGFLAGS_C="$WARNINGFLAGS_C -Wno-strict-aliasing"
WARNINGFLAGS_C="$WARNINGFLAGS_C -Winline"
WARNINGFLAGS_C="$WARNINGFLAGS_C -Wmissing-parameter-type"
WARNINGFLAGS_C="$WARNINGFLAGS_C -Woverride-init"
else
WARNINGFLAGS_C=""
fi
AC_SUBST(WARNINGFLAGS_C)
dnl ---------------------------------------------------------------------------
dnl - Check library dependencies
dnl ---------------------------------------------------------------------------
PKG_CHECK_MODULES([GLIB], [gobject-2.0 gio-2.0 gthread-2.0 >= 2.26.0])
# Setup GLIB_MKENUMS to use glib-mkenums even if GLib is uninstalled.
GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
AC_SUBST(GLIB_MKENUMS)
GOBJECT_INTROSPECTION_CHECK([1.30.0])
dnl **** Check for librest ****
PKG_CHECK_MODULES([REST], [rest-0.7 >= 0.7.92])
dnl ---------------------------------------------------------------------------
dnl - Build self tests
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests],[enable unit test code]),
enable_tests=$enableval,enable_tests=yes)
AM_CONDITIONAL(GOVIRT_BUILD_TESTS, test x$enable_tests = xyes)
dnl ---------------------------------------------------------------------------
dnl - Makefiles, etc.
dnl ---------------------------------------------------------------------------
AC_CONFIG_FILES([
Makefile
examples/Makefile
govirt/govirt-1.0.pc
govirt/Makefile
po/Makefile.in
tests/Makefile
])
AC_OUTPUT
dnl ==========================================================================
echo "
libgovirt $VERSION
===============
prefix: ${prefix}
datadir: ${datadir}
compiler: ${CC}
cflags: ${CFLAGS}
cppflags: ${CPPFLAGS}
"

53
examples/Makefile.am Normal file
View File

@ -0,0 +1,53 @@
noinst_PROGRAMS = async-test sync-test list-vms list-vms-async
EXTRA_DIST =
sync_test_CFLAGS = \
$(WARNINGFLAGS_C) \
$(GLIB_CFLAGS) \
$(REST_CFLAGS) \
-I$(top_srcdir)
sync_test_SOURCES = \
sync-test.c
sync_test_LDADD = \
../govirt/libgovirt.la \
$(GLIB_LIBS) \
$(REST_LIBS)
async_test_CFLAGS = \
$(WARNINGFLAGS_C) \
$(GLIB_CFLAGS) \
$(REST_CFLAGS) \
-I$(top_srcdir)
async_test_SOURCES = \
async-test.c
async_test_LDADD = \
../govirt/libgovirt.la \
$(GLIB_LIBS) \
$(REST_LIBS)
list_vms_CFLAGS = \
$(WARNINGFLAGS_C) \
$(GLIB_CFLAGS) \
$(REST_CFLAGS) \
-I$(top_srcdir)
list_vms_SOURCES = \
list-vms.c
list_vms_LDADD = \
../govirt/libgovirt.la \
$(GLIB_LIBS) \
$(REST_LIBS)
list_vms_async_CFLAGS = \
$(WARNINGFLAGS_C) \
$(GLIB_CFLAGS) \
$(REST_CFLAGS) \
-I$(top_srcdir)
list_vms_async_SOURCES = \
list-vms-async.c
list_vms_async_LDADD = \
../govirt/libgovirt.la \
$(GLIB_LIBS) \
$(REST_LIBS)
-include $(top_srcdir)/git.mk

781
examples/Makefile.in Normal file
View File

@ -0,0 +1,781 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
noinst_PROGRAMS = async-test$(EXEEXT) sync-test$(EXEEXT) \
list-vms$(EXEEXT) list-vms-async$(EXEEXT)
subdir = examples
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/intltool.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
PROGRAMS = $(noinst_PROGRAMS)
am_async_test_OBJECTS = async_test-async-test.$(OBJEXT)
async_test_OBJECTS = $(am_async_test_OBJECTS)
am__DEPENDENCIES_1 =
async_test_DEPENDENCIES = ../govirt/libgovirt.la $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
async_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(async_test_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
am_list_vms_OBJECTS = list_vms-list-vms.$(OBJEXT)
list_vms_OBJECTS = $(am_list_vms_OBJECTS)
list_vms_DEPENDENCIES = ../govirt/libgovirt.la $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
list_vms_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(list_vms_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
am_list_vms_async_OBJECTS = list_vms_async-list-vms-async.$(OBJEXT)
list_vms_async_OBJECTS = $(am_list_vms_async_OBJECTS)
list_vms_async_DEPENDENCIES = ../govirt/libgovirt.la \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
list_vms_async_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(list_vms_async_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \
$@
am_sync_test_OBJECTS = sync_test-sync-test.$(OBJEXT)
sync_test_OBJECTS = $(am_sync_test_OBJECTS)
sync_test_DEPENDENCIES = ../govirt/libgovirt.la $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
sync_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(sync_test_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(async_test_SOURCES) $(list_vms_SOURCES) \
$(list_vms_async_SOURCES) $(sync_test_SOURCES)
DIST_SOURCES = $(async_test_SOURCES) $(list_vms_SOURCES) \
$(list_vms_async_SOURCES) $(sync_test_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/build-aux/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ALL_LINGUAS = @ALL_LINGUAS@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_LIBS = @GLIB_LIBS@
GLIB_MKENUMS = @GLIB_MKENUMS@
GMSGFMT = @GMSGFMT@
GREP = @GREP@
G_OVIRT_MAJOR_VERSION = @G_OVIRT_MAJOR_VERSION@
G_OVIRT_MICRO_VERSION = @G_OVIRT_MICRO_VERSION@
G_OVIRT_MINOR_VERSION = @G_OVIRT_MINOR_VERSION@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
INTLTOOL_MERGE = @INTLTOOL_MERGE@
INTLTOOL_PERL = @INTLTOOL_PERL@
INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@
INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@
INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@
INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@
INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@
INTROSPECTION_LIBS = @INTROSPECTION_LIBS@
INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_AGE = @LT_AGE@
LT_CURRENT = @LT_CURRENT@
LT_REVISION = @LT_REVISION@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGMERGE = @MSGMERGE@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
REST_CFLAGS = @REST_CFLAGS@
REST_LIBS = @REST_LIBS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
WARNINGFLAGS_C = @WARNINGFLAGS_C@
XGETTEXT = @XGETTEXT@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
intltool__v_merge_options_ = @intltool__v_merge_options_@
intltool__v_merge_options_0 = @intltool__v_merge_options_0@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST =
sync_test_CFLAGS = \
$(WARNINGFLAGS_C) \
$(GLIB_CFLAGS) \
$(REST_CFLAGS) \
-I$(top_srcdir)
sync_test_SOURCES = \
sync-test.c
sync_test_LDADD = \
../govirt/libgovirt.la \
$(GLIB_LIBS) \
$(REST_LIBS)
async_test_CFLAGS = \
$(WARNINGFLAGS_C) \
$(GLIB_CFLAGS) \
$(REST_CFLAGS) \
-I$(top_srcdir)
async_test_SOURCES = \
async-test.c
async_test_LDADD = \
../govirt/libgovirt.la \
$(GLIB_LIBS) \
$(REST_LIBS)
list_vms_CFLAGS = \
$(WARNINGFLAGS_C) \
$(GLIB_CFLAGS) \
$(REST_CFLAGS) \
-I$(top_srcdir)
list_vms_SOURCES = \
list-vms.c
list_vms_LDADD = \
../govirt/libgovirt.la \
$(GLIB_LIBS) \
$(REST_LIBS)
list_vms_async_CFLAGS = \
$(WARNINGFLAGS_C) \
$(GLIB_CFLAGS) \
$(REST_CFLAGS) \
-I$(top_srcdir)
list_vms_async_SOURCES = \
list-vms-async.c
list_vms_async_LDADD = \
../govirt/libgovirt.la \
$(GLIB_LIBS) \
$(REST_LIBS)
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu examples/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
clean-noinstPROGRAMS:
@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
echo " rm -f" $$list; \
rm -f $$list || exit $$?; \
test -n "$(EXEEXT)" || exit 0; \
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
async-test$(EXEEXT): $(async_test_OBJECTS) $(async_test_DEPENDENCIES) $(EXTRA_async_test_DEPENDENCIES)
@rm -f async-test$(EXEEXT)
$(AM_V_CCLD)$(async_test_LINK) $(async_test_OBJECTS) $(async_test_LDADD) $(LIBS)
list-vms$(EXEEXT): $(list_vms_OBJECTS) $(list_vms_DEPENDENCIES) $(EXTRA_list_vms_DEPENDENCIES)
@rm -f list-vms$(EXEEXT)
$(AM_V_CCLD)$(list_vms_LINK) $(list_vms_OBJECTS) $(list_vms_LDADD) $(LIBS)
list-vms-async$(EXEEXT): $(list_vms_async_OBJECTS) $(list_vms_async_DEPENDENCIES) $(EXTRA_list_vms_async_DEPENDENCIES)
@rm -f list-vms-async$(EXEEXT)
$(AM_V_CCLD)$(list_vms_async_LINK) $(list_vms_async_OBJECTS) $(list_vms_async_LDADD) $(LIBS)
sync-test$(EXEEXT): $(sync_test_OBJECTS) $(sync_test_DEPENDENCIES) $(EXTRA_sync_test_DEPENDENCIES)
@rm -f sync-test$(EXEEXT)
$(AM_V_CCLD)$(sync_test_LINK) $(sync_test_OBJECTS) $(sync_test_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/async_test-async-test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list_vms-list-vms.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list_vms_async-list-vms-async.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync_test-sync-test.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
async_test-async-test.o: async-test.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(async_test_CFLAGS) $(CFLAGS) -MT async_test-async-test.o -MD -MP -MF $(DEPDIR)/async_test-async-test.Tpo -c -o async_test-async-test.o `test -f 'async-test.c' || echo '$(srcdir)/'`async-test.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/async_test-async-test.Tpo $(DEPDIR)/async_test-async-test.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='async-test.c' object='async_test-async-test.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(async_test_CFLAGS) $(CFLAGS) -c -o async_test-async-test.o `test -f 'async-test.c' || echo '$(srcdir)/'`async-test.c
async_test-async-test.obj: async-test.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(async_test_CFLAGS) $(CFLAGS) -MT async_test-async-test.obj -MD -MP -MF $(DEPDIR)/async_test-async-test.Tpo -c -o async_test-async-test.obj `if test -f 'async-test.c'; then $(CYGPATH_W) 'async-test.c'; else $(CYGPATH_W) '$(srcdir)/async-test.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/async_test-async-test.Tpo $(DEPDIR)/async_test-async-test.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='async-test.c' object='async_test-async-test.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(async_test_CFLAGS) $(CFLAGS) -c -o async_test-async-test.obj `if test -f 'async-test.c'; then $(CYGPATH_W) 'async-test.c'; else $(CYGPATH_W) '$(srcdir)/async-test.c'; fi`
list_vms-list-vms.o: list-vms.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(list_vms_CFLAGS) $(CFLAGS) -MT list_vms-list-vms.o -MD -MP -MF $(DEPDIR)/list_vms-list-vms.Tpo -c -o list_vms-list-vms.o `test -f 'list-vms.c' || echo '$(srcdir)/'`list-vms.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/list_vms-list-vms.Tpo $(DEPDIR)/list_vms-list-vms.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='list-vms.c' object='list_vms-list-vms.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(list_vms_CFLAGS) $(CFLAGS) -c -o list_vms-list-vms.o `test -f 'list-vms.c' || echo '$(srcdir)/'`list-vms.c
list_vms-list-vms.obj: list-vms.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(list_vms_CFLAGS) $(CFLAGS) -MT list_vms-list-vms.obj -MD -MP -MF $(DEPDIR)/list_vms-list-vms.Tpo -c -o list_vms-list-vms.obj `if test -f 'list-vms.c'; then $(CYGPATH_W) 'list-vms.c'; else $(CYGPATH_W) '$(srcdir)/list-vms.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/list_vms-list-vms.Tpo $(DEPDIR)/list_vms-list-vms.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='list-vms.c' object='list_vms-list-vms.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(list_vms_CFLAGS) $(CFLAGS) -c -o list_vms-list-vms.obj `if test -f 'list-vms.c'; then $(CYGPATH_W) 'list-vms.c'; else $(CYGPATH_W) '$(srcdir)/list-vms.c'; fi`
list_vms_async-list-vms-async.o: list-vms-async.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(list_vms_async_CFLAGS) $(CFLAGS) -MT list_vms_async-list-vms-async.o -MD -MP -MF $(DEPDIR)/list_vms_async-list-vms-async.Tpo -c -o list_vms_async-list-vms-async.o `test -f 'list-vms-async.c' || echo '$(srcdir)/'`list-vms-async.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/list_vms_async-list-vms-async.Tpo $(DEPDIR)/list_vms_async-list-vms-async.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='list-vms-async.c' object='list_vms_async-list-vms-async.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(list_vms_async_CFLAGS) $(CFLAGS) -c -o list_vms_async-list-vms-async.o `test -f 'list-vms-async.c' || echo '$(srcdir)/'`list-vms-async.c
list_vms_async-list-vms-async.obj: list-vms-async.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(list_vms_async_CFLAGS) $(CFLAGS) -MT list_vms_async-list-vms-async.obj -MD -MP -MF $(DEPDIR)/list_vms_async-list-vms-async.Tpo -c -o list_vms_async-list-vms-async.obj `if test -f 'list-vms-async.c'; then $(CYGPATH_W) 'list-vms-async.c'; else $(CYGPATH_W) '$(srcdir)/list-vms-async.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/list_vms_async-list-vms-async.Tpo $(DEPDIR)/list_vms_async-list-vms-async.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='list-vms-async.c' object='list_vms_async-list-vms-async.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(list_vms_async_CFLAGS) $(CFLAGS) -c -o list_vms_async-list-vms-async.obj `if test -f 'list-vms-async.c'; then $(CYGPATH_W) 'list-vms-async.c'; else $(CYGPATH_W) '$(srcdir)/list-vms-async.c'; fi`
sync_test-sync-test.o: sync-test.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sync_test_CFLAGS) $(CFLAGS) -MT sync_test-sync-test.o -MD -MP -MF $(DEPDIR)/sync_test-sync-test.Tpo -c -o sync_test-sync-test.o `test -f 'sync-test.c' || echo '$(srcdir)/'`sync-test.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sync_test-sync-test.Tpo $(DEPDIR)/sync_test-sync-test.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sync-test.c' object='sync_test-sync-test.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sync_test_CFLAGS) $(CFLAGS) -c -o sync_test-sync-test.o `test -f 'sync-test.c' || echo '$(srcdir)/'`sync-test.c
sync_test-sync-test.obj: sync-test.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sync_test_CFLAGS) $(CFLAGS) -MT sync_test-sync-test.obj -MD -MP -MF $(DEPDIR)/sync_test-sync-test.Tpo -c -o sync_test-sync-test.obj `if test -f 'sync-test.c'; then $(CYGPATH_W) 'sync-test.c'; else $(CYGPATH_W) '$(srcdir)/sync-test.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sync_test-sync-test.Tpo $(DEPDIR)/sync_test-sync-test.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sync-test.c' object='sync_test-sync-test.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sync_test_CFLAGS) $(CFLAGS) -c -o sync_test-sync-test.obj `if test -f 'sync-test.c'; then $(CYGPATH_W) 'sync-test.c'; else $(CYGPATH_W) '$(srcdir)/sync-test.c'; fi`
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \
ctags-am distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile
-include $(top_srcdir)/git.mk
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

317
examples/async-test.c Normal file
View File

@ -0,0 +1,317 @@
/* Copyright 2013 Red Hat, Inc. and/or its affiliates.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <stdlib.h>
#include <govirt/govirt.h>
#include "govirt/glib-compat.h"
static GMainLoop *main_loop;
typedef struct {
OvirtProxy *proxy;
const char *vm_name;
} AsyncData;
static AsyncData *async_data;
static gboolean
authenticate_cb(RestProxy *proxy, G_GNUC_UNUSED RestProxyAuth *auth,
gboolean retrying, gpointer user_data)
{
if (retrying)
return FALSE;
g_debug("setting username to %s", g_getenv("LIBGOVIRT_TEST_USERNAME"));
g_object_set(G_OBJECT(proxy),
"username", g_getenv("LIBGOVIRT_TEST_USERNAME"),
"password", g_getenv("LIBGOVIRT_TEST_PASSWORD"),
NULL);
return TRUE;
}
static void updated_cdrom_cb(GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
GError *error = NULL;
g_debug("updated cdrom cb");
ovirt_cdrom_update_finish(OVIRT_CDROM(source_object),
result, &error);
if (error != NULL) {
g_debug("failed to update cdrom resource: %s", error->message);
g_error_free(error);
}
g_main_loop_quit(main_loop);
}
static void cdroms_fetched_cb(GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
OvirtCollection *cdroms = OVIRT_COLLECTION(source_object);
GError *error = NULL;
GHashTableIter resources;
gpointer value;
AsyncData *data = (AsyncData *)user_data;
g_debug("fetched CDROMs");
ovirt_collection_fetch_finish(cdroms, result, &error);
if (error != NULL) {
g_debug("failed to fetch cdroms collection: %s", error->message);
g_error_free(error);
g_main_loop_quit(main_loop);
return;
}
g_debug("updating CDROM");
g_hash_table_iter_init(&resources, ovirt_collection_get_resources(cdroms));
while (g_hash_table_iter_next(&resources, NULL, &value)) {
OvirtCdrom *cdrom;
g_assert(OVIRT_IS_CDROM(value));
cdrom = OVIRT_CDROM(value);
g_object_set(G_OBJECT(cdrom), "file", "newimage.iso", NULL);
ovirt_cdrom_update_async(OVIRT_CDROM(cdrom), FALSE, data->proxy, NULL,
updated_cdrom_cb, user_data);
}
}
static void got_ticket_cb(GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
GError *error = NULL;
OvirtVm *vm;
OvirtVmDisplay *display;
char *host = NULL;
guint port;
guint secure_port;
OvirtVmDisplayType type;
gchar *ticket = NULL;
OvirtCollection *cdroms;
AsyncData *data = (AsyncData *)user_data;
g_debug("Got ticket");
vm = OVIRT_VM(source_object);
ovirt_vm_get_ticket_finish(vm, result, &error);
if (error != NULL) {
g_debug("failed to fetch ticket for VM: %s", error->message);
g_error_free(error);
g_main_loop_quit(main_loop);
return;
}
g_object_get(G_OBJECT(vm), "display", &display, NULL);
if (display == NULL) {
g_debug("no display for VM");
g_main_loop_quit(main_loop);
return;
}
g_object_get(G_OBJECT(display),
"type", &type,
"address", &host,
"port", &port,
"secure-port", &secure_port,
"ticket", &ticket,
NULL);
g_object_unref(G_OBJECT(display));
g_print("Connection info for VM:\n");
g_print("\tConnection type: %s\n",
(type == OVIRT_VM_DISPLAY_SPICE?"spice":"vnc"));
g_print("\tVM IP address: %s\n", host);
g_print("\tPort: %d\n", port);
g_print("\tSecure port: %d\n", secure_port);
g_print("\tTicket: %s\n", ticket);
g_free(host);
g_free(ticket);
cdroms = ovirt_vm_get_cdroms(vm);
g_assert(cdroms != NULL);
ovirt_collection_fetch_async(cdroms, data->proxy, NULL,
cdroms_fetched_cb, data);
}
static void vm_started_cb(GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
GError *error = NULL;
OvirtVm *vm;
AsyncData *data = (AsyncData *)user_data;
g_debug("Started VM");
vm = OVIRT_VM(source_object);
ovirt_vm_start_finish(vm, result, &error);
if (error != NULL) {
g_debug("failed to start VM: %s", error->message);
g_error_free(error);
g_main_loop_quit(main_loop);
return;
}
ovirt_vm_get_ticket_async(vm, data->proxy, NULL, got_ticket_cb, data);
}
static void vms_fetched_cb(GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
GError *error = NULL;
OvirtCollection *vms;
OvirtVm *vm;
OvirtVmState state;
AsyncData *data = (AsyncData *)user_data;
g_debug("Fetched VMs");
vms = OVIRT_COLLECTION(source_object);
ovirt_collection_fetch_finish(vms, result, &error);
if (error != NULL) {
g_debug("failed to fetch VMs: %s", error->message);
g_error_free(error);
g_main_loop_quit(main_loop);
return;
}
vm = OVIRT_VM(ovirt_collection_lookup_resource(vms, data->vm_name));
if (vm == NULL) {
g_debug("could not find VM '%s'", data->vm_name);
g_main_loop_quit(main_loop);
return;
}
g_return_if_fail(vm != NULL);
g_object_get(G_OBJECT(vm), "state", &state, NULL);
if (state != OVIRT_VM_STATE_UP) {
ovirt_vm_start_async(vm, data->proxy, NULL, vm_started_cb, data);
if (error != NULL) {
g_debug("failed to start VM: %s", error->message);
g_error_free(error);
g_main_loop_quit(main_loop);
return;
}
} else {
ovirt_vm_get_ticket_async(vm, data->proxy, NULL, got_ticket_cb, data);
}
g_object_unref(vm);
}
static void api_fetched_cb(GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
GError *error = NULL;
OvirtProxy *proxy;
OvirtApi *api;
OvirtCollection *vms;
g_debug("Fetched API");
proxy = OVIRT_PROXY(source_object);
api = ovirt_proxy_fetch_api_finish(proxy, result, &error);
if (error != NULL) {
g_debug("failed to fetch api: %s", error->message);
g_error_free(error);
g_main_loop_quit(main_loop);
return;
}
vms = ovirt_api_get_vms(api);
g_assert(vms != NULL);
ovirt_collection_fetch_async(vms, proxy, NULL, vms_fetched_cb, user_data);
}
static void fetched_ca_cert_cb(GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
GError *error = NULL;
GByteArray *ca_cert;
OvirtProxy *proxy;
g_debug("Fetched CA certificate");
proxy = OVIRT_PROXY(source_object);
ca_cert = ovirt_proxy_fetch_ca_certificate_finish(proxy, result, &error);
if (error != NULL) {
g_debug("failed to get CA certificate: %s", error->message);
g_error_free(error);
g_main_loop_quit(main_loop);
return;
}
if (ca_cert == NULL) {
g_debug("failed to get CA certificate");
g_main_loop_quit(main_loop);
return;
}
g_print("\tCA certificate: %p\n", ca_cert);
g_byte_array_unref(ca_cert);
ovirt_proxy_fetch_api_async(proxy, NULL, api_fetched_cb, user_data);
}
static gboolean start(gpointer user_data)
{
char **argv = (char **)user_data;
OvirtProxy *proxy = NULL;
proxy = ovirt_proxy_new (argv[1]);
if (proxy == NULL)
return -1;
g_signal_connect(G_OBJECT(proxy), "authenticate",
G_CALLBACK(authenticate_cb), NULL);
async_data = g_new0(AsyncData, 1);
async_data->proxy = proxy;
async_data->vm_name = argv[2];
ovirt_proxy_fetch_ca_certificate_async(proxy, NULL,
fetched_ca_cert_cb,
async_data);
return G_SOURCE_REMOVE;
}
int main(int argc, char **argv)
{
g_type_init();
if (argc != 3) {
g_print("Usage: %s URI VM-NAME\n", argv[0]);
exit(1);
}
g_idle_add(start, argv);
main_loop = g_main_loop_new(NULL, FALSE);
g_main_loop_run(main_loop);
g_main_loop_unref(main_loop);
if (async_data != NULL) {
if (async_data->proxy != NULL) {
g_object_unref(async_data->proxy);
}
g_free(async_data);
}
return 0;
}

212
examples/list-vms-async.c Normal file
View File

@ -0,0 +1,212 @@
/* Copyright 2013 Red Hat, Inc. and/or its affiliates.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <stdlib.h>
#include <govirt/govirt.h>
#include "govirt/glib-compat.h"
static GMainLoop *main_loop;
typedef struct {
const char *uri;
OvirtProxy *proxy;
OvirtApi *api;
} AsyncData;
static gboolean
authenticate_cb(RestProxy *proxy, G_GNUC_UNUSED RestProxyAuth *auth,
gboolean retrying, gpointer user_data)
{
if (retrying)
return FALSE;
g_debug("setting username to %s", g_getenv("LIBGOVIRT_TEST_USERNAME"));
g_object_set(G_OBJECT(proxy),
"username", g_getenv("LIBGOVIRT_TEST_USERNAME"),
"password", g_getenv("LIBGOVIRT_TEST_PASSWORD"),
NULL);
return TRUE;
}
static void dump_resource(gpointer key, gpointer value, gpointer user_data)
{
g_assert(OVIRT_IS_RESOURCE(value));
g_print("\t%s\n", (char *)key);
}
static void dump_collection(OvirtCollection *collection)
{
GHashTable *resources;
resources = ovirt_collection_get_resources(collection);
g_hash_table_foreach(resources, dump_resource, NULL);
}
static void pools_fetched_cb(GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
GError *error = NULL;
OvirtCollection *pools;
g_debug("Fetched pools");
pools = OVIRT_COLLECTION(source_object);
ovirt_collection_fetch_finish(pools, result, &error);
if (error != NULL) {
g_debug("failed to fetch pools: %s", error->message);
g_error_free(error);
g_main_loop_quit(main_loop);
return;
}
g_print("Pools:\n");
dump_collection(pools);
g_main_loop_quit(main_loop);
}
static void vms_fetched_cb(GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
GError *error = NULL;
OvirtCollection *vms;
OvirtCollection *pools;
AsyncData *data = (AsyncData *)user_data;
g_debug("Fetched VMs");
vms = OVIRT_COLLECTION(source_object);
ovirt_collection_fetch_finish(vms, result, &error);
if (error != NULL) {
g_debug("failed to fetch VMs: %s", error->message);
g_error_free(error);
g_main_loop_quit(main_loop);
return;
}
g_print("VMs:\n");
dump_collection(vms);
pools = ovirt_api_get_vm_pools(data->api);
ovirt_collection_fetch_async(pools, data->proxy, NULL, pools_fetched_cb, user_data);
}
static void api_fetched_cb(GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
GError *error = NULL;
OvirtProxy *proxy;
OvirtCollection *vms;
AsyncData *data = (AsyncData *)user_data;
g_debug("Fetched API");
proxy = OVIRT_PROXY(source_object);
data->api = ovirt_proxy_fetch_api_finish(proxy, result, &error);
if (error != NULL) {
g_debug("failed to fetch api: %s", error->message);
g_error_free(error);
g_main_loop_quit(main_loop);
return;
}
vms = ovirt_api_get_vms(data->api);
g_assert(vms != NULL);
ovirt_collection_fetch_async(vms, proxy, NULL, vms_fetched_cb, user_data);
}
static void fetched_ca_cert_cb(GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
GError *error = NULL;
GByteArray *ca_cert;
OvirtProxy *proxy;
g_debug("Fetched CA certificate");
proxy = OVIRT_PROXY(source_object);
ca_cert = ovirt_proxy_fetch_ca_certificate_finish(proxy, result, &error);
if (error != NULL) {
g_debug("failed to get CA certificate: %s", error->message);
g_error_free(error);
g_main_loop_quit(main_loop);
return;
}
if (ca_cert == NULL) {
g_debug("failed to get CA certificate");
g_main_loop_quit(main_loop);
return;
}
g_print("\tCA certificate: %p\n", ca_cert);
g_byte_array_unref(ca_cert);
ovirt_proxy_fetch_api_async(proxy, NULL, api_fetched_cb, user_data);
}
static gboolean start(gpointer user_data)
{
AsyncData *data = (AsyncData *)user_data;
data->proxy = ovirt_proxy_new (data->uri);
if (data->proxy == NULL)
return -1;
g_signal_connect(G_OBJECT(data->proxy), "authenticate",
G_CALLBACK(authenticate_cb), NULL);
ovirt_proxy_fetch_ca_certificate_async(data->proxy, NULL,
fetched_ca_cert_cb,
data);
return G_SOURCE_REMOVE;
}
int main(int argc, char **argv)
{
AsyncData *data;
g_type_init();
if (argc != 2) {
g_print("Usage: %s URI\n", argv[0]);
exit(1);
}
data = g_new0(AsyncData, 1);
data->uri = argv[1];
g_idle_add(start, data);
main_loop = g_main_loop_new(NULL, FALSE);
g_main_loop_run(main_loop);
if (data->proxy != NULL) {
g_object_unref(data->proxy);
}
g_free(data);
return 0;
}

145
examples/list-vms.c Normal file
View File

@ -0,0 +1,145 @@
/* Copyright 2013 Red Hat, Inc. and/or its affiliates.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <stdlib.h>
#include <govirt/govirt.h>
#include "govirt/glib-compat.h"
static gboolean
authenticate_cb(RestProxy *proxy, G_GNUC_UNUSED RestProxyAuth *auth,
G_GNUC_UNUSED gboolean retrying, gpointer user_data)
{
if (retrying)
return FALSE;
g_object_set(G_OBJECT(proxy),
"username", g_getenv("LIBGOVIRT_TEST_USERNAME"),
"password", g_getenv("LIBGOVIRT_TEST_PASSWORD"),
NULL);
return TRUE;
}
static void dump_resource(gpointer key, gpointer value, gpointer user_data)
{
g_assert(OVIRT_IS_RESOURCE(value));
g_print("\t%s\n", (char *)key);
}
static void dump_collection(OvirtCollection *collection)
{
GHashTable *resources;
resources = ovirt_collection_get_resources(collection);
g_hash_table_foreach(resources, dump_resource, NULL);
}
static void dump_vms(OvirtApi *api, OvirtProxy *proxy)
{
OvirtCollection *vms;
GError *error = NULL;
vms = ovirt_api_get_vms(api);
g_assert(vms != NULL);
ovirt_collection_fetch(vms, proxy, &error);
if (error != NULL) {
g_debug("failed to fetch VMs: %s", error->message);
g_error_free(error);
return;
}
g_print("VMs:\n");
dump_collection(vms);
}
static void dump_vm_pools(OvirtApi *api, OvirtProxy *proxy)
{
OvirtCollection *pools;
GError *error = NULL;
pools = ovirt_api_get_vm_pools(api);
g_assert(pools != NULL);
ovirt_collection_fetch(pools, proxy, &error);
if (error != NULL) {
g_debug("failed to fetch VM pools: %s", error->message);
g_error_free(error);
return;
}
g_print("VM pools:\n");
dump_collection(pools);
}
int main(int argc, char **argv)
{
OvirtApi *api;
OvirtProxy *proxy = NULL;
GError *error = NULL;
g_type_init();
if (argc != 2) {
g_print("Usage: %s URI\n", argv[0]);
exit(1);
}
proxy = ovirt_proxy_new(argv[1]);
if (proxy == NULL)
goto error;
g_signal_connect(G_OBJECT(proxy), "authenticate",
G_CALLBACK(authenticate_cb), NULL);
/* Should be using ovirt_get_option_group/ovirt_set_proxy_options
* instead as ovirt_proxy_fetch_ca_certificate is not checking
* properly the validity of https certificates
*/
ovirt_proxy_fetch_ca_certificate(proxy, &error);
if (error != NULL) {
g_debug("failed to get CA certificate: %s", error->message);
goto error;
}
api = ovirt_proxy_fetch_api(proxy, &error);
if (error != NULL) {
g_debug("failed to lookup %s: %s", argv[2], error->message);
goto error;
}
g_assert(api != NULL);
dump_vms(api, proxy);
dump_vm_pools(api, proxy);
error:
if (error != NULL)
g_error_free(error);
if (proxy != NULL)
g_object_unref(proxy);
return 0;
}

223
examples/sync-test.c Normal file
View File

@ -0,0 +1,223 @@
/* Copyright 2013 Red Hat, Inc. and/or its affiliates.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <stdlib.h>
#include <govirt/govirt.h>
#include "govirt/glib-compat.h"
static const char *
genum_get_nick (GType enum_type, gint value)
{
GEnumClass *enum_class;
GEnumValue *enum_value;
g_return_val_if_fail (G_TYPE_IS_ENUM (enum_type), NULL);
enum_class = g_type_class_ref(enum_type);
enum_value = g_enum_get_value(enum_class, value);
g_type_class_unref(enum_class);
if (enum_value != NULL)
return enum_value->value_nick;
g_return_val_if_reached(NULL);
}
static gboolean
authenticate_cb(RestProxy *proxy, G_GNUC_UNUSED RestProxyAuth *auth,
G_GNUC_UNUSED gboolean retrying, gpointer user_data)
{
if (retrying)
return FALSE;
g_object_set(G_OBJECT(proxy),
"username", g_getenv("LIBGOVIRT_TEST_USERNAME"),
"password", g_getenv("LIBGOVIRT_TEST_PASSWORD"),
NULL);
return TRUE;
}
static void list_storage_domains(OvirtApi *api, OvirtProxy *proxy)
{
GError *error = NULL;
OvirtCollection *collection;
GHashTableIter storage_domains;
gpointer value;
collection = ovirt_api_get_storage_domains(api);
ovirt_collection_fetch(collection, proxy, &error);
if (error != NULL) {
g_debug("failed to fetch storage domains: %s", error->message);
g_clear_error(&error);
}
g_hash_table_iter_init(&storage_domains, ovirt_collection_get_resources(collection));
while (g_hash_table_iter_next(&storage_domains, NULL, &value)) {
OvirtStorageDomain *domain;
OvirtCollection *file_collection;
GHashTableIter files;
char *name;
int type;
domain = OVIRT_STORAGE_DOMAIN(value);
g_object_get(G_OBJECT(domain), "type", &type, "name", &name, NULL);
g_print("storage domain: %s (type %s)\n", name,
genum_get_nick(OVIRT_TYPE_STORAGE_DOMAIN_TYPE, type));
file_collection = ovirt_storage_domain_get_files(domain);
if (file_collection == NULL) {
goto next;
}
ovirt_collection_fetch(file_collection, proxy, &error);
if (error != NULL) {
g_debug("failed to fetch files for storage domain %s: %s",
name, error->message);
g_clear_error(&error);
}
g_hash_table_iter_init(&files, ovirt_collection_get_resources(file_collection));
while (g_hash_table_iter_next(&files, NULL, &value)) {
char *filename;
g_object_get(G_OBJECT(value), "name", &filename, NULL);
g_print("file: %s\n", filename);
g_free(filename);
}
next:
g_free(name);
}
}
int main(int argc, char **argv)
{
OvirtApi *api;
OvirtCollection *vms;
OvirtProxy *proxy = NULL;
OvirtVm *vm = NULL;
OvirtVmDisplay *display = NULL;
OvirtVmState state;
GError *error = NULL;
char *host = NULL;
guint port;
guint secure_port;
OvirtVmDisplayType type;
gchar *ticket = NULL;
GByteArray *ca_cert = NULL;
g_type_init();
if (argc != 3) {
g_print("Usage: %s URI VM-NAME\n", argv[0]);
exit(1);
}
proxy = ovirt_proxy_new (argv[1]);
if (proxy == NULL)
goto error;
g_signal_connect(G_OBJECT(proxy), "authenticate",
G_CALLBACK(authenticate_cb), NULL);
ovirt_proxy_fetch_ca_certificate(proxy, &error);
if (error != NULL) {
g_debug("failed to get CA certificate: %s", error->message);
goto error;
}
g_object_get(G_OBJECT(proxy), "ca-cert", &ca_cert, NULL);
api = ovirt_proxy_fetch_api(proxy, &error);
if (error != NULL) {
g_debug("failed to lookup %s: %s", argv[2], error->message);
goto error;
}
g_assert(api != NULL);
vms= ovirt_api_get_vms(api);
g_assert(vms != NULL);
ovirt_collection_fetch(vms, proxy, &error);
if (error != NULL) {
g_debug("failed to lookup %s: %s", argv[2], error->message);
goto error;
}
vm = OVIRT_VM(ovirt_collection_lookup_resource(vms, argv[2]));
g_return_val_if_fail(vm != NULL, -1);
g_object_get(G_OBJECT(vm), "state", &state, NULL);
if (state != OVIRT_VM_STATE_UP) {
ovirt_vm_start(vm, proxy, &error);
if (error != NULL) {
g_debug("failed to start %s: %s", argv[2], error->message);
goto error;
}
}
if (!ovirt_vm_get_ticket(vm, proxy, &error)) {
g_debug("failed to get ticket for %s: %s", argv[2], error->message);
goto error;
}
g_object_get(G_OBJECT(vm), "display", &display, NULL);
if (display == NULL) {
goto error;
}
g_object_get(G_OBJECT(display),
"type", &type,
"address", &host,
"port", &port,
"secure-port", &secure_port,
"ticket", &ticket,
NULL);
g_print("Connection info for %s:\n", argv[2]);
g_print("\tConnection type: %s\n",
(type == OVIRT_VM_DISPLAY_SPICE?"spice":"vnc"));
g_print("\tVM IP address: %s\n", host);
g_print("\tPort: %d\n", port);
g_print("\tSecure port: %d\n", secure_port);
g_print("\tCA certificate: %p\n", ca_cert);
g_print("\tTicket: %s\n", ticket);
{
list_storage_domains(api, proxy);
}
error:
g_free(ticket);
g_free(host);
if (ca_cert != NULL)
g_byte_array_unref(ca_cert);
if (error != NULL)
g_error_free(error);
if (display != NULL)
g_object_unref(display);
if (vm != NULL)
g_object_unref(vm);
if (proxy != NULL)
g_object_unref(proxy);
return 0;
}

166
govirt/Makefile.am Normal file
View File

@ -0,0 +1,166 @@
NULL =
AM_CPPFLAGS = \
$(GLIB_CFLAGS) \
$(REST_CFLAGS) \
-I$(top_srcdir) \
-I$(top_srcdir)/govirt \
-DG_LOG_DOMAIN=\"libgovirt\" \
-DTESTDATADIR=\""$(top_srcdir)/data/tests"\" \
-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
-DLOCALEDIR="\"$(datadir)/locale\"" \
$(NULL)
lib_LTLIBRARIES = \
libgovirt.la
libgovirt_ladir = $(includedir)/govirt-1.0/govirt
libgovirt_la_HEADERS = \
govirt.h \
ovirt-api.h \
ovirt-cdrom.h \
ovirt-collection.h \
ovirt-error.h \
ovirt-options.h \
ovirt-proxy.h \
ovirt-resource.h \
ovirt-rest-call-error.h \
ovirt-storage-domain.h \
ovirt-types.h \
ovirt-vm.h \
ovirt-vm-pool.h \
ovirt-vm-display.h \
$(NULL)
noinst_HEADERS = \
glib-compat.h \
govirt-private.h \
ovirt-action-rest-call.h \
ovirt-api-private.h \
ovirt-collection-private.h \
ovirt-proxy-private.h \
ovirt-resource-private.h \
ovirt-rest-call.h \
ovirt-resource-rest-call.h \
ovirt-storage-domain-private.h \
ovirt-utils.h \
ovirt-vm-private.h \
$(NULL)
libgovirt_la_SOURCES = \
glib-compat.c \
ovirt-action-rest-call.c \
ovirt-api.c \
ovirt-cdrom.c \
ovirt-collection.c \
ovirt-error.c \
ovirt-options.c \
ovirt-proxy.c \
ovirt-proxy-deprecated.c \
ovirt-resource.c \
ovirt-rest-call.c \
ovirt-resource-rest-call.c \
ovirt-storage-domain.c \
ovirt-utils.c \
ovirt-vm.c \
ovirt-vm-display.c \
ovirt-vm-xml.c \
ovirt-vm-pool.c \
$(NULL)
nodist_libgovirt_la_HEADERS = \
$(builddir)/ovirt-enum-types.h \
$(NULL)
nodist_libgovirt_la_SOURCES = \
$(builddir)/ovirt-enum-types.c \
$(builddir)/ovirt-enum-types-private.c \
$(builddir)/ovirt-enum-types-private.h \
$(NULL)
libgovirt_la_LIBADD = \
$(GLIB_LIBS) \
$(REST_LIBS)
libgovirt_la_DEPENDENCIES = \
govirt.sym
libgovirt_la_LDFLAGS = \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
-export-dynamic \
-no-undefined \
-Wl,--version-script=$(srcdir)/govirt.sym
libgovirt_la_CFLAGS = \
$(WARNINGFLAGS_C)
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = govirt-1.0.pc
ovirt-enum-types.h: $(libgovirt_la_HEADERS) ovirt-enum-types.h.template
$(AM_V_GEN) ( $(GLIB_MKENUMS) --template $(srcdir)/ovirt-enum-types.h.template $(libgovirt_la_HEADERS:%=$(srcdir)/%) ) \
> ovirt-enum-types.h
ovirt-enum-types.c: $(libgovirt_la_HEADERS) ovirt-enum-types.h ovirt-enum-types.c.template
$(AM_V_GEN) ( $(GLIB_MKENUMS) --template $(srcdir)/ovirt-enum-types.c.template $(libgovirt_la_HEADERS:%=$(srcdir)/%) ) \
> ovirt-enum-types.c
ovirt-enum-types-private.h: $(noinst_HEADERS) ovirt-enum-types-private.h.template
$(AM_V_GEN) ( $(GLIB_MKENUMS) --template $(srcdir)/ovirt-enum-types-private.h.template $(noinst_HEADERS:%=$(srcdir)/%) ) \
> ovirt-enum-types-private.h
ovirt-enum-types-private.c: $(noinst_HEADERS) ovirt-enum-types-private.h ovirt-enum-types-private.c.template
$(AM_V_GEN) ( $(GLIB_MKENUMS) --template $(srcdir)/ovirt-enum-types-private.c.template $(noinst_HEADERS:%=$(srcdir)/%) ) \
> ovirt-enum-types-private.c
BUILT_SOURCES = \
ovirt-enum-types.h \
ovirt-enum-types.c \
ovirt-enum-types-private.h \
ovirt-enum-types-private.c \
$(NULL)
EXTRA_DIST = \
govirt-1.0.pc.in \
govirt.sym \
ovirt-enum-types.h.template \
ovirt-enum-types.c.template \
ovirt-enum-types-private.h.template \
ovirt-enum-types-private.c.template \
$(NULL)
CLEANFILES = $(BUILT_SOURCES)
clean-local:
rm -f *~
-include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS =
INTROSPECTION_SCANNER_ARGS = \
--add-include-path=$(srcdir) \
--identifier-prefix=Ovirt \
--warn-all \
--c-include="govirt/govirt.h" \
$(NULL)
INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
if HAVE_INTROSPECTION
introspection_sources = $(libgovirt_la_SOURCES) $(libgovirt_la_HEADERS) $(builddir)/ovirt-enum-types.c $(builddir)/ovirt-enum-types.h
GoVirt-1.0.gir: libgovirt.la Makefile
GoVirt_1_0_gir_INCLUDES = Gio-2.0 GObject-2.0 Rest-0.7
GoVirt_1_0_gir_CFLAGS = $(AM_CPPFLAGS) -I$(top_builddir)
GoVirt_1_0_gir_LIBS = libgovirt.la
GoVirt_1_0_gir_FILES = $(introspection_sources)
INTROSPECTION_GIRS += GoVirt-1.0.gir
girdir = $(datadir)/gir-1.0
gir_DATA = $(INTROSPECTION_GIRS)
typelibdir = $(libdir)/girepository-1.0
typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
CLEANFILES += $(gir_DATA) $(typelib_DATA)
endif # HAVE_INTROSPECTION
-include $(top_srcdir)/git.mk

1143
govirt/Makefile.in Normal file

File diff suppressed because it is too large Load Diff

194
govirt/glib-compat.c Normal file
View File

@ -0,0 +1,194 @@
/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "glib-compat.h"
#if !GLIB_CHECK_VERSION(2,26,0)
G_DEFINE_BOXED_TYPE (GError, ovirt_error, g_error_copy, g_error_free)
/**
* g_key_file_set_uint64:
* @key_file: a #GKeyFile
* @group_name: a group name
* @key: a key
* @value: an integer value
*
* Associates a new integer value with @key under @group_name.
* If @key cannot be found then it is created.
*
* Since: 2.26
**/
void
g_key_file_set_uint64 (GKeyFile *key_file,
const gchar *group_name,
const gchar *key,
guint64 value)
{
gchar *result;
g_return_if_fail (key_file != NULL);
result = g_strdup_printf ("%" G_GUINT64_FORMAT, value);
g_key_file_set_value (key_file, group_name, key, result);
g_free (result);
}
#endif
#if !GLIB_CHECK_VERSION(2,28,0)
/**
* g_simple_async_result_new_take_error: (skip)
* @source_object: (allow-none): a #GObject, or %NULL
* @callback: (scope async): a #GAsyncReadyCallback
* @user_data: (closure): user data passed to @callback
* @error: a #GError
*
* Creates a #GSimpleAsyncResult from an error condition, and takes over the
* caller's ownership of @error, so the caller does not need to free it anymore.
*
* Returns: a #GSimpleAsyncResult
*
* Since: 2.28
**/
G_GNUC_INTERNAL GSimpleAsyncResult *
g_simple_async_result_new_take_error (GObject *source_object,
GAsyncReadyCallback callback,
gpointer user_data,
GError *error)
{
GSimpleAsyncResult *simple;
g_return_val_if_fail (!source_object || G_IS_OBJECT (source_object), NULL);
simple = g_simple_async_result_new (source_object,
callback,
user_data, NULL);
g_simple_async_result_take_error (simple, error);
return simple;
}
/**
* g_simple_async_result_take_error: (skip)
* @simple: a #GSimpleAsyncResult
* @error: a #GError
*
* Sets the result from @error, and takes over the caller's ownership
* of @error, so the caller does not need to free it any more.
*
* Since: 2.28
**/
G_GNUC_INTERNAL void
g_simple_async_result_take_error (GSimpleAsyncResult *simple,
GError *error)
{
/* this code is different from upstream */
/* we can't avoid extra copy/free, since the simple struct is
opaque */
g_simple_async_result_set_from_error (simple, error);
g_error_free (error);
}
/**
* g_simple_async_report_take_gerror_in_idle: (skip)
* @object: (allow-none): a #GObject, or %NULL
* @callback: a #GAsyncReadyCallback.
* @user_data: user data passed to @callback.
* @error: the #GError to report
*
* Reports an error in an idle function. Similar to
* g_simple_async_report_gerror_in_idle(), but takes over the caller's
* ownership of @error, so the caller does not have to free it any more.
*
* Since: 2.28
**/
G_GNUC_INTERNAL void
g_simple_async_report_take_gerror_in_idle (GObject *object,
GAsyncReadyCallback callback,
gpointer user_data,
GError *error)
{
GSimpleAsyncResult *simple;
g_return_if_fail (!object || G_IS_OBJECT (object));
g_return_if_fail (error != NULL);
simple = g_simple_async_result_new_take_error (object,
callback,
user_data,
error);
g_simple_async_result_complete_in_idle (simple);
g_object_unref (simple);
}
/**
* g_slist_free_full: (skip)
* @list: a #GSList
* @free_func: a #GDestroyNotify
*
* Convenience method, which frees all the memory used by a #GSList,
* and calls the specified destroy function on every element's data
*
* Since: 2.28
**/
G_GNUC_INTERNAL void
g_slist_free_full(GSList *list,
GDestroyNotify free_func)
{
GSList *el;
if (free_func) {
for (el = list; el ; el = g_slist_next(el)) {
free_func(el);
}
}
g_slist_free(list);
}
#endif
#if !GLIB_CHECK_VERSION(2,30,0)
G_DEFINE_BOXED_TYPE (GMainContext, ovirt_main_context, g_main_context_ref, g_main_context_unref)
#endif
#if !GLIB_CHECK_VERSION(2,32,0)
GByteArray *g_byte_array_new_take (guint8 *data, gsize len)
{
GByteArray *array;
array = g_byte_array_new ();
g_assert (array->data == NULL);
g_assert (array->len == 0);
array->data = data;
array->len = len;
return array;
}
#endif
#if !GLIB_CHECK_VERSION(2,27,2)
guint64 g_get_monotonic_time(void)
{
GTimeVal tv;
/* TODO: support real monotonic clock? */
g_get_current_time(&tv);
return (((gint64) tv.tv_sec) * 1000000) + tv.tv_usec;
}
#endif

152
govirt/glib-compat.h Normal file
View File

@ -0,0 +1,152 @@
/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GLIB_COMPAT_H
#define GLIB_COMPAT_H
#include <glib-object.h>
#include <gio/gio.h>
#if !GLIB_CHECK_VERSION(2,26,0)
#define G_DEFINE_BOXED_TYPE(TypeName, type_name, copy_func, free_func) G_DEFINE_BOXED_TYPE_WITH_CODE (TypeName, type_name, copy_func, free_func, {})
#define G_DEFINE_BOXED_TYPE_WITH_CODE(TypeName, type_name, copy_func, free_func, _C_) _G_DEFINE_BOXED_TYPE_BEGIN (TypeName, type_name, copy_func, free_func) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
#define _G_DEFINE_BOXED_TYPE_BEGIN(TypeName, type_name, copy_func, free_func) \
GType \
type_name##_get_type (void) \
{ \
static volatile gsize g_define_type_id__volatile = 0; \
if (g_once_init_enter (&g_define_type_id__volatile)) \
{ \
GType (* _g_register_boxed) \
(const gchar *, \
union \
{ \
TypeName * (*do_copy_type) (TypeName *); \
TypeName * (*do_const_copy_type) (const TypeName *); \
GBoxedCopyFunc do_copy_boxed; \
} __attribute__((__transparent_union__)), \
union \
{ \
void (* do_free_type) (TypeName *); \
GBoxedFreeFunc do_free_boxed; \
} __attribute__((__transparent_union__)) \
) = g_boxed_type_register_static; \
GType g_define_type_id = \
_g_register_boxed (g_intern_static_string (#TypeName), copy_func, free_func); \
{ /* custom code follows */
#else
#define _G_DEFINE_BOXED_TYPE_BEGIN(TypeName, type_name, copy_func, free_func) \
GType \
type_name##_get_type (void) \
{ \
static volatile gsize g_define_type_id__volatile = 0; \
if (g_once_init_enter (&g_define_type_id__volatile)) \
{ \
GType g_define_type_id = \
g_boxed_type_register_static (g_intern_static_string (#TypeName), \
(GBoxedCopyFunc) copy_func, \
(GBoxedFreeFunc) free_func); \
{ /* custom code follows */
#endif /* __GNUC__ */
#define g_source_set_name(source, name) G_STMT_START { } G_STMT_END
#define G_TYPE_ERROR (ovirt_error_get_type ())
GType ovirt_error_get_type (void) G_GNUC_CONST;
#define G_PARAM_DEPRECATED (1 << 31)
void g_key_file_set_uint64 (GKeyFile *key_file,
const gchar *group_name,
const gchar *key,
guint64 value);
#endif /* glib 2.26 */
#if !GLIB_CHECK_VERSION(2,27,2)
guint64 g_get_monotonic_time(void);
#endif /* glib 2.27.2 */
#if !GLIB_CHECK_VERSION(2,28,0)
#define g_clear_object(object_ptr) \
G_STMT_START { \
/* Only one access, please */ \
gpointer *_p = (gpointer) (object_ptr); \
gpointer _o; \
\
do \
_o = g_atomic_pointer_get (_p); \
while G_UNLIKELY (!g_atomic_pointer_compare_and_exchange (_p, _o, NULL));\
\
if (_o) \
g_object_unref (_o); \
} G_STMT_END
GSimpleAsyncResult *
g_simple_async_result_new_take_error (GObject *source_object,
GAsyncReadyCallback callback,
gpointer user_data,
GError *error);
void
g_simple_async_result_take_error(GSimpleAsyncResult *simple,
GError *error);
void
g_simple_async_report_take_gerror_in_idle (GObject *object,
GAsyncReadyCallback callback,
gpointer user_data,
GError *error);
void
g_slist_free_full(GSList *list,
GDestroyNotify free_func);
#endif /* glib 2.28 */
#if !GLIB_CHECK_VERSION(2,30,0)
#define G_TYPE_MAIN_CONTEXT (ovirt_main_context_get_type ())
GType ovirt_main_context_get_type (void) G_GNUC_CONST;
#endif /* glib 2.30.0 */
#if !GLIB_CHECK_VERSION(2,32,0)
# define G_SIGNAL_DEPRECATED (1 << 9)
# define G_SOURCE_REMOVE FALSE
GByteArray *g_byte_array_new_take (guint8 *data, gsize len);
#endif /* glib 2.32.0 */
#ifndef g_clear_pointer
#define g_clear_pointer(pp, destroy) \
G_STMT_START { \
G_STATIC_ASSERT (sizeof *(pp) == sizeof (gpointer)); \
/* Only one access, please */ \
gpointer *_pp = (gpointer *) (pp); \
gpointer _p; \
/* This assignment is needed to avoid a gcc warning */ \
GDestroyNotify _destroy = (GDestroyNotify) (destroy); \
\
(void) (0 ? (gpointer) *(pp) : 0); \
do \
_p = g_atomic_pointer_get (_pp); \
while G_UNLIKELY (!g_atomic_pointer_compare_and_exchange (_pp, _p, NULL)); \
\
if (_p) \
_destroy (_p); \
} G_STMT_END
#endif
#if GLIB_CHECK_VERSION(2,36,0)
#define g_type_init()
#endif /* glib 2.36.0 */
#endif /* GLIB_COMPAT_H */

11
govirt/govirt-1.0.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: govirt
Description: goVirt is a GLib binding for oVirt REST API
Version: @VERSION@
Requires: gio-2.0, glib-2.0, gobject-2.0, rest-0.7
Libs: -L${libdir} -lgovirt
Cflags: -I${includedir}/govirt-1.0

38
govirt/govirt-private.h Normal file
View File

@ -0,0 +1,38 @@
/*
* govirt-private.h: main private header
*
* Copyright (C) 2012 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#ifndef __OVIRT_PRIVATE_H__
#define __OVIRT_PRIVATE_H__
#include <govirt/ovirt-action-rest-call.h>
#include <govirt/ovirt-api-private.h>
#include <govirt/ovirt-collection-private.h>
#include <govirt/ovirt-enum-types-private.h>
#include <govirt/ovirt-proxy-private.h>
#include <govirt/ovirt-resource-private.h>
#include <govirt/ovirt-resource-rest-call.h>
#include <govirt/ovirt-rest-call.h>
#include <govirt/ovirt-storage-domain-private.h>
#include <govirt/ovirt-utils.h>
#include <govirt/ovirt-vm-private.h>
#include <govirt/glib-compat.h>
#endif /* __OVIRT_PRIVATE_H__ */

39
govirt/govirt.h Normal file
View File

@ -0,0 +1,39 @@
/*
* govirt.h: main header
*
* Copyright (C) 2012 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#ifndef __OVIRT_H__
#define __OVIRT_H__
#include <govirt/ovirt-enum-types.h>
#include <govirt/ovirt-api.h>
#include <govirt/ovirt-cdrom.h>
#include <govirt/ovirt-collection.h>
#include <govirt/ovirt-error.h>
#include <govirt/ovirt-options.h>
#include <govirt/ovirt-proxy.h>
#include <govirt/ovirt-resource.h>
#include <govirt/ovirt-rest-call-error.h>
#include <govirt/ovirt-storage-domain.h>
#include <govirt/ovirt-vm.h>
#include <govirt/ovirt-vm-display.h>
#include <govirt/ovirt-vm-pool.h>
#endif /* __OVIRT_H__ */

113
govirt/govirt.sym Normal file
View File

@ -0,0 +1,113 @@
GOVIRT_0.2.0 {
global:
ovirt_collection_get_type;
ovirt_collection_get_resources;
ovirt_collection_new_from_xml;
ovirt_error_quark;
ovirt_error_get_type;
ovirt_proxy_get_type;
ovirt_proxy_new;
ovirt_proxy_fetch_ca_certificate;
ovirt_proxy_fetch_ca_certificate_async;
ovirt_proxy_fetch_ca_certificate_finish;
ovirt_proxy_fetch_vms;
ovirt_proxy_fetch_vms_async;
ovirt_proxy_fetch_vms_finish;
ovirt_proxy_get_vms;
ovirt_proxy_lookup_vm;
ovirt_resource_get_type;
ovirt_resource_get_sub_collection;
ovirt_rest_call_error_quark;
ovirt_rest_call_error_get_type;
ovirt_vm_display_get_type;
ovirt_vm_display_type_get_type;
ovirt_vm_display_new;
ovirt_vm_get_type;
ovirt_vm_state_get_type;
ovirt_vm_new;
ovirt_vm_add_action;
ovirt_vm_get_action;
ovirt_vm_get_ticket;
ovirt_vm_get_ticket_async;
ovirt_vm_get_ticket_finish;
ovirt_vm_refresh_async;
ovirt_vm_refresh_finish;
ovirt_vm_start;
ovirt_vm_start_async;
ovirt_vm_start_finish;
ovirt_vm_stop;
ovirt_vm_stop_async;
ovirt_vm_stop_finish;
local:
*;
};
GOVIRT_0.2.1 {
ovirt_get_option_group;
ovirt_set_proxy_options;
ovirt_api_get_type;
ovirt_api_new;
ovirt_api_get_vms;
ovirt_api_get_storage_domains;
ovirt_cdrom_get_type;
ovirt_cdrom_update;
ovirt_cdrom_update_async;
ovirt_cdrom_update_finish;
ovirt_collection_fetch;
ovirt_collection_fetch_async;
ovirt_collection_fetch_finish;
ovirt_collection_lookup_resource;
ovirt_proxy_fetch_api;
ovirt_proxy_fetch_api_async;
ovirt_proxy_fetch_api_finish;
ovirt_resource_update;
ovirt_resource_update_async;
ovirt_resource_update_finish;
ovirt_storage_domain_get_type;
ovirt_storage_domain_state_get_type;
ovirt_storage_domain_format_version_get_type;
ovirt_storage_domain_type_get_type;
ovirt_storage_domain_new;
ovirt_storage_domain_get_files;
ovirt_vm_get_cdroms;
} GOVIRT_0.2.0;
GOVIRT_0.3.1 {
ovirt_api_get_vm_pools;
ovirt_resource_refresh;
ovirt_resource_refresh_async;
ovirt_resource_refresh_finish;
ovirt_vm_pool_get_type;
ovirt_vm_pool_new;
ovirt_vm_pool_allocate_vm;
ovirt_vm_pool_allocate_vm_async;
ovirt_vm_pool_allocate_vm_finish;
} GOVIRT_0.2.1;
GOVIRT_0.3.2 {
ovirt_resource_delete;
ovirt_resource_delete_async;
ovirt_resource_delete_finish;
} GOVIRT_0.3.1;
GOVIRT_0.3.4 {
ovirt_proxy_get_api;
} GOVIRT_0.3.2;
# .... define new API here using predicted next version number ....

View File

@ -0,0 +1,93 @@
/*
* ovirt-action-rest-call.c: oVirt librest call proxy
*
* Copyright (C) 2012, 2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#include <config.h>
#include <glib/gi18n-lib.h>
#include "ovirt-action-rest-call.h"
#include "ovirt-proxy.h"
#include "ovirt-rest-call-error.h"
#include <rest/rest-params.h>
#define OVIRT_ACTION_REST_CALL_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE((obj), OVIRT_TYPE_ACTION_REST_CALL, OvirtActionRestCallPrivate))
G_DEFINE_TYPE(OvirtActionRestCall, ovirt_action_rest_call, OVIRT_TYPE_REST_CALL);
static gboolean ovirt_action_rest_call_class_serialize_params(RestProxyCall *call,
gchar **content_type,
gchar **content,
gsize *content_len,
GError **error)
{
RestParams *params;
RestParamsIter it;
GString *body;
const char *name;
RestParam *param;
g_return_val_if_fail(OVIRT_IS_ACTION_REST_CALL(call), FALSE);
g_return_val_if_fail(content_type != NULL, FALSE);
g_return_val_if_fail(content != NULL, FALSE);
g_return_val_if_fail(content_len != NULL, FALSE);
params = rest_proxy_call_get_params(call);
if (!rest_params_are_strings(params)) {
g_set_error(error, OVIRT_REST_CALL_ERROR, 0,
_("Unexpected parameter type in REST call"));
return FALSE;
}
body = g_string_new("<action>");
rest_params_iter_init(&it, params);
while (rest_params_iter_next(&it, &name, &param)) {
const char *val = rest_param_get_content(param);
g_string_append_printf(body, "<%s>%s</%s>", name, val, name);
}
g_string_append(body, "</action>");
*content_type = g_strdup("application/xml");
*content = body->str;
*content_len = body->len;
g_string_free(body, FALSE);
return TRUE;
}
static void ovirt_action_rest_call_class_init(OvirtActionRestCallClass *klass)
{
REST_PROXY_CALL_CLASS(klass)->serialize_params = ovirt_action_rest_call_class_serialize_params;
}
static void ovirt_action_rest_call_init(G_GNUC_UNUSED OvirtActionRestCall *call)
{
}
OvirtActionRestCall *ovirt_action_rest_call_new(RestProxy *proxy)
{
g_return_val_if_fail(OVIRT_IS_PROXY(proxy), NULL);
return OVIRT_ACTION_REST_CALL(g_object_new(OVIRT_TYPE_ACTION_REST_CALL,
"proxy", proxy, NULL));
}

View File

@ -0,0 +1,61 @@
/*
* ovirt-action-rest-call.h: oVirt librest call proxy
*
* Copyright (C) 2012, 2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#ifndef __OVIRT_ACTION_REST_CALL_H__
#define __OVIRT_ACTION_REST_CALL_H__
#include <ovirt-rest-call.h>
G_BEGIN_DECLS
#define OVIRT_TYPE_ACTION_REST_CALL (ovirt_action_rest_call_get_type ())
#define OVIRT_ACTION_REST_CALL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OVIRT_TYPE_ACTION_REST_CALL, OvirtActionRestCall))
#define OVIRT_ACTION_REST_CALL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OVIRT_TYPE_ACTION_REST_CALL, OvirtActionRestCallClass))
#define OVIRT_IS_ACTION_REST_CALL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OVIRT_TYPE_ACTION_REST_CALL))
#define OVIRT_IS_ACTION_REST_CALL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OVIRT_TYPE_ACTION_REST_CALL))
#define OVIRT_ACTION_REST_CALL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OVIRT_TYPE_ACTION_REST_CALL, OvirtActionRestCallClass))
typedef struct _OvirtActionRestCall OvirtActionRestCall;
typedef struct _OvirtActionRestCallPrivate OvirtActionRestCallPrivate;
typedef struct _OvirtActionRestCallClass OvirtActionRestCallClass;
struct _OvirtActionRestCall
{
OvirtRestCall parent;
OvirtActionRestCallPrivate *priv;
/* Do not add fields to this struct */
};
struct _OvirtActionRestCallClass
{
OvirtRestCallClass parent_class;
gpointer padding[20];
};
G_GNUC_INTERNAL GType ovirt_action_rest_call_get_type(void);
G_GNUC_INTERNAL OvirtActionRestCall *ovirt_action_rest_call_new(RestProxy *proxy);
G_END_DECLS
#endif /* __OVIRT_ACTION_REST_CALL_H__ */

View File

@ -0,0 +1,35 @@
/*
* ovirt-api-private.h: oVirt API entry point private header
*
* Copyright (C) 2012, 2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#ifndef __OVIRT_API_PRIVATE_H__
#define __OVIRT_API_PRIVATE_H__
#include <ovirt-api.h>
#include <rest/rest-xml-node.h>
G_BEGIN_DECLS
OvirtApi *ovirt_api_new_from_xml(RestXmlNode *node, GError **error);
G_END_DECLS
#endif /* __OVIRT_API_PRIVATE_H__ */

199
govirt/ovirt-api.c Normal file
View File

@ -0,0 +1,199 @@
/*
* ovirt-api.c: oVirt API entry point
*
* Copyright (C) 2012, 2013 Red Hat, Inc.
* Copyright (C) 2013 Iordan Iordanov <i@iiordanov.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#include <config.h>
#include "ovirt-enum-types.h"
#include "ovirt-error.h"
#include "ovirt-proxy.h"
#include "ovirt-rest-call.h"
#include "ovirt-api.h"
#include "ovirt-vm-pool.h"
#include "govirt-private.h"
#include <rest/rest-xml-node.h>
#include <rest/rest-xml-parser.h>
#include <stdlib.h>
#include <string.h>
#define OVIRT_API_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE((obj), OVIRT_TYPE_API, OvirtApiPrivate))
struct _OvirtApiPrivate {
OvirtCollection *storage_domains;
OvirtCollection *vms;
OvirtCollection *vm_pools;
};
G_DEFINE_TYPE(OvirtApi, ovirt_api, OVIRT_TYPE_RESOURCE);
static gboolean ovirt_api_init_from_xml(OvirtResource *resource,
RestXmlNode *node,
GError **error)
{
OvirtResourceClass *parent_class;
#if 0
gboolean parsed_ok;
parsed_ok = ovirt_api_refresh_from_xml(OVIRT_API(resource), node);
if (!parsed_ok) {
return FALSE;
}
#endif
parent_class = OVIRT_RESOURCE_CLASS(ovirt_api_parent_class);
return parent_class->init_from_xml(resource, node, error);
}
static void ovirt_api_dispose(GObject *object)
{
OvirtApi *api = OVIRT_API(object);
g_clear_object(&api->priv->storage_domains);
g_clear_object(&api->priv->vms);
g_clear_object(&api->priv->vm_pools);
G_OBJECT_CLASS(ovirt_api_parent_class)->dispose(object);
}
static void ovirt_api_class_init(OvirtApiClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS(klass);
OvirtResourceClass *resource_class = OVIRT_RESOURCE_CLASS(klass);
g_type_class_add_private(klass, sizeof(OvirtApiPrivate));
object_class->dispose = ovirt_api_dispose;
resource_class->init_from_xml = ovirt_api_init_from_xml;
}
static void ovirt_api_init(G_GNUC_UNUSED OvirtApi *api)
{
api->priv = OVIRT_API_GET_PRIVATE(api);
}
OvirtApi *ovirt_api_new_from_xml(RestXmlNode *node, GError **error)
{
return OVIRT_API(g_initable_new(OVIRT_TYPE_API, NULL, error,
"xml-node", node, NULL));
}
OvirtApi *ovirt_api_new(void)
{
return OVIRT_API(g_initable_new(OVIRT_TYPE_API, NULL, NULL, NULL));
}
/**
* ovirt_api_get_vms:
* @api: a #OvirtApi
*
* This method does not initiate any network activity, the collection
* must be fetched with ovirt_collection_fetch() before having up-to-date
* content.
*
* Return value: (transfer none):
*/
OvirtCollection *ovirt_api_get_vms(OvirtApi *api)
{
const char *href;
g_return_val_if_fail(OVIRT_IS_API(api), NULL);
if (api->priv->vms != NULL)
return api->priv->vms;
href = ovirt_resource_get_sub_collection(OVIRT_RESOURCE(api), "vms");
if (href == NULL)
return NULL;
api->priv->vms = ovirt_collection_new(href, "vms", OVIRT_TYPE_VM, "vm");
return api->priv->vms;
}
/**
* ovirt_api_get_vm_pools:
* @api: a #OvirtApi
*
* This method does not initiate any network activity, the collection
* must be fetched with ovirt_collection_fetch() before having up-to-date
* content.
*
* Return value: (transfer none):
*/
OvirtCollection *ovirt_api_get_vm_pools(OvirtApi *api)
{
const char *href;
g_return_val_if_fail(OVIRT_IS_API(api), NULL);
if (api->priv->vm_pools != NULL)
return api->priv->vm_pools;
href = ovirt_resource_get_sub_collection(OVIRT_RESOURCE(api), "vmpools");
if (href == NULL)
return NULL;
api->priv->vm_pools = ovirt_collection_new(href, "vmpools", OVIRT_TYPE_VM_POOL, "vmpool");
return api->priv->vm_pools;
}
/**
* ovirt_api_get_storage_domains:
* @api: a #OvirtApi
*
* This method does not initiate any network activity, the collection
* must be fetched with ovirt_collection_fetch() before having up-to-date
* content.
*
* Return value: (transfer none):
*/
OvirtCollection *ovirt_api_get_storage_domains(OvirtApi *api)
{
const char *href;
g_return_val_if_fail(OVIRT_IS_API(api), NULL);
if (api->priv->storage_domains != NULL)
return api->priv->storage_domains;
href = ovirt_resource_get_sub_collection(OVIRT_RESOURCE(api), "storagedomains");
if (href == NULL)
return NULL;
api->priv->storage_domains = ovirt_collection_new(href, "storage_domains",
OVIRT_TYPE_STORAGE_DOMAIN,
"storage_domain");
return api->priv->storage_domains;
}

70
govirt/ovirt-api.h Normal file
View File

@ -0,0 +1,70 @@
/*
* ovirt-api.h: oVirt API entry point
*
* Copyright (C) 2012, 2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#ifndef __OVIRT_API_H__
#define __OVIRT_API_H__
#include <gio/gio.h>
#include <glib-object.h>
#include <govirt/ovirt-collection.h>
#include <govirt/ovirt-resource.h>
#include <govirt/ovirt-types.h>
G_BEGIN_DECLS
#define OVIRT_TYPE_API (ovirt_api_get_type ())
#define OVIRT_API(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OVIRT_TYPE_API, OvirtApi))
#define OVIRT_API_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OVIRT_TYPE_API, OvirtApiClass))
#define OVIRT_IS_API(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OVIRT_TYPE_API))
#define OVIRT_IS_API_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OVIRT_TYPE_API))
#define OVIRT_API_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OVIRT_TYPE_API, OvirtApiClass))
typedef struct _OvirtApi OvirtApi;
typedef struct _OvirtApiPrivate OvirtApiPrivate;
typedef struct _OvirtApiClass OvirtApiClass;
struct _OvirtApi
{
OvirtResource parent;
OvirtApiPrivate *priv;
/* Do not add fields to this struct */
};
struct _OvirtApiClass
{
OvirtResourceClass parent_class;
gpointer padding[20];
};
GType ovirt_api_get_type(void);
OvirtApi *ovirt_api_new(void);
OvirtCollection *ovirt_api_get_storage_domains(OvirtApi *api);
OvirtCollection *ovirt_api_get_vms(OvirtApi *api);
OvirtCollection *ovirt_api_get_vm_pools(OvirtApi *api);
G_END_DECLS
#endif /* __OVIRT_API_H__ */

276
govirt/ovirt-cdrom.c Normal file
View File

@ -0,0 +1,276 @@
/*
* ovirt-cdrom.c: oVirt cdrom handling
*
* Copyright (C) 2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#include <config.h>
#define GOVIRT_UNSTABLE_API_ABI
#include "ovirt-cdrom.h"
#undef GOVIRT_UNSTABLE_API_ABI
#include "ovirt-proxy.h"
#include "ovirt-proxy-private.h"
#include "ovirt-resource-private.h"
#include "ovirt-resource-rest-call.h"
#define OVIRT_CDROM_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE((obj), OVIRT_TYPE_CDROM, OvirtCdromPrivate))
struct _OvirtCdromPrivate {
char *file;
};
G_DEFINE_TYPE(OvirtCdrom, ovirt_cdrom, OVIRT_TYPE_RESOURCE);
enum {
PROP_0,
PROP_FILE
};
static void ovirt_cdrom_add_rest_params(G_GNUC_UNUSED OvirtResource *resource,
RestProxyCall *call);
static void ovirt_cdrom_get_property(GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
OvirtCdrom *cdrom = OVIRT_CDROM(object);
switch (prop_id) {
case PROP_FILE:
g_value_set_string(value, cdrom->priv->file);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
}
}
static void ovirt_cdrom_set_property(GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
OvirtCdrom *cdrom = OVIRT_CDROM(object);
switch (prop_id) {
case PROP_FILE:
g_free(cdrom->priv->file);
cdrom->priv->file = g_value_dup_string(value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
}
}
static void ovirt_cdrom_finalize(GObject *object)
{
OvirtCdrom *cdrom = OVIRT_CDROM(object);
g_free(cdrom->priv->file);
G_OBJECT_CLASS(ovirt_cdrom_parent_class)->finalize(object);
}
static gboolean ovirt_cdrom_refresh_from_xml(OvirtCdrom *cdrom,
RestXmlNode *node)
{
RestXmlNode *file_node;
const char *file;
const char *file_key = g_intern_string("file");
char *name;
file_node = g_hash_table_lookup(node->children, file_key);
if (file_node != NULL) {
file = rest_xml_node_get_attr(file_node, "id");
if (g_strcmp0(file, cdrom->priv->file) != 0) {
g_free(cdrom->priv->file);
cdrom->priv->file = g_strdup(file);
g_object_notify(G_OBJECT(cdrom), "file");
}
}
g_object_get(G_OBJECT(cdrom), "name", &name, NULL);
if (name == NULL) {
/* Build up fake name as ovirt_collection_refresh_from_xml()
* expects it to be set (it uses it as a hash table key), but
* it's not set in oVirt XML as of 3.2. There can only be
* one cdrom node in an oVirt VM so this should be good
* enough for now
*/
g_debug("Setting fake 'name' for cdrom resource");
g_object_set(G_OBJECT(cdrom), "name", "cdrom0", NULL);
} else {
g_free(name);
}
return TRUE;
}
static gboolean ovirt_cdrom_init_from_xml(OvirtResource *resource,
RestXmlNode *node,
GError **error)
{
gboolean parsed_ok;
OvirtResourceClass *parent_class;
parsed_ok = ovirt_cdrom_refresh_from_xml(OVIRT_CDROM(resource), node);
if (!parsed_ok) {
return FALSE;
}
parent_class = OVIRT_RESOURCE_CLASS(ovirt_cdrom_parent_class);
return parent_class->init_from_xml(resource, node, error);
}
static char *ovirt_cdrom_to_xml(OvirtResource *resource)
{
OvirtCdrom *cdrom;
const char *file;
g_return_val_if_fail(OVIRT_IS_CDROM(resource), NULL);
cdrom = OVIRT_CDROM(resource);
file = cdrom->priv->file;
if (file == NULL) {
file = "";
}
return g_strdup_printf("<cdrom>\n\t<file id=\"%s\"/>\n</cdrom>", file);
}
static void ovirt_cdrom_class_init(OvirtCdromClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS(klass);
OvirtResourceClass *resource_class = OVIRT_RESOURCE_CLASS(klass);
GParamSpec *param_spec;
g_type_class_add_private(klass, sizeof(OvirtCdromPrivate));
resource_class->init_from_xml = ovirt_cdrom_init_from_xml;
resource_class->to_xml = ovirt_cdrom_to_xml;
resource_class->add_rest_params = ovirt_cdrom_add_rest_params;
object_class->finalize = ovirt_cdrom_finalize;
object_class->get_property = ovirt_cdrom_get_property;
object_class->set_property = ovirt_cdrom_set_property;
param_spec = g_param_spec_string("file",
"File",
"Name of the CD image",
NULL,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_property(object_class,
PROP_FILE,
param_spec);
}
static void ovirt_cdrom_init(OvirtCdrom *cdrom)
{
cdrom->priv = OVIRT_CDROM_GET_PRIVATE(cdrom);
}
gboolean ovirt_cdrom_update(OvirtCdrom *cdrom,
gboolean current,
OvirtProxy *proxy,
GError **error)
{
OvirtRestCall *call;
RestXmlNode *root;
call = OVIRT_REST_CALL(ovirt_resource_rest_call_new(REST_PROXY(proxy),
OVIRT_RESOURCE(cdrom)));
rest_proxy_call_set_method(REST_PROXY_CALL(call), "PUT");
if (current) {
rest_proxy_call_add_param(REST_PROXY_CALL(call), "current", NULL);
}
root = ovirt_resource_rest_call_sync(call, error);
g_object_unref(G_OBJECT(call));
if (root != NULL) {
rest_xml_node_unref(root);
return TRUE;
}
return FALSE;
}
void ovirt_cdrom_update_async(OvirtCdrom *cdrom,
gboolean current,
OvirtProxy *proxy,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
GSimpleAsyncResult *result;
OvirtResourceRestCall *call;
g_return_if_fail(OVIRT_IS_CDROM(cdrom));
g_return_if_fail(OVIRT_IS_PROXY(proxy));
g_return_if_fail((cancellable == NULL) || G_IS_CANCELLABLE(cancellable));
result = g_simple_async_result_new(G_OBJECT(cdrom), callback,
user_data,
ovirt_cdrom_update_async);
call = ovirt_resource_rest_call_new(REST_PROXY(proxy), OVIRT_RESOURCE(cdrom));
rest_proxy_call_set_method(REST_PROXY_CALL(call), "PUT");
if (current) {
rest_proxy_call_add_param(REST_PROXY_CALL(call), "current", NULL);
}
ovirt_rest_call_async(OVIRT_REST_CALL(call), result, cancellable,
NULL, NULL, NULL);
g_object_unref(G_OBJECT(call));
}
gboolean ovirt_cdrom_update_finish(OvirtCdrom *cdrom,
GAsyncResult *result,
GError **err)
{
g_return_val_if_fail(OVIRT_IS_CDROM(cdrom), FALSE);
g_return_val_if_fail(g_simple_async_result_is_valid(result, G_OBJECT(cdrom),
ovirt_cdrom_update_async),
FALSE);
g_return_val_if_fail((err == NULL) || (*err == NULL), FALSE);
return ovirt_rest_call_finish(result, err);
}
static void ovirt_cdrom_add_rest_params(G_GNUC_UNUSED OvirtResource *resource,
RestProxyCall *call)
{
rest_proxy_call_add_param(REST_PROXY_CALL(call), "current", NULL);
}

76
govirt/ovirt-cdrom.h Normal file
View File

@ -0,0 +1,76 @@
/*
* ovirt-cdrom.h: oVirt cdrom resource
*
* Copyright (C) 2012, 2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#ifndef __OVIRT_CDROM_H__
#define __OVIRT_CDROM_H__
#include <gio/gio.h>
#include <glib-object.h>
#include <govirt/ovirt-types.h>
#include <govirt/ovirt-resource.h>
G_BEGIN_DECLS
#define OVIRT_TYPE_CDROM (ovirt_cdrom_get_type ())
#define OVIRT_CDROM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OVIRT_TYPE_CDROM, OvirtCdrom))
#define OVIRT_CDROM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OVIRT_TYPE_CDROM, OvirtCdromClass))
#define OVIRT_IS_CDROM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OVIRT_TYPE_CDROM))
#define OVIRT_IS_CDROM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OVIRT_TYPE_CDROM))
#define OVIRT_CDROM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OVIRT_TYPE_CDROM, OvirtCdromClass))
typedef struct _OvirtCdrom OvirtCdrom;
typedef struct _OvirtCdromPrivate OvirtCdromPrivate;
typedef struct _OvirtCdromClass OvirtCdromClass;
struct _OvirtCdrom
{
OvirtResource parent;
OvirtCdromPrivate *priv;
/* Do not add fields to this struct */
};
struct _OvirtCdromClass
{
OvirtResourceClass parent_class;
gpointer padding[20];
};
GType ovirt_cdrom_get_type(void);
gboolean ovirt_cdrom_update(OvirtCdrom *cdrom, gboolean current,
OvirtProxy *proxy, GError **error);
void ovirt_cdrom_update_async(OvirtCdrom *cdrom,
gboolean current,
OvirtProxy *proxy,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean ovirt_cdrom_update_finish(OvirtCdrom *cdrom,
GAsyncResult *result,
GError **err);
G_END_DECLS
#endif /* __OVIRT_CDROM_H__ */

View File

@ -0,0 +1,48 @@
/*
* ovirt-collection-private.h: generic oVirt collection
*
* Copyright (C) 2012, 2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#ifndef __OVIRT_COLLECTION_PRIVATE_H__
#define __OVIRT_COLLECTION_PRIVATE_H__
#include <gio/gio.h>
#include <glib-object.h>
#include <ovirt-collection.h>
#include <ovirt-resource.h>
#include <rest/rest-xml-node.h>
G_BEGIN_DECLS
void ovirt_collection_set_resources(OvirtCollection *collection, GHashTable *resources);
OvirtCollection *ovirt_collection_new(const char *href,
const char *collection_name,
GType resource_type,
const char *resource_name);
OvirtCollection *ovirt_collection_new_from_xml(RestXmlNode *root_node,
GType collection_type,
const char *collection_name,
GType resource_type,
const char *resource_name,
GError **error);
G_END_DECLS
#endif /* __OVIRT_COLLECTION_PRIVATE_H__ */

473
govirt/ovirt-collection.c Normal file
View File

@ -0,0 +1,473 @@
/*
* ovirt-collection.c: generic oVirt collection handling
*
* Copyright (C) 2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#include <config.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include "ovirt-collection.h"
#include "ovirt-error.h"
#include "govirt-private.h"
#define OVIRT_COLLECTION_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE((obj), OVIRT_TYPE_COLLECTION, OvirtCollectionPrivate))
struct _OvirtCollectionPrivate {
char *href;
char *collection_xml_name;
GType resource_type;
char *resource_xml_name;
GHashTable *resources;
};
G_DEFINE_TYPE(OvirtCollection, ovirt_collection, G_TYPE_OBJECT);
enum {
PROP_0,
PROP_HREF,
PROP_RESOURCE_TYPE,
PROP_COLLECTION_XML_NAME,
PROP_RESOURCE_XML_NAME,
PROP_RESOURCES,
};
static void ovirt_collection_get_property(GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
OvirtCollection *collection = OVIRT_COLLECTION(object);
switch (prop_id) {
case PROP_HREF:
g_value_set_string(value, collection->priv->href);
break;
case PROP_RESOURCE_TYPE:
g_value_set_gtype(value, collection->priv->resource_type);
break;
case PROP_RESOURCES:
g_value_set_boxed(value, collection->priv->resources);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
}
}
static void ovirt_collection_set_property(GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
OvirtCollection *collection = OVIRT_COLLECTION(object);
switch (prop_id) {
case PROP_HREF:
collection->priv->href = g_value_dup_string(value);
break;
case PROP_RESOURCE_TYPE:
collection->priv->resource_type = g_value_get_gtype(value);
break;
case PROP_COLLECTION_XML_NAME:
collection->priv->collection_xml_name = g_value_dup_string(value);
break;
case PROP_RESOURCE_XML_NAME:
collection->priv->resource_xml_name = g_value_dup_string(value);
break;
case PROP_RESOURCES:
ovirt_collection_set_resources(collection, g_value_get_boxed(value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
}
}
static void ovirt_collection_finalize(GObject *object)
{
OvirtCollection *collection = OVIRT_COLLECTION(object);
if (collection->priv->resources != NULL) {
g_hash_table_unref(collection->priv->resources);
}
g_free(collection->priv->href);
g_free(collection->priv->collection_xml_name);
g_free(collection->priv->resource_xml_name);
G_OBJECT_CLASS(ovirt_collection_parent_class)->finalize(object);
}
static void ovirt_collection_class_init(OvirtCollectionClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS(klass);
GParamSpec *param_spec;
g_type_class_add_private(klass, sizeof(OvirtCollectionPrivate));
object_class->finalize = ovirt_collection_finalize;
object_class->get_property = ovirt_collection_get_property;
object_class->set_property = ovirt_collection_set_property;
param_spec = g_param_spec_string("href",
"Collection href",
"relative href for the collection",
NULL,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
g_object_class_install_property(object_class,
PROP_HREF,
param_spec);
param_spec = g_param_spec_gtype("resource-type",
"Resource Type",
"Type of resources held by this collection",
OVIRT_TYPE_RESOURCE,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
g_object_class_install_property(object_class,
PROP_RESOURCE_TYPE,
param_spec);
param_spec = g_param_spec_string("collection-xml-name",
"Collection XML Name",
"Name of the XML element for the collection",
NULL,
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
g_object_class_install_property(object_class,
PROP_COLLECTION_XML_NAME,
param_spec);
param_spec = g_param_spec_string("resource-xml-name",
"Resource XML Name",
"Name of the XML element for the resources stored in that collection",
NULL,
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
g_object_class_install_property(object_class,
PROP_RESOURCE_XML_NAME,
param_spec);
param_spec = g_param_spec_boxed("resources",
"Resources",
"Hash table containing the resources contained in this collection",
G_TYPE_HASH_TABLE,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_property(object_class,
PROP_RESOURCES,
param_spec);
}
static void ovirt_collection_init(OvirtCollection *collection)
{
collection->priv = OVIRT_COLLECTION_GET_PRIVATE(collection);
}
/**
* ovirt_collection_get_resources:
*
* Returns: (element-type utf8 OvirtResource) (transfer none):
*/
GHashTable *ovirt_collection_get_resources(OvirtCollection *collection)
{
g_return_val_if_fail(OVIRT_IS_COLLECTION(collection), NULL);
return collection->priv->resources;
}
/**
* ovirt_collection_set_resources:
* @collection:
* @resources: (element-type utf8 OvirtResource) (transfer none):
*/
void ovirt_collection_set_resources(OvirtCollection *collection, GHashTable *resources)
{
g_return_if_fail(OVIRT_IS_COLLECTION(collection));
if (collection->priv->resources != NULL) {
g_hash_table_unref(collection->priv->resources);
}
if (resources != NULL) {
collection->priv->resources = g_hash_table_ref(resources);
} else {
collection->priv->resources = NULL;
}
g_object_notify(G_OBJECT(collection), "resources");
}
static OvirtResource *
ovirt_collection_new_resource_from_xml(OvirtCollection *collection,
RestXmlNode *node,
GError **error)
{
return OVIRT_RESOURCE(g_initable_new(collection->priv->resource_type,
NULL, error,
"xml-node", node , NULL));
}
static gboolean
ovirt_collection_refresh_from_xml(OvirtCollection *collection,
RestXmlNode *root_node,
GError **error)
{
RestXmlNode *resources_node;
RestXmlNode *node;
GHashTable *resources;
const char *resource_key;
g_return_val_if_fail(OVIRT_IS_COLLECTION(collection), FALSE);
g_return_val_if_fail(root_node != NULL, FALSE);
g_return_val_if_fail((error == NULL) || (*error == NULL), FALSE);
if (strcmp(root_node->name, collection->priv->collection_xml_name) != 0) {
g_set_error(error, OVIRT_ERROR, OVIRT_ERROR_PARSING_FAILED,
_("Got '%s' node, expected '%s'"), root_node->name,
collection->priv->collection_xml_name);
return FALSE;
}
resource_key = g_intern_string(collection->priv->resource_xml_name);
resources = g_hash_table_new_full(g_str_hash, g_str_equal,
g_free, (GDestroyNotify)g_object_unref);
resources_node = g_hash_table_lookup(root_node->children, resource_key);
for (node = resources_node; node != NULL; node = node->next) {
OvirtResource *resource;
gchar *name;
resource = ovirt_collection_new_resource_from_xml(collection, node, error);
if (resource == NULL) {
if ((error != NULL) && (*error != NULL)) {
g_message("Failed to parse '%s' node: %s",
collection->priv->resource_xml_name, (*error)->message);
} else {
g_message("Failed to parse '%s' node",
collection->priv->resource_xml_name);
}
g_clear_error(error);
continue;
}
g_object_get(G_OBJECT(resource), "name", &name, NULL);
if (name == NULL) {
g_message("'%s' resource had no name in its XML description",
collection->priv->resource_xml_name);
g_object_unref(G_OBJECT(resource));
continue;
}
if (g_hash_table_lookup(resources, name) != NULL) {
g_message("'%s' resource with the same name ('%s') already exists",
collection->priv->resource_xml_name, name);
g_object_unref(G_OBJECT(resource));
g_free(name);
continue;
}
g_hash_table_insert(resources, name, resource);
}
ovirt_collection_set_resources(OVIRT_COLLECTION(collection), resources);
g_hash_table_unref(resources);
return TRUE;
}
OvirtCollection *ovirt_collection_new(const char *href,
const char *collection_name,
GType resource_type,
const char *resource_name)
{
OvirtCollection *self;
self = OVIRT_COLLECTION(g_object_new(OVIRT_TYPE_COLLECTION,
"href", href,
"collection-xml-name", collection_name,
"resource-type", resource_type,
"resource-xml-name", resource_name,
NULL));
return self;
}
OvirtCollection *ovirt_collection_new_from_xml(RestXmlNode *root_node,
GType collection_type,
const char *collection_name,
GType resource_type,
const char *resource_name,
GError **error)
{
OvirtCollection *self;
self = OVIRT_COLLECTION(g_object_new(collection_type,
"collection-xml-name", collection_name,
"resource-type", resource_type,
"resource-xml-name", resource_name,
NULL));
ovirt_collection_refresh_from_xml(self, root_node, error);
return self;
}
/**
* ovirt_collection_fetch:
* @collection: a #OvirtCollection
* @proxy: a #OvirtProxy
* @error: #GError to set on error, or NULL
*/
gboolean ovirt_collection_fetch(OvirtCollection *collection,
OvirtProxy *proxy,
GError **error)
{
RestXmlNode *xml;
g_return_val_if_fail(OVIRT_IS_COLLECTION(collection), FALSE);
g_return_val_if_fail(OVIRT_IS_PROXY(proxy), FALSE);
g_return_val_if_fail(collection->priv->href != NULL, FALSE);
xml = ovirt_proxy_get_collection_xml(proxy, collection->priv->href, NULL);
if (xml == NULL)
return FALSE;
ovirt_collection_refresh_from_xml(collection, xml, error);
rest_xml_node_unref(xml);
return TRUE;
}
static gboolean ovirt_collection_fetch_async_cb(OvirtProxy* proxy,
RestXmlNode *root_node,
gpointer user_data,
GError **error)
{
OvirtCollection *collection = OVIRT_COLLECTION(user_data);
g_return_val_if_fail(OVIRT_IS_COLLECTION(user_data), FALSE);
return ovirt_collection_refresh_from_xml(collection, root_node, error);
}
/**
* ovirt_collection_fetch_async:
* @collection: a #OvirtCollection
* @proxy: a #OvirtProxy
* @callback: (scope async): completion callback
* @user_data: (closure): opaque data for callback
*/
void ovirt_collection_fetch_async(OvirtCollection *collection,
OvirtProxy *proxy,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
GSimpleAsyncResult *result;
g_return_if_fail(OVIRT_IS_COLLECTION(collection));
g_return_if_fail(OVIRT_IS_PROXY(proxy));
g_return_if_fail((cancellable == NULL) || G_IS_CANCELLABLE(cancellable));
result = g_simple_async_result_new (G_OBJECT(collection), callback,
user_data,
ovirt_collection_fetch_async);
ovirt_proxy_get_collection_xml_async(proxy, collection->priv->href,
result, cancellable,
ovirt_collection_fetch_async_cb,
collection, NULL);
}
/**
* ovirt_collection_fetch_finish:
* @collection: a #OvirtCollection
* @result: async method result
*
* Return value: TRUE if successful, FALSE otherwise, with @error set.
*/
gboolean ovirt_collection_fetch_finish(OvirtCollection *collection,
GAsyncResult *result,
GError **err)
{
g_return_val_if_fail(OVIRT_IS_COLLECTION(collection), FALSE);
g_return_val_if_fail(g_simple_async_result_is_valid(result, G_OBJECT(collection),
ovirt_collection_fetch_async),
FALSE);
if (g_simple_async_result_propagate_error(G_SIMPLE_ASYNC_RESULT(result), err))
return FALSE;
return g_simple_async_result_get_op_res_gboolean(G_SIMPLE_ASYNC_RESULT(result));
}
/**
* ovirt_collection_lookup_resource:
* @collection: a #OvirtCollection
* @name: name of the resource to lookup
*
* Looks up a resource in @collection whose name is @name. If it cannot be
* found, NULL is returned. This method does not initiate any network
* activity, the remote collection content must have been fetched with
* ovirt_collection_fetch() or ovirt_collection_fetch_async() before
* calling this function.
*
* Return value: (transfer full): a #OvirtResource whose name is @name
* or NULL
*/
OvirtResource *ovirt_collection_lookup_resource(OvirtCollection *collection,
const char *name)
{
OvirtResource *resource;
g_return_val_if_fail(OVIRT_IS_COLLECTION(collection), NULL);
g_return_val_if_fail(name != NULL, NULL);
if (collection->priv->resources == NULL) {
return NULL;
}
resource = g_hash_table_lookup(collection->priv->resources, name);
if (resource == NULL) {
return NULL;
}
return g_object_ref(resource);
}

78
govirt/ovirt-collection.h Normal file
View File

@ -0,0 +1,78 @@
/*
* ovirt-collection.h: generic oVirt collection
*
* Copyright (C) 2012, 2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#ifndef __OVIRT_COLLECTION_H__
#define __OVIRT_COLLECTION_H__
#include <gio/gio.h>
#include <glib-object.h>
#include <govirt/ovirt-types.h>
#include <govirt/ovirt-resource.h>
G_BEGIN_DECLS
#define OVIRT_TYPE_COLLECTION (ovirt_collection_get_type ())
#define OVIRT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OVIRT_TYPE_COLLECTION, OvirtCollection))
#define OVIRT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OVIRT_TYPE_COLLECTION, OvirtCollectionClass))
#define OVIRT_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OVIRT_TYPE_COLLECTION))
#define OVIRT_IS_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OVIRT_TYPE_COLLECTION))
#define OVIRT_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OVIRT_TYPE_COLLECTION, OvirtCollectionClass))
typedef struct _OvirtCollection OvirtCollection;
typedef struct _OvirtCollectionPrivate OvirtCollectionPrivate;
typedef struct _OvirtCollectionClass OvirtCollectionClass;
struct _OvirtCollection
{
GObject parent;
OvirtCollectionPrivate *priv;
/* Do not add fields to this struct */
};
struct _OvirtCollectionClass
{
GObjectClass parent_class;
gpointer padding[20];
};
GType ovirt_collection_get_type(void);
GHashTable *ovirt_collection_get_resources(OvirtCollection *collection);
OvirtResource *ovirt_collection_lookup_resource(OvirtCollection *collection,
const char *name);
gboolean ovirt_collection_fetch(OvirtCollection *collection,
OvirtProxy *proxy,
GError **error);
void ovirt_collection_fetch_async(OvirtCollection *collection,
OvirtProxy *proxy,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean ovirt_collection_fetch_finish(OvirtCollection *collection,
GAsyncResult *result,
GError **err);
G_END_DECLS
#endif /* __OVIRT_COLLECTION_H__ */

View File

@ -0,0 +1,36 @@
/*** BEGIN file-header ***/
#include <govirt/govirt.h>
#include <govirt/govirt-private.h>
/*** END file-header ***/
/*** BEGIN file-production ***/
/* enumerations from "@filename@" */
/*** END file-production ***/
/*** BEGIN value-header ***/
G_GNUC_INTERNAL GType
@enum_name@_get_type (void)
{
static volatile gsize g_define_type_id__volatile = 0;
if (g_once_init_enter (&g_define_type_id__volatile))
{
static const G@Type@Value values[] = {
/*** END value-header ***/
/*** BEGIN value-production ***/
{ @VALUENAME@, "@VALUENAME@", "@valuenick@" },
/*** END value-production ***/
/*** BEGIN value-tail ***/
{ 0, NULL, NULL }
};
GType g_define_type_id =
g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
}
return g_define_type_id__volatile;
}
/*** END value-tail ***/

View File

@ -0,0 +1,24 @@
/*** BEGIN file-header ***/
#ifndef __OVIRT_ENUM_TYPES_PRIVATE_H__
#define __OVIRT_ENUM_TYPES_PRIVATE_H__
#include <glib-object.h>
G_BEGIN_DECLS
/*** END file-header ***/
/*** BEGIN file-production ***/
/* enumerations from "@filename@" */
/*** END file-production ***/
/*** BEGIN value-header ***/
GType @enum_name@_get_type (void) G_GNUC_CONST;
#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
/*** END value-header ***/
/*** BEGIN file-tail ***/
G_END_DECLS
#endif /* __OVIRT_ENUM_TYPES_PRIVATE_H__ */
/*** END file-tail ***/

View File

@ -0,0 +1,35 @@
/*** BEGIN file-header ***/
#include <govirt/govirt.h>
/*** END file-header ***/
/*** BEGIN file-production ***/
/* enumerations from "@filename@" */
/*** END file-production ***/
/*** BEGIN value-header ***/
GType
@enum_name@_get_type (void)
{
static volatile gsize g_define_type_id__volatile = 0;
if (g_once_init_enter (&g_define_type_id__volatile))
{
static const G@Type@Value values[] = {
/*** END value-header ***/
/*** BEGIN value-production ***/
{ @VALUENAME@, "@VALUENAME@", "@valuenick@" },
/*** END value-production ***/
/*** BEGIN value-tail ***/
{ 0, NULL, NULL }
};
GType g_define_type_id =
g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
}
return g_define_type_id__volatile;
}
/*** END value-tail ***/

View File

@ -0,0 +1,24 @@
/*** BEGIN file-header ***/
#ifndef __OVIRT_ENUM_TYPES_H__
#define __OVIRT_ENUM_TYPES_H__
#include <glib-object.h>
G_BEGIN_DECLS
/*** END file-header ***/
/*** BEGIN file-production ***/
/* enumerations from "@filename@" */
/*** END file-production ***/
/*** BEGIN value-header ***/
GType @enum_name@_get_type (void) G_GNUC_CONST;
#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
/*** END value-header ***/
/*** BEGIN file-tail ***/
G_END_DECLS
#endif /* __OVIRT_ENUM_TYPES_H__ */
/*** END file-tail ***/

27
govirt/ovirt-error.c Normal file
View File

@ -0,0 +1,27 @@
/*
* ovirt-error.c
*
* Copyright (C) 2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#include <govirt/ovirt-error.h>
GQuark ovirt_error_quark(void)
{
return g_quark_from_static_string ("ovirt-error-quark");
}

40
govirt/ovirt-error.h Normal file
View File

@ -0,0 +1,40 @@
/*
* ovirt-error.h: govirt error handling
*
* Copyright (C) 2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#ifndef __OVIRT_ERROR_H__
#define __OVIRT_ERROR_H__
#include <glib.h>
G_BEGIN_DECLS
typedef enum {
OVIRT_ERROR_FAILED,
OVIRT_ERROR_PARSING_FAILED,
OVIRT_ERROR_NOT_SUPPORTED,
OVIRT_ERROR_ACTION_FAILED,
OVIRT_ERROR_BAD_URI,
} OvirtError;
GQuark ovirt_error_quark(void);
#define OVIRT_ERROR ovirt_error_quark()
#endif

129
govirt/ovirt-options.c Normal file
View File

@ -0,0 +1,129 @@
/*
Copyright (C) 2010, 2013 Red Hat, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <glib.h>
#ifndef G_OS_WIN32
#include <pwd.h>
#endif
#include <stdlib.h>
#include <string.h>
#include <glib-object.h>
#include <glib/gi18n-lib.h>
#include "ovirt-options.h"
static char *ca_file = NULL;
G_GNUC_NORETURN
static void option_version(void)
{
g_print(PACKAGE_STRING "\n");
exit(0);
}
/**
* ovirt_get_option_group: (skip)
*
* Returns: (transfer full): a #GOptionGroup for the commandline
* arguments specific to libgovirt. You have to call
* ovirt_set_proxy_options() after to set the options on a
* #OvirtProxy.
**/
GOptionGroup* ovirt_get_option_group(void)
{
const GOptionEntry entries[] = {
{ "ovirt-ca-file", '\0', 0, G_OPTION_ARG_FILENAME, &ca_file,
N_("Root CA certificate file for secure SSL connections"), N_("<file>") },
{ "ovirt-version", '\0', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, option_version,
N_("Display libgovirt version information"), NULL },
{ NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
};
GOptionGroup *grp;
grp = g_option_group_new("ovirt", _("oVirt Options:"), _("Show oVirt Options"), NULL, NULL);
g_option_group_add_entries(grp, entries);
g_option_group_set_translation_domain(grp, GETTEXT_PACKAGE);
return grp;
}
#ifndef G_OS_WIN32
/* Taken from gnome-vfs-utils.c */
static gchar *
expand_initial_tilde(const gchar *path)
{
gchar *slash_after_user_name, *user_name;
struct passwd *passwd_file_entry;
if (path[1] == '/' || path[1] == '\0') {
return g_build_filename(g_get_home_dir(), &path[1], NULL);
}
slash_after_user_name = strchr(&path[1], '/');
if (slash_after_user_name == NULL) {
user_name = g_strdup(&path[1]);
} else {
user_name = g_strndup(&path[1], slash_after_user_name - &path[1]);
}
passwd_file_entry = getpwnam(user_name);
g_free(user_name);
if (passwd_file_entry == NULL || passwd_file_entry->pw_dir == NULL) {
return g_strdup(path);
}
return g_strconcat(passwd_file_entry->pw_dir,
slash_after_user_name,
NULL);
}
#endif
/**
* ovirt_set_proxy_options:
* @proxy: a #OvirtProxy to set options upon
*
* Set various properties on @proxy, according to the commandline
* arguments given to ovirt_get_option_group() option group.
**/
void ovirt_set_proxy_options(OvirtProxy *proxy)
{
g_return_if_fail(OVIRT_IS_PROXY(proxy));
if (ca_file) {
gchar *ca_file_absolute_path = NULL;
#ifndef G_OS_WIN32
/* We have to treat files with non-absolute paths starting
* with tilde (eg, ~foo/bar/ca.crt or ~/bar/ca.cert).
* Other non-absolute paths will be treated down in the
* stack, by libsoup, simply prepending the user's current
* dir to the file path */
if (ca_file[0] == '~')
ca_file_absolute_path = expand_initial_tilde(ca_file);
#endif
g_object_set(G_OBJECT(proxy),
"ssl-ca-file",
ca_file_absolute_path != NULL ? ca_file_absolute_path : ca_file,
NULL);
g_free (ca_file_absolute_path);
}
}

31
govirt/ovirt-options.h Normal file
View File

@ -0,0 +1,31 @@
/*
Copyright (C) 2010, 2013 Red Hat, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OVIRT_OPTION_H
#define OVIRT_OPTION_H
#include <glib.h>
#include "ovirt-proxy.h"
G_BEGIN_DECLS
GOptionGroup* ovirt_get_option_group(void);
void ovirt_set_proxy_options(OvirtProxy *proxy);
G_END_DECLS
#endif /* OVIRT_OPTION_H */

View File

@ -0,0 +1,189 @@
/*
* ovirt-proxy-deprecated.c: Deprecated OvirtProxy methods
*
* Copyright (C) 2011, 2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#undef OVIRT_DEBUG
#include <config.h>
#include "govirt.h"
#include "govirt-private.h"
#include <rest/rest-xml-node.h>
gboolean ovirt_proxy_fetch_vms(OvirtProxy *proxy, GError **error)
{
OvirtCollection *vms;
OvirtApi *api;
api = ovirt_proxy_fetch_api(proxy, error);
if (api == NULL)
return FALSE;
vms = ovirt_api_get_vms(api);
if (vms == NULL)
return FALSE;
return ovirt_collection_fetch(vms, proxy, error);
}
typedef struct {
GCancellable *cancellable;
GAsyncReadyCallback callback;
gpointer user_data;
} ApiAsyncData;
static void fetch_api_async_cb(GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
ApiAsyncData *data = user_data;
OvirtProxy *proxy = OVIRT_PROXY(source_object);
OvirtApi *api;
GError *error = NULL;
api = ovirt_proxy_fetch_api_finish(proxy, result, &error);
if (api == NULL) {
g_simple_async_report_error_in_idle(source_object,
data->callback, data->user_data,
OVIRT_ERROR, OVIRT_ERROR_FAILED,
"Could not fetch API endpoint");
} else {
OvirtCollection *vms;
vms = ovirt_api_get_vms(api);
g_return_if_fail(vms != NULL);
ovirt_collection_fetch_async(vms, proxy, data->cancellable,
data->callback, data->user_data);
}
g_free(data);
}
/**
* ovirt_proxy_fetch_vms_async:
* @proxy: a #OvirtProxy
* @callback: (scope async): completion callback
* @user_data: (closure): opaque data for callback
*/
void ovirt_proxy_fetch_vms_async(OvirtProxy *proxy,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
OvirtApi *api;
OvirtCollection *vms;
g_return_if_fail(OVIRT_IS_PROXY(proxy));
g_return_if_fail((cancellable == NULL) || G_IS_CANCELLABLE(cancellable));
api = ovirt_proxy_get_api(proxy);
if (api == NULL) {
ApiAsyncData *data = g_new0(ApiAsyncData, 1);
data->cancellable = cancellable;
data->callback = callback;
data->user_data = user_data;
ovirt_proxy_fetch_api_async(proxy, cancellable,
fetch_api_async_cb, data);
return;
}
vms = ovirt_api_get_vms(api);
g_return_if_fail(vms != NULL);
return ovirt_collection_fetch_async(vms, proxy, cancellable,
callback, user_data);
}
/**
* ovirt_proxy_fetch_vms_finish:
* @proxy: a #OvirtProxy
* @result: (transfer none): async method result
*
* Return value: (transfer container) (element-type OvirtVm): the list of
* #OvirtVm associated with #OvirtProxy.
* The returned list should be freed with g_list_free(), and can become
* invalid any time a #OvirtProxy call completes.
*/
GList *
ovirt_proxy_fetch_vms_finish(OvirtProxy *proxy,
GAsyncResult *result,
GError **err)
{
g_return_val_if_fail(OVIRT_IS_PROXY(proxy), NULL);
if (g_simple_async_result_propagate_error(G_SIMPLE_ASYNC_RESULT(result), err))
return NULL;
return ovirt_proxy_get_vms_internal(proxy);
}
/**
* ovirt_proxy_lookup_vm:
* @proxy: a #OvirtProxy
* @vm_name: name of the virtual machine to lookup
*
* Looks up a virtual machine whose name is @name. If it cannot be found,
* NULL is returned. This method does not initiate any network activity,
* the remote VM list must have been fetched with ovirt_proxy_fetch_vms()
* or ovirt_proxy_fetch_vms_async() before calling this function.
*
* Return value: (transfer full): a #OvirtVm whose name is @name or NULL
*/
OvirtVm *ovirt_proxy_lookup_vm(OvirtProxy *proxy, const char *vm_name)
{
OvirtApi *api;
OvirtCollection *vm_collection;
g_return_val_if_fail(OVIRT_IS_PROXY(proxy), NULL);
g_return_val_if_fail(vm_name != NULL, NULL);
api = ovirt_proxy_get_api(proxy);
if (api == NULL)
return NULL;
vm_collection = ovirt_api_get_vms(api);
if (vm_collection == NULL)
return NULL;
return OVIRT_VM(ovirt_collection_lookup_resource(vm_collection, vm_name));
}
/**
* ovirt_proxy_get_vms:
*
* Gets the list of remote VMs from the proxy object.
* This method does not initiate any network activity, the remote VM list
* must have been fetched with ovirt_proxy_fetch_vms() or
* ovirt_proxy_fetch_vms_async() before calling this function.
*
* Return value: (transfer container) (element-type OvirtVm): the list of
* #OvirtVm associated with #OvirtProxy.
* The returned list should be freed with g_list_free(), and can become
* invalid any time a #OvirtProxy call completes.
*/
GList *ovirt_proxy_get_vms(OvirtProxy *proxy)
{
return ovirt_proxy_get_vms_internal(proxy);
}

View File

@ -0,0 +1,84 @@
/*
* ovirt-proxy-private.h: oVirt virtual machine private header
*
* Copyright (C) 2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#ifndef __OVIRT_PROXY_PRIVATE_H__
#define __OVIRT_PROXY_PRIVATE_H__
#include <rest/rest-xml-node.h>
#include <libsoup/soup-cookie-jar.h>
#include <libsoup/soup-session-feature.h>
#include "ovirt-proxy.h"
#include "ovirt-rest-call.h"
G_BEGIN_DECLS
struct _OvirtProxyPrivate {
char *tmp_ca_file;
GByteArray *display_ca;
gboolean admin_mode;
OvirtApi *api;
char *jsessionid;
SoupCookie *jsessionid_cookie;
char *sso_token;
SoupCookieJar *cookie_jar;
GHashTable *additional_headers;
gboolean setting_ca_file;
gulong ssl_ca_file_changed_id;
};
RestXmlNode *ovirt_proxy_get_collection_xml(OvirtProxy *proxy,
const char *href,
GError **error);
typedef gboolean (*OvirtProxyGetCollectionAsyncCb)(OvirtProxy* proxy,
RestXmlNode *root_node,
gpointer user_data,
GError **error);
void ovirt_proxy_get_collection_xml_async(OvirtProxy *proxy,
const char *href,
GSimpleAsyncResult *result,
GCancellable *cancellable,
OvirtProxyGetCollectionAsyncCb callback,
gpointer user_data,
GDestroyNotify destroy_func);
typedef gboolean (*OvirtProxyCallAsyncCb)(OvirtProxy *proxy,
RestProxyCall *call,
gpointer user_data,
GError **error);
void ovirt_rest_call_async(OvirtRestCall *call,
GSimpleAsyncResult *result,
GCancellable *cancellable,
OvirtProxyCallAsyncCb callback,
gpointer user_data,
GDestroyNotify destroy_func);
gboolean ovirt_rest_call_finish(GAsyncResult *result, GError **err);
/* Work around G_GNUC_DEPRECATED attribute on ovirt_proxy_get_vms() */
GList *ovirt_proxy_get_vms_internal(OvirtProxy *proxy);
void ovirt_proxy_append_additional_headers(OvirtProxy *proxy,
RestProxyCall *call);
G_END_DECLS
#endif /* __OVIRT_PROXY_H__ */

1327
govirt/ovirt-proxy.c Normal file

File diff suppressed because it is too large Load Diff

112
govirt/ovirt-proxy.h Normal file
View File

@ -0,0 +1,112 @@
/*
* ovirt-proxy.h: oVirt proxy using the oVirt REST API
*
* Copyright (C) 2012 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#ifndef __OVIRT_PROXY_H__
#define __OVIRT_PROXY_H__
#include <rest/rest-proxy.h>
#include <govirt/ovirt-api.h>
#include <govirt/ovirt-types.h>
#include <govirt/ovirt-vm.h>
G_BEGIN_DECLS
#if !GLIB_CHECK_VERSION(2,32,0)
#define G_DEPRECATED_FOR(name) G_GNUC_DEPRECATED_FOR(name)
#endif
#define OVIRT_TYPE_PROXY ovirt_proxy_get_type()
#define OVIRT_PROXY(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), OVIRT_TYPE_PROXY, OvirtProxy))
#define OVIRT_PROXY_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), OVIRT_TYPE_PROXY, OvirtProxyClass))
#define OVIRT_IS_PROXY(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), OVIRT_TYPE_PROXY))
#define OVIRT_IS_PROXY_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), OVIRT_TYPE_PROXY))
#define OVIRT_PROXY_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), OVIRT_TYPE_PROXY, OvirtProxyClass))
typedef struct _OvirtProxyClass OvirtProxyClass;
typedef struct _OvirtProxyPrivate OvirtProxyPrivate;
struct _OvirtProxy {
RestProxy parent;
OvirtProxyPrivate *priv;
};
struct _OvirtProxyClass {
RestProxyClass parent_class;
};
GType ovirt_proxy_get_type(void);
OvirtProxy *ovirt_proxy_new(const char *host);
void ovirt_proxy_add_header(OvirtProxy *proxy, const char *header, const char *value);
void ovirt_proxy_add_headers(OvirtProxy *proxy, ...);
void ovirt_proxy_add_headers_from_valist(OvirtProxy *proxy, va_list headers);
G_DEPRECATED_FOR(ovirt_collection_lookup_resource)
OvirtVm *ovirt_proxy_lookup_vm(OvirtProxy *proxy, const char *vm_name);
G_DEPRECATED_FOR(ovirt_collection_get_resources)
GList *ovirt_proxy_get_vms(OvirtProxy *proxy);
G_DEPRECATED_FOR(ovirt_collection_fetch)
gboolean ovirt_proxy_fetch_vms(OvirtProxy *proxy, GError **error);
G_DEPRECATED_FOR(ovirt_collection_fetch_async)
void ovirt_proxy_fetch_vms_async(OvirtProxy *proxy,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
G_DEPRECATED_FOR(ovirt_collection_fetch_finish)
GList *ovirt_proxy_fetch_vms_finish(OvirtProxy *proxy,
GAsyncResult *result,
GError **err);
gboolean ovirt_proxy_fetch_ca_certificate(OvirtProxy *proxy, GError **error);
void ovirt_proxy_fetch_ca_certificate_async(OvirtProxy *proxy,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GByteArray *ovirt_proxy_fetch_ca_certificate_finish(OvirtProxy *proxy,
GAsyncResult *result,
GError **err);
OvirtApi *ovirt_proxy_fetch_api(OvirtProxy *proxy, GError **error);
void ovirt_proxy_fetch_api_async(OvirtProxy *proxy,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
OvirtApi *ovirt_proxy_fetch_api_finish(OvirtProxy *proxy,
GAsyncResult *result,
GError **err);
OvirtApi *ovirt_proxy_get_api(OvirtProxy *proxy);
#endif

View File

@ -0,0 +1,56 @@
/*
* ovirt-resource-private.h: generic oVirt resource
*
* Copyright (C) 2012, 2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#ifndef __OVIRT_RESOURCE_PRIVATE_H__
#define __OVIRT_RESOURCE_PRIVATE_H__
#include <ovirt-resource.h>
#include <ovirt-resource-rest-call.h>
G_BEGIN_DECLS
const char *ovirt_resource_get_action(OvirtResource *resource,
const char *action);
char *ovirt_resource_to_xml(OvirtResource *resource);
RestXmlNode *ovirt_resource_rest_call_sync(OvirtRestCall *call, GError **error);
typedef gboolean (*ActionResponseParser)(RestXmlNode *node, OvirtResource *resource, GError **error);
gboolean ovirt_resource_action(OvirtResource *resource, OvirtProxy *proxy,
const char *action,
ActionResponseParser response_parser,
GError **error);
void ovirt_resource_invoke_action_async(OvirtResource *resource,
const char *action,
OvirtProxy *proxy,
ActionResponseParser response_parser,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean ovirt_resource_action_finish(OvirtResource *resource,
GAsyncResult *result,
GError **err);
void ovirt_resource_add_rest_params(OvirtResource *resource,
RestProxyCall *call);
G_END_DECLS
#endif /* __OVIRT_RESOURCE_PRIVATE_H__ */

View File

@ -0,0 +1,205 @@
/*
* ovirt-rest-call.c: oVirt librest call proxy
*
* Copyright (C) 2012 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#include <config.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <libsoup/soup.h>
#include <rest/rest-params.h>
#include "glib-compat.h"
#include "ovirt-proxy.h"
#include "ovirt-resource-private.h"
#include "ovirt-resource-rest-call.h"
#include "ovirt-rest-call-error.h"
#include "ovirt-utils.h"
#define OVIRT_RESOURCE_REST_CALL_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE((obj), OVIRT_TYPE_RESOURCE_REST_CALL, OvirtResourceRestCallPrivate))
struct _OvirtResourceRestCallPrivate {
OvirtResource *resource;
} ;
G_DEFINE_TYPE(OvirtResourceRestCall, ovirt_resource_rest_call, OVIRT_TYPE_REST_CALL);
enum {
PROP_0,
PROP_RESOURCE,
};
static void ovirt_resource_rest_call_get_property(GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
OvirtResourceRestCall *call = OVIRT_RESOURCE_REST_CALL(object);
switch (prop_id) {
case PROP_RESOURCE:
g_value_set_object(value, call->priv->resource);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
}
}
static void ovirt_resource_rest_call_set_property(GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
OvirtResourceRestCall *call = OVIRT_RESOURCE_REST_CALL(object);
switch (prop_id) {
case PROP_RESOURCE: {
char *href;
call->priv->resource = g_value_dup_object(value);
if (call->priv->resource != NULL) {
g_object_get(G_OBJECT(call->priv->resource), "href", &href, NULL);
g_return_if_fail(href != NULL);
g_object_set(object, "href", href, NULL);
g_free(href);
}
break;
}
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
}
}
static void append_params(OvirtResourceRestCall *call, RestParams *params)
{
GHashTable *params_hash;
params_hash = rest_params_as_string_hash_table(params);
if (g_hash_table_size(params_hash) > 0) {
char *serialized_params;
char *href;
char *new_href;
serialized_params = soup_form_encode_hash(params_hash);
g_object_get(G_OBJECT(call), "href", &href, NULL);
new_href = g_strconcat(href, ";", serialized_params, NULL);
g_object_set(G_OBJECT(call), "href", new_href, NULL);
g_free(new_href);
g_free(href);
g_free(serialized_params);
}
g_hash_table_unref(params_hash);
}
static gboolean ovirt_resource_rest_call_class_serialize_params(RestProxyCall *call,
gchar **content_type,
gchar **content,
gsize *content_len,
GError **error)
{
OvirtResourceRestCall *self;
RestParams *params;
g_return_val_if_fail(OVIRT_IS_RESOURCE_REST_CALL(call), FALSE);
g_return_val_if_fail(content_type != NULL, FALSE);
g_return_val_if_fail(content != NULL, FALSE);
g_return_val_if_fail(content_len != NULL, FALSE);
self = OVIRT_RESOURCE_REST_CALL(call);
*content_type = g_strdup("application/xml");
if (g_strcmp0(rest_proxy_call_get_method(call), "PUT") == 0) {
g_return_val_if_fail(self->priv->resource != NULL, FALSE);
*content = ovirt_resource_to_xml(self->priv->resource);
*content_len = strlen(*content);
} else {
*content = NULL;
*content_len = 0;
}
ovirt_resource_add_rest_params(self->priv->resource, call);
params = rest_proxy_call_get_params(call);
if (!rest_params_are_strings(params)) {
g_set_error(error, OVIRT_REST_CALL_ERROR, 0,
_("Unexpected parameter type in REST call"));
return FALSE;
}
append_params(self, params);
return TRUE;
}
static void ovirt_resource_rest_call_dispose(GObject *object)
{
OvirtResourceRestCall *call = OVIRT_RESOURCE_REST_CALL(object);
g_clear_object(&call->priv->resource);
G_OBJECT_CLASS(ovirt_resource_rest_call_parent_class)->dispose(object);
}
static void ovirt_resource_rest_call_class_init(OvirtResourceRestCallClass *klass)
{
GParamSpec *param_spec;
GObjectClass *object_class = G_OBJECT_CLASS(klass);
g_type_class_add_private(klass, sizeof(OvirtResourceRestCallPrivate));
object_class->dispose = ovirt_resource_rest_call_dispose;
object_class->get_property = ovirt_resource_rest_call_get_property;
object_class->set_property = ovirt_resource_rest_call_set_property;
REST_PROXY_CALL_CLASS(klass)->serialize_params = ovirt_resource_rest_call_class_serialize_params;
param_spec = g_param_spec_object("resource",
"Resource",
"Resource being manipulated through this REST call",
OVIRT_TYPE_RESOURCE,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
g_object_class_install_property(object_class, PROP_RESOURCE, param_spec);
}
static void ovirt_resource_rest_call_init(OvirtResourceRestCall *call)
{
call->priv = OVIRT_RESOURCE_REST_CALL_GET_PRIVATE(call);
}
OvirtResourceRestCall *ovirt_resource_rest_call_new(RestProxy *proxy,
OvirtResource *resource)
{
OvirtResourceRestCall *call;
g_return_val_if_fail(OVIRT_IS_PROXY(proxy), NULL);
call = OVIRT_RESOURCE_REST_CALL(g_object_new(OVIRT_TYPE_RESOURCE_REST_CALL,
"proxy", proxy,
"resource", resource,
NULL));
return call;
}

View File

@ -0,0 +1,63 @@
/*
* ovirt-rest-call.h: oVirt librest call proxy
*
* Copyright (C) 2012 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#ifndef __OVIRT_RESOURCE_REST_CALL_H__
#define __OVIRT_RESOURCE_REST_CALL_H__
#include <govirt/ovirt-resource.h>
#include <govirt/ovirt-rest-call.h>
G_BEGIN_DECLS
#define OVIRT_TYPE_RESOURCE_REST_CALL (ovirt_resource_rest_call_get_type ())
#define OVIRT_RESOURCE_REST_CALL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OVIRT_TYPE_RESOURCE_REST_CALL, OvirtResourceRestCall))
#define OVIRT_RESOURCE_REST_CALL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OVIRT_TYPE_RESOURCE_REST_CALL, OvirtResourceRestCallClass))
#define OVIRT_IS_RESOURCE_REST_CALL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OVIRT_TYPE_RESOURCE_REST_CALL))
#define OVIRT_IS_RESOURCE_REST_CALL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OVIRT_TYPE_RESOURCE_REST_CALL))
#define OVIRT_RESOURCE_REST_CALL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OVIRT_TYPE_RESOURCE_REST_CALL, OvirtResourceRestCallClass))
typedef struct _OvirtResourceRestCall OvirtResourceRestCall;
typedef struct _OvirtResourceRestCallPrivate OvirtResourceRestCallPrivate;
typedef struct _OvirtResourceRestCallClass OvirtResourceRestCallClass;
struct _OvirtResourceRestCall
{
OvirtRestCall parent;
OvirtResourceRestCallPrivate *priv;
/* Do not add fields to this struct */
};
struct _OvirtResourceRestCallClass
{
OvirtRestCallClass parent_class;
gpointer padding[20];
};
G_GNUC_INTERNAL GType ovirt_resource_rest_call_get_type(void);
G_GNUC_INTERNAL OvirtResourceRestCall *ovirt_resource_rest_call_new(RestProxy *proxy,
OvirtResource *resource);
G_END_DECLS
#endif /* __OVIRT_RESOURCE_REST_CALL_H__ */

1067
govirt/ovirt-resource.c Normal file

File diff suppressed because it is too large Load Diff

113
govirt/ovirt-resource.h Normal file
View File

@ -0,0 +1,113 @@
/*
* ovirt-resource.h: generic oVirt resource
*
* Copyright (C) 2012, 2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#ifndef __OVIRT_RESOURCE_H__
#define __OVIRT_RESOURCE_H__
#include <gio/gio.h>
#include <glib-object.h>
#include <govirt/ovirt-types.h>
#include <rest/rest-proxy-call.h>
#include <rest/rest-xml-node.h>
G_BEGIN_DECLS
#define OVIRT_TYPE_RESOURCE (ovirt_resource_get_type ())
#define OVIRT_RESOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OVIRT_TYPE_RESOURCE, OvirtResource))
#define OVIRT_RESOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OVIRT_TYPE_RESOURCE, OvirtResourceClass))
#define OVIRT_IS_RESOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OVIRT_TYPE_RESOURCE))
#define OVIRT_IS_RESOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OVIRT_TYPE_RESOURCE))
#define OVIRT_RESOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OVIRT_TYPE_RESOURCE, OvirtResourceClass))
typedef struct _OvirtResource OvirtResource;
typedef struct _OvirtResourcePrivate OvirtResourcePrivate;
typedef struct _OvirtResourceClass OvirtResourceClass;
struct _OvirtResource
{
GObject parent;
OvirtResourcePrivate *priv;
/* Do not add fields to this struct */
};
struct _OvirtResourceClass
{
GObjectClass parent_class;
gboolean (*init_from_xml)(OvirtResource *resource,
RestXmlNode *node,
GError **error);
char *(*to_xml)(OvirtResource *resource);
#ifdef GOVIRT_UNSTABLE_API_ABI
void (*add_rest_params)(OvirtResource *resource,
RestProxyCall *call);
#else
gpointer padding0;
#endif
gpointer padding[18];
};
GType ovirt_resource_get_type(void);
const char *ovirt_resource_get_sub_collection(OvirtResource *resource,
const char *sub_collection);
gboolean ovirt_resource_update(OvirtResource *resource,
OvirtProxy *proxy,
GError **error);
void ovirt_resource_update_async(OvirtResource *resource,
OvirtProxy *proxy,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean ovirt_resource_update_finish(OvirtResource *resource,
GAsyncResult *result,
GError **err);
gboolean ovirt_resource_refresh(OvirtResource *resource,
OvirtProxy *proxy,
GError **error);
void ovirt_resource_refresh_async(OvirtResource *resource,
OvirtProxy *proxy,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean ovirt_resource_refresh_finish(OvirtResource *resource,
GAsyncResult *result,
GError **err);
gboolean ovirt_resource_delete(OvirtResource *resource,
OvirtProxy *proxy,
GError **error);
void ovirt_resource_delete_async(OvirtResource *resource,
OvirtProxy *proxy,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean ovirt_resource_delete_finish(OvirtResource *resource,
GAsyncResult *result,
GError **err);
G_END_DECLS
#endif /* __OVIRT_RESOURCE_H__ */

View File

@ -0,0 +1,38 @@
/*
* ovirt-rest-call-error.h: oVirt librest call proxy errors
*
* Copyright (C) 2012 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#ifndef __OVIRT_REST_CALL_ERROR_H__
#define __OVIRT_REST_CALL_ERROR_H__
G_BEGIN_DECLS
typedef enum {
OVIRT_REST_CALL_ERROR_XML,
OVIRT_REST_CALL_ERROR_CANCELLED,
} OvirtRestCallError;
#define OVIRT_REST_CALL_ERROR ovirt_rest_call_error_quark()
GQuark ovirt_rest_call_error_quark(void);
G_END_DECLS
#endif /* __OVIRT_REST_CALL_ERROR_H__ */

173
govirt/ovirt-rest-call.c Normal file
View File

@ -0,0 +1,173 @@
/*
* ovirt-rest-call.c: oVirt librest call proxy
*
* Copyright (C) 2012, 2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#include <config.h>
#include <rest/rest-params.h>
#include "ovirt-proxy.h"
#include "ovirt-proxy-private.h"
#include "ovirt-rest-call.h"
#include "ovirt-rest-call-error.h"
#include "ovirt-utils.h"
#define OVIRT_REST_CALL_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE((obj), OVIRT_TYPE_REST_CALL, OvirtRestCallPrivate))
struct _OvirtRestCallPrivate {
char *href;
};
G_DEFINE_ABSTRACT_TYPE(OvirtRestCall, ovirt_rest_call, REST_TYPE_PROXY_CALL);
enum {
PROP_0,
PROP_METHOD,
PROP_HREF,
};
GQuark ovirt_rest_call_error_quark(void)
{
return g_quark_from_static_string("ovirt-rest-call");
}
static void ovirt_rest_call_get_property(GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
OvirtRestCall *call = OVIRT_REST_CALL(object);
switch (prop_id) {
case PROP_METHOD: {
const char *method;
method = rest_proxy_call_get_method(REST_PROXY_CALL(call));
g_value_set_string(value, method);
break;
}
case PROP_HREF:
g_value_set_string(value, call->priv->href);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
}
}
static void ovirt_rest_call_set_property(GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
OvirtRestCall *call = OVIRT_REST_CALL(object);
switch (prop_id) {
case PROP_METHOD:
rest_proxy_call_set_method(REST_PROXY_CALL(call),
g_value_get_string(value));
break;
case PROP_HREF:
g_free(call->priv->href);
call->priv->href = g_value_dup_string(value);
rest_proxy_call_set_function(REST_PROXY_CALL(call), call->priv->href);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
}
}
static void ovirt_rest_call_finalize(GObject *object)
{
OvirtRestCall *call = OVIRT_REST_CALL(object);
g_free(call->priv->href);
G_OBJECT_CLASS(ovirt_rest_call_parent_class)->finalize(object);
}
static void ovirt_rest_call_constructed(GObject *object)
{
OvirtProxy *proxy;
G_OBJECT_CLASS(ovirt_rest_call_parent_class)->constructed(object);
g_object_get(object, "proxy", &proxy, NULL);
if (proxy != NULL) {
gboolean admin;
g_object_get(G_OBJECT(proxy), "admin", &admin, NULL);
if (admin) {
rest_proxy_call_add_header(REST_PROXY_CALL(object), "Filter", "false");
} else {
rest_proxy_call_add_header(REST_PROXY_CALL(object), "Filter", "true");
}
ovirt_proxy_append_additional_headers(proxy, REST_PROXY_CALL(object));
g_object_unref(proxy);
}
}
static void ovirt_rest_call_class_init(OvirtRestCallClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS(klass);
GParamSpec *param_spec;
g_type_class_add_private(klass, sizeof(OvirtRestCallPrivate));
object_class->get_property = ovirt_rest_call_get_property;
object_class->set_property = ovirt_rest_call_set_property;
object_class->constructed = ovirt_rest_call_constructed;
object_class->finalize = ovirt_rest_call_finalize;
param_spec = g_param_spec_string("method",
"Method",
"REST method for the call",
NULL,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_property(object_class,
PROP_METHOD,
param_spec);
param_spec = g_param_spec_string("href",
"Href",
"Resource Href",
NULL,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_property(object_class,
PROP_HREF,
param_spec);
}
static void ovirt_rest_call_init(G_GNUC_UNUSED OvirtRestCall *call)
{
call->priv = OVIRT_REST_CALL_GET_PRIVATE(call);
}

60
govirt/ovirt-rest-call.h Normal file
View File

@ -0,0 +1,60 @@
/*
* ovirt-rest-call.h: oVirt librest call proxy
*
* Copyright (C) 2012 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#ifndef __OVIRT_REST_CALL_H__
#define __OVIRT_REST_CALL_H__
#include <rest/rest-proxy.h>
G_BEGIN_DECLS
#define OVIRT_TYPE_REST_CALL (ovirt_rest_call_get_type ())
#define OVIRT_REST_CALL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OVIRT_TYPE_REST_CALL, OvirtRestCall))
#define OVIRT_REST_CALL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OVIRT_TYPE_REST_CALL, OvirtRestCallClass))
#define OVIRT_IS_REST_CALL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OVIRT_TYPE_REST_CALL))
#define OVIRT_IS_REST_CALL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OVIRT_TYPE_REST_CALL))
#define OVIRT_REST_CALL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OVIRT_TYPE_REST_CALL, OvirtRestCallClass))
typedef struct _OvirtRestCall OvirtRestCall;
typedef struct _OvirtRestCallPrivate OvirtRestCallPrivate;
typedef struct _OvirtRestCallClass OvirtRestCallClass;
struct _OvirtRestCall
{
RestProxyCall parent;
OvirtRestCallPrivate *priv;
/* Do not add fields to this struct */
};
struct _OvirtRestCallClass
{
RestProxyCallClass parent_class;
gpointer padding[20];
};
G_GNUC_INTERNAL GType ovirt_rest_call_get_type(void);
G_END_DECLS
#endif /* __OVIRT_REST_CALL_H__ */

View File

@ -0,0 +1,35 @@
/*
* ovirt-storage-domain-private.h: oVirt storage domain resource
*
* Copyright (C) 2012, 2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#ifndef __OVIRT_STORAGE_DOMAIN_PRIVATE_H__
#define __OVIRT_STORAGE_DOMAIN_PRIVATE_H__
#include <ovirt-storage-domain.h>
#include <rest/rest-xml-node.h>
G_BEGIN_DECLS
OvirtStorageDomain *ovirt_storage_domain_new_from_xml(RestXmlNode *node,
GError **error);
G_END_DECLS
#endif /* __OVIRT_STORAGE_DOMAIN_PRIVATE_H__ */

View File

@ -0,0 +1,382 @@
/*
* ovirt-storage-domain.c: oVirt storage domain handling
*
* Copyright (C) 2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#include <config.h>
#include "ovirt-enum-types.h"
#include "ovirt-storage-domain.h"
#include "govirt-private.h"
#define OVIRT_STORAGE_DOMAIN_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE((obj), OVIRT_TYPE_STORAGE_DOMAIN, OvirtStorageDomainPrivate))
struct _OvirtStorageDomainPrivate {
OvirtCollection *files;
OvirtStorageDomainType type;
gboolean is_master;
guint64 available;
guint64 used;
guint64 committed;
OvirtStorageDomainFormatVersion version;
OvirtStorageDomainState state;
};
G_DEFINE_TYPE(OvirtStorageDomain, ovirt_storage_domain, OVIRT_TYPE_RESOURCE);
enum {
PROP_0,
PROP_STORAGE_TYPE,
PROP_MASTER,
PROP_AVAILABLE,
PROP_USED,
PROP_COMMITTED,
PROP_VERSION,
PROP_STATE
};
static gboolean
ovirt_storage_domain_refresh_from_xml(OvirtStorageDomain *domain,
RestXmlNode *node);
static void ovirt_storage_domain_get_property(GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
OvirtStorageDomain *domain = OVIRT_STORAGE_DOMAIN(object);
switch (prop_id) {
case PROP_STORAGE_TYPE:
g_value_set_enum(value, domain->priv->type);
break;
case PROP_MASTER:
g_value_set_boolean(value, domain->priv->is_master);
break;
case PROP_AVAILABLE:
g_value_set_uint64(value, domain->priv->available);
break;
case PROP_USED:
g_value_set_uint64(value, domain->priv->used);
break;
case PROP_COMMITTED:
g_value_set_uint64(value, domain->priv->committed);
break;
case PROP_VERSION:
g_value_set_enum(value, domain->priv->version);
break;
case PROP_STATE:
g_value_set_enum(value, domain->priv->state);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
}
}
static void ovirt_storage_domain_set_property(GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
OvirtStorageDomain *domain = OVIRT_STORAGE_DOMAIN(object);
switch (prop_id) {
case PROP_STORAGE_TYPE:
domain->priv->type = g_value_get_enum(value);
break;
case PROP_MASTER:
domain->priv->is_master = g_value_get_boolean(value);
break;
case PROP_AVAILABLE:
domain->priv->available = g_value_get_uint64(value);
break;
case PROP_USED:
domain->priv->used = g_value_get_uint64(value);
break;
case PROP_COMMITTED:
domain->priv->committed = g_value_get_uint64(value);
break;
case PROP_VERSION:
domain->priv->version = g_value_get_enum(value);
break;
case PROP_STATE:
domain->priv->state = g_value_get_enum(value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
}
}
static void
ovirt_storage_domain_dispose(GObject *obj)
{
OvirtStorageDomain *domain = OVIRT_STORAGE_DOMAIN(obj);
g_clear_object(&domain->priv->files);
G_OBJECT_CLASS(ovirt_storage_domain_parent_class)->dispose(obj);
}
static gboolean ovirt_storage_domain_init_from_xml(OvirtResource *resource,
RestXmlNode *node,
GError **error)
{
gboolean parsed_ok;
OvirtResourceClass *parent_class;
OvirtStorageDomain *domain;
domain = OVIRT_STORAGE_DOMAIN(resource);
parsed_ok = ovirt_storage_domain_refresh_from_xml(domain, node);
if (!parsed_ok) {
return FALSE;
}
parent_class = OVIRT_RESOURCE_CLASS(ovirt_storage_domain_parent_class);
return parent_class->init_from_xml(resource, node, error);
}
static void ovirt_storage_domain_class_init(OvirtStorageDomainClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS(klass);
OvirtResourceClass *resource_class = OVIRT_RESOURCE_CLASS(klass);
GParamSpec *param_spec;
g_type_class_add_private(klass, sizeof(OvirtStorageDomainPrivate));
resource_class->init_from_xml = ovirt_storage_domain_init_from_xml;
object_class->dispose = ovirt_storage_domain_dispose;
object_class->get_property = ovirt_storage_domain_get_property;
object_class->set_property = ovirt_storage_domain_set_property;
param_spec = g_param_spec_enum("type",
"Storage Type",
"Type of the storage domain",
OVIRT_TYPE_STORAGE_DOMAIN_TYPE,
OVIRT_STORAGE_DOMAIN_TYPE_DATA,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_property(object_class,
PROP_STORAGE_TYPE,
param_spec);
param_spec = g_param_spec_boolean("master",
"Master Storage Domain?",
"Indicates whether the storage domain is a master on not",
FALSE,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_property(object_class,
PROP_MASTER,
param_spec);
param_spec = g_param_spec_uint64("available",
"Space available",
"Space available in the storage domain in bytes",
0,
G_MAXUINT64,
0,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_property(object_class,
PROP_AVAILABLE,
param_spec);
param_spec = g_param_spec_uint64("used",
"Space used",
"Space used in the storage domain in bytes",
0,
G_MAXUINT64,
0,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_property(object_class,
PROP_USED,
param_spec);
param_spec = g_param_spec_uint64("committed",
"Space committed",
"Space committed in the storage domain in bytes",
0,
G_MAXUINT64,
0,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_property(object_class,
PROP_COMMITTED,
param_spec);
param_spec = g_param_spec_enum("version",
"Storage Format Version",
"Storage Format Version of the storage domain",
OVIRT_TYPE_STORAGE_DOMAIN_FORMAT_VERSION,
OVIRT_STORAGE_DOMAIN_FORMAT_VERSION_V1,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_property(object_class,
PROP_VERSION,
param_spec);
param_spec = g_param_spec_enum("state",
"Storage Domain State",
"State of the storage domain",
OVIRT_TYPE_STORAGE_DOMAIN_STATE,
OVIRT_STORAGE_DOMAIN_STATE_UNKNOWN,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_property(object_class,
PROP_STATE,
param_spec);
}
static void ovirt_storage_domain_init(OvirtStorageDomain *domain)
{
domain->priv = OVIRT_STORAGE_DOMAIN_GET_PRIVATE(domain);
}
G_GNUC_INTERNAL
OvirtStorageDomain *ovirt_storage_domain_new_from_xml(RestXmlNode *node,
GError **error)
{
GObject *domain;
domain = g_initable_new(OVIRT_TYPE_STORAGE_DOMAIN, NULL, error,
"xml-node", node, NULL);
return OVIRT_STORAGE_DOMAIN(domain);
}
OvirtStorageDomain *ovirt_storage_domain_new(void)
{
GObject *domain;
domain = g_initable_new(OVIRT_TYPE_STORAGE_DOMAIN, NULL, NULL, NULL);
return OVIRT_STORAGE_DOMAIN(domain);
}
typedef struct {
const char *xml_node;
GType type;
const char *prop_name;
} OvirtXmlElement;
static gboolean
ovirt_resource_parse_xml(OvirtResource *resource,
RestXmlNode *node,
OvirtXmlElement *elements)
{
g_return_val_if_fail(OVIRT_IS_RESOURCE(resource), FALSE);
g_return_val_if_fail(elements != NULL, FALSE);
for (;elements->xml_node != NULL; elements++) {
const char *value_str;
GValue value = { 0, };
value_str = ovirt_rest_xml_node_get_content_from_path(node, elements->xml_node);
if (value_str == NULL) {
continue;
}
g_value_init(&value, elements->type);
if (G_TYPE_IS_ENUM(elements->type)) {
int enum_value;
enum_value = ovirt_utils_genum_get_value(elements->type,
value_str, 0);
g_value_set_enum(&value, enum_value);
} else if (elements->type == G_TYPE_BOOLEAN) {
gboolean bool_value;
bool_value = ovirt_utils_boolean_from_string(value_str);
g_value_set_boolean(&value, bool_value);
} else if (elements->type == G_TYPE_UINT64) {
guint64 int64_value;
int64_value = g_ascii_strtoull(value_str, NULL, 0);
g_value_set_uint64(&value, int64_value);
} else if (g_type_is_a(elements->type, OVIRT_TYPE_RESOURCE)) {
GObject *resource_value;
resource_value = g_initable_new(elements->type, NULL, NULL,
"xml-node", node, NULL);
g_value_set_object(&value, resource_value);
}
g_object_set_property(G_OBJECT(resource), elements->prop_name, &value);
g_value_unset(&value);
}
return TRUE;
}
static gboolean
ovirt_storage_domain_refresh_from_xml(OvirtStorageDomain *domain,
RestXmlNode *node)
{
OvirtXmlElement storage_domain_elements[] = {
{ "type", OVIRT_TYPE_STORAGE_DOMAIN_TYPE, "type" },
{ "master", G_TYPE_BOOLEAN, "master" },
{ "available", G_TYPE_UINT64, "available" },
{ "used", G_TYPE_UINT64, "used" },
{ "committed", G_TYPE_UINT64, "committed" },
{ "storage_format", OVIRT_TYPE_STORAGE_DOMAIN_FORMAT_VERSION, "version" },
{ "status/state", OVIRT_TYPE_STORAGE_DOMAIN_STATE, "state" },
{ NULL, G_TYPE_INVALID, NULL }
};
return ovirt_resource_parse_xml(OVIRT_RESOURCE(domain), node, storage_domain_elements);
}
/**
* ovirt_storage_domain_get_files:
* @domain: a #OvirtStorageDomain
*
* Gets a #OvirtCollection representing the list of remote files from a
* storage domain object. This method does not initiate any network
* activity, the remote file list must be then be fetched using
* ovirt_collection_fetch() or ovirt_collection_fetch_async().
*
* Return value: (transfer none): a #OvirtCollection representing the list
* of files associated with @domain.
*/
OvirtCollection *ovirt_storage_domain_get_files(OvirtStorageDomain *domain)
{
const char *href;
g_return_val_if_fail(OVIRT_IS_STORAGE_DOMAIN(domain), NULL);
if (domain->priv->files != NULL)
return domain->priv->files;
href = ovirt_resource_get_sub_collection(OVIRT_RESOURCE(domain), "files");
if (href == NULL)
return NULL;
domain->priv->files = ovirt_collection_new(href, "files",
OVIRT_TYPE_RESOURCE,
"file");
return domain->priv->files;
}

View File

@ -0,0 +1,91 @@
/*
* ovirt-storage-domain.h: oVirt storage domain resource
*
* Copyright (C) 2012, 2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#ifndef __OVIRT_STORAGE_DOMAIN_H__
#define __OVIRT_STORAGE_DOMAIN_H__
#include <gio/gio.h>
#include <glib-object.h>
#include <govirt/ovirt-collection.h>
#include <govirt/ovirt-resource.h>
#include <govirt/ovirt-types.h>
G_BEGIN_DECLS
#define OVIRT_TYPE_STORAGE_DOMAIN (ovirt_storage_domain_get_type ())
#define OVIRT_STORAGE_DOMAIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OVIRT_TYPE_STORAGE_DOMAIN, OvirtStorageDomain))
#define OVIRT_STORAGE_DOMAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OVIRT_TYPE_STORAGE_DOMAIN, OvirtStorageDomainClass))
#define OVIRT_IS_STORAGE_DOMAIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OVIRT_TYPE_STORAGE_DOMAIN))
#define OVIRT_IS_STORAGE_DOMAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OVIRT_TYPE_STORAGE_DOMAIN))
#define OVIRT_STORAGE_DOMAIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OVIRT_TYPE_STORAGE_DOMAIN, OvirtStorageDomainClass))
typedef enum {
OVIRT_STORAGE_DOMAIN_FORMAT_VERSION_V1,
OVIRT_STORAGE_DOMAIN_FORMAT_VERSION_V2,
OVIRT_STORAGE_DOMAIN_FORMAT_VERSION_V3,
} OvirtStorageDomainFormatVersion;
typedef enum {
OVIRT_STORAGE_DOMAIN_STATE_ACTIVE,
OVIRT_STORAGE_DOMAIN_STATE_INACTIVE,
OVIRT_STORAGE_DOMAIN_STATE_LOCKED,
OVIRT_STORAGE_DOMAIN_STATE_MIXED,
OVIRT_STORAGE_DOMAIN_STATE_UNATTACHED,
OVIRT_STORAGE_DOMAIN_STATE_MAINTENANCE,
OVIRT_STORAGE_DOMAIN_STATE_UNKNOWN,
} OvirtStorageDomainState;
typedef enum {
OVIRT_STORAGE_DOMAIN_TYPE_DATA,
OVIRT_STORAGE_DOMAIN_TYPE_ISO,
OVIRT_STORAGE_DOMAIN_TYPE_EXPORT,
OVIRT_STORAGE_DOMAIN_TYPE_IMAGE,
} OvirtStorageDomainType;
typedef struct _OvirtStorageDomain OvirtStorageDomain;
typedef struct _OvirtStorageDomainPrivate OvirtStorageDomainPrivate;
typedef struct _OvirtStorageDomainClass OvirtStorageDomainClass;
struct _OvirtStorageDomain
{
OvirtResource parent;
OvirtStorageDomainPrivate *priv;
/* Do not add fields to this struct */
};
struct _OvirtStorageDomainClass
{
OvirtResourceClass parent_class;
gpointer padding[20];
};
GType ovirt_storage_domain_get_type(void);
OvirtStorageDomain *ovirt_storage_domain_new(void);
OvirtCollection *ovirt_storage_domain_get_files(OvirtStorageDomain *domain);
G_END_DECLS
#endif /* __OVIRT_STORAGE_DOMAIN_H__ */

32
govirt/ovirt-types.h Normal file
View File

@ -0,0 +1,32 @@
/*
* ovirt-types.h: base oVirt types
*
* Copyright (C) 2012 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#ifndef __OVIRT_TYPES_H__
#define __OVIRT_TYPES_H__
G_BEGIN_DECLS
typedef struct _OvirtProxy OvirtProxy;
G_END_DECLS
#endif /* __OVIRT_TYPES_H__ */

261
govirt/ovirt-utils.c Normal file
View File

@ -0,0 +1,261 @@
/*
* ovirt-utils.c
*
* Copyright (C) 2011, 2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#include <config.h>
#include <errno.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <rest/rest-xml-parser.h>
#include "ovirt-utils.h"
#include "ovirt-error.h"
RestXmlNode *
ovirt_rest_xml_node_from_call(RestProxyCall *call)
{
RestXmlParser *parser;
RestXmlNode *node;
parser = rest_xml_parser_new ();
node = rest_xml_parser_parse_from_data (parser,
rest_proxy_call_get_payload (call),
rest_proxy_call_get_payload_length (call));
g_object_unref(G_OBJECT(parser));
return node;
}
static const char *
ovirt_rest_xml_node_get_content_va(RestXmlNode *node,
va_list *args,
GStrv str_array)
{
g_return_val_if_fail((args != NULL) || (str_array != NULL), NULL);
while (TRUE) {
const char *node_name;
if (args != NULL) {
node_name = va_arg(*args, const char *);
} else {
node_name = *str_array;
str_array++;
}
if (node_name == NULL)
break;
node = rest_xml_node_find(node, node_name);
if (node == NULL) {
g_debug("could not find XML node '%s'", node_name);
return NULL;
}
}
return node->content;
}
G_GNUC_INTERNAL const char *
ovirt_rest_xml_node_get_content_from_path(RestXmlNode *node, const char *path)
{
GStrv pathv;
const char *content;
pathv = g_strsplit(path, "/", -1);
content = ovirt_rest_xml_node_get_content_va(node, NULL, pathv);
g_strfreev(pathv);
return content;
}
G_GNUC_INTERNAL const char *
ovirt_rest_xml_node_get_content(RestXmlNode *node, ...)
{
va_list args;
const char *content;
g_return_val_if_fail(node != NULL, NULL);
va_start(args, node);
content = ovirt_rest_xml_node_get_content_va(node, &args, NULL);
va_end(args);
g_warn_if_fail(node != NULL);
return content;
}
/* These 2 functions come from
* libvirt-glib/libvirt-gconfig/libvirt-gconfig-helpers.c
* Copyright (C) 2010, 2011 Red Hat, Inc.
* LGPLv2.1+ licensed */
G_GNUC_INTERNAL const char *
ovirt_utils_genum_get_nick (GType enum_type, gint value)
{
GEnumClass *enum_class;
GEnumValue *enum_value;
g_return_val_if_fail (G_TYPE_IS_ENUM (enum_type), NULL);
enum_class = g_type_class_ref(enum_type);
enum_value = g_enum_get_value(enum_class, value);
g_type_class_unref(enum_class);
if (enum_value != NULL)
return enum_value->value_nick;
g_return_val_if_reached(NULL);
}
G_GNUC_INTERNAL int
ovirt_utils_genum_get_value (GType enum_type, const char *nick,
gint default_value)
{
GEnumClass *enum_class;
GEnumValue *enum_value;
g_return_val_if_fail(G_TYPE_IS_ENUM(enum_type), default_value);
g_return_val_if_fail(nick != NULL, default_value);
enum_class = g_type_class_ref(enum_type);
enum_value = g_enum_get_value_by_nick(enum_class, nick);
g_type_class_unref(enum_class);
if (enum_value != NULL)
return enum_value->value;
g_return_val_if_reached(default_value);
}
G_GNUC_INTERNAL gboolean
ovirt_utils_boolean_from_string(const char *value)
{
g_return_val_if_fail(value != NULL, FALSE);
return (g_strcmp0(value, "true") == 0);
}
G_GNUC_INTERNAL gboolean
ovirt_utils_guint64_from_string(const char *value_str, guint64 *value)
{
char *end_ptr;
guint64 result;
g_return_val_if_fail(value_str != NULL, FALSE);
result = g_ascii_strtoull(value_str, &end_ptr, 10);
if ((result == G_MAXUINT64) && (errno == ERANGE)) {
/* overflow */
return FALSE;
}
if ((result == 0) && (errno == EINVAL)) {
/* should not happen, invalid base */
return FALSE;
}
if (*end_ptr != '\0') {
return FALSE;
}
*value = result;
return TRUE;
}
G_GNUC_INTERNAL gboolean
ovirt_utils_guint_from_string(const char *value_str, guint *value)
{
guint64 value64;
gboolean success;
success = ovirt_utils_guint64_from_string(value_str, &value64);
if (!success) {
return FALSE;
}
if (value64 > G_MAXUINT) {
return FALSE;
}
*value = (guint)value64;
return TRUE;
}
G_GNUC_INTERNAL gboolean ovirt_utils_gerror_from_xml_fault(RestXmlNode *root, GError **error)
{
RestXmlNode *reason_node;
RestXmlNode *detail_node;
const char *reason_key = g_intern_string("reason");
const char *detail_key = g_intern_string("detail");
g_return_val_if_fail((error == NULL) || (*error == NULL), FALSE);
if (g_strcmp0(root->name, "fault") != 0)
return FALSE;
reason_node = g_hash_table_lookup(root->children, reason_key);
if (reason_node == NULL) {
g_set_error(error, OVIRT_ERROR, OVIRT_ERROR_PARSING_FAILED,
_("Could not find 'reason' node"));
g_return_val_if_reached(FALSE);
}
g_debug("Reason: %s\n", reason_node->content);
detail_node = g_hash_table_lookup(root->children, detail_key);
if (detail_node != NULL) {
g_set_error(error, OVIRT_ERROR, OVIRT_ERROR_FAILED, "%s: %s",
reason_node->content, detail_node->content);
} else {
g_set_error(error, OVIRT_ERROR, OVIRT_ERROR_FAILED, "%s",
reason_node->content);
}
return TRUE;
}
G_GNUC_INTERNAL gboolean g_object_set_guint_property_from_xml(GObject *g_object,
RestXmlNode *node,
const gchar *node_name,
const gchar *prop_name)
{
RestXmlNode *sub_node;
GParamSpec *spec;
sub_node = rest_xml_node_find(node, node_name);
if (sub_node != NULL && sub_node->content != NULL) {
guint value;
if (!ovirt_utils_guint_from_string(sub_node->content, &value)) {
return FALSE;
}
spec = g_object_class_find_property(G_OBJECT_GET_CLASS(g_object), prop_name);
if (spec != NULL && spec->value_type == G_TYPE_UINT) {
g_object_set(g_object, prop_name, value, NULL);
return TRUE;
}
}
return FALSE;
}

49
govirt/ovirt-utils.h Normal file
View File

@ -0,0 +1,49 @@
/*
* ovirt-utils.h
*
* Copyright (C) 2011, 2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#ifndef __OVIRT_UTILS_H__
#define __OVIRT_UTILS_H__
#include <rest/rest-proxy-call.h>
#include <rest/rest-xml-node.h>
G_BEGIN_DECLS
RestXmlNode *ovirt_rest_xml_node_from_call(RestProxyCall *call);
const char *ovirt_rest_xml_node_get_content(RestXmlNode *node, ...);
const char *ovirt_rest_xml_node_get_content_from_path(RestXmlNode *node,
const char *path);
gboolean ovirt_utils_gerror_from_xml_fault(RestXmlNode *root, GError **error);
gboolean g_object_set_guint_property_from_xml(GObject *g_object,
RestXmlNode *node,
const gchar *node_name,
const gchar *prop_name);
const char *ovirt_utils_genum_get_nick (GType enum_type, gint value);
int ovirt_utils_genum_get_value (GType enum_type, const char *nick,
gint default_value);
gboolean ovirt_utils_guint64_from_string(const char *value_str, guint64 *value);
gboolean ovirt_utils_guint_from_string(const char *value_str, guint *value);
gboolean ovirt_utils_boolean_from_string(const char *value);
G_END_DECLS
#endif /* __OVIRT_UTILS_H__ */

305
govirt/ovirt-vm-display.c Normal file
View File

@ -0,0 +1,305 @@
/*
* ovirt-vm-display.c: oVirt virtual machine display information
*
* Copyright (C) 2012 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#include <config.h>
#include "ovirt-enum-types.h"
#include "ovirt-vm-display.h"
#define OVIRT_VM_DISPLAY_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE((obj), OVIRT_TYPE_VM_DISPLAY, OvirtVmDisplayPrivate))
struct _OvirtVmDisplayPrivate {
OvirtVmDisplayType type;
char *address;
guint port;
guint secure_port;
guint monitor_count;
char *ticket;
guint expiry;
GByteArray *ca_cert;
char *host_subject;
gboolean smartcard;
gboolean allow_override;
char *proxy_url;
};
G_DEFINE_TYPE(OvirtVmDisplay, ovirt_vm_display, G_TYPE_OBJECT);
enum {
PROP_0,
PROP_TYPE,
PROP_ADDRESS,
PROP_PORT,
PROP_SECURE_PORT,
PROP_MONITOR_COUNT,
PROP_TICKET,
PROP_EXPIRY,
PROP_HOST_SUBJECT,
PROP_SMARTCARD,
PROP_ALLOW_OVERRIDE,
PROP_PROXY_URL,
PROP_CA_CERT,
};
static void ovirt_vm_display_get_property(GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
OvirtVmDisplay *display = OVIRT_VM_DISPLAY(object);
switch (prop_id) {
case PROP_TYPE:
g_value_set_enum(value, display->priv->type);
break;
case PROP_ADDRESS:
g_value_set_string(value, display->priv->address);
break;
case PROP_PORT:
g_value_set_uint(value, display->priv->port);
break;
case PROP_SECURE_PORT:
g_value_set_uint(value, display->priv->secure_port);
break;
case PROP_MONITOR_COUNT:
g_value_set_uint(value, display->priv->monitor_count);
break;
case PROP_TICKET:
g_value_set_string(value, display->priv->ticket);
break;
case PROP_EXPIRY:
g_value_set_uint(value, display->priv->expiry);
break;
case PROP_CA_CERT:
g_value_set_boxed(value, display->priv->ca_cert);
break;
case PROP_HOST_SUBJECT:
g_value_set_string(value, display->priv->host_subject);
break;
case PROP_SMARTCARD:
g_value_set_boolean(value, display->priv->smartcard);
break;
case PROP_ALLOW_OVERRIDE:
g_value_set_boolean(value, display->priv->allow_override);
break;
case PROP_PROXY_URL:
g_value_set_string(value, display->priv->proxy_url);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
}
}
static void ovirt_vm_display_set_property(GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
OvirtVmDisplay *display = OVIRT_VM_DISPLAY(object);
switch (prop_id) {
case PROP_TYPE:
display->priv->type = g_value_get_enum(value);
break;
case PROP_ADDRESS:
g_free(display->priv->address);
display->priv->address = g_value_dup_string(value);
break;
case PROP_PORT:
display->priv->port = g_value_get_uint(value);
break;
case PROP_SECURE_PORT:
display->priv->secure_port = g_value_get_uint(value);
break;
case PROP_MONITOR_COUNT:
display->priv->monitor_count = g_value_get_uint(value);
break;
case PROP_TICKET:
g_free(display->priv->ticket);
display->priv->ticket = g_value_dup_string(value);
break;
case PROP_EXPIRY:
display->priv->expiry = g_value_get_uint(value);
break;
case PROP_CA_CERT:
if (display->priv->ca_cert != NULL) {
g_byte_array_unref(display->priv->ca_cert);
}
display->priv->ca_cert = g_value_dup_boxed(value);
break;
case PROP_HOST_SUBJECT:
g_free(display->priv->host_subject);
display->priv->host_subject = g_value_dup_string(value);
break;
case PROP_SMARTCARD:
display->priv->smartcard = g_value_get_boolean(value);
break;
case PROP_ALLOW_OVERRIDE:
display->priv->allow_override = g_value_get_boolean(value);
break;
case PROP_PROXY_URL:
g_free(display->priv->proxy_url);
display->priv->proxy_url = g_value_dup_string(value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
}
}
static void ovirt_vm_display_finalize(GObject *object)
{
OvirtVmDisplay *display = OVIRT_VM_DISPLAY(object);
g_free(display->priv->address);
g_free(display->priv->ticket);
g_free(display->priv->host_subject);
g_free(display->priv->proxy_url);
if (display->priv->ca_cert != NULL) {
g_byte_array_unref(display->priv->ca_cert);
}
G_OBJECT_CLASS(ovirt_vm_display_parent_class)->finalize(object);
}
static void ovirt_vm_display_class_init(OvirtVmDisplayClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS(klass);
g_type_class_add_private(klass, sizeof(OvirtVmDisplayPrivate));
object_class->finalize = ovirt_vm_display_finalize;
object_class->get_property = ovirt_vm_display_get_property;
object_class->set_property = ovirt_vm_display_set_property;
g_object_class_install_property(object_class,
PROP_TYPE,
g_param_spec_enum("type",
"Type",
"Display Type",
OVIRT_TYPE_VM_DISPLAY_TYPE,
OVIRT_VM_DISPLAY_SPICE,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property(object_class,
PROP_ADDRESS,
g_param_spec_string("address",
"Address",
"Display Address",
NULL,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property(object_class,
PROP_PORT,
g_param_spec_uint("port",
"Port",
"Display Port",
0, G_MAXUINT16,
0,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property(object_class,
PROP_SECURE_PORT,
g_param_spec_uint("secure-port",
"Secure Port",
"Secure Display Port",
0, G_MAXUINT16,
0,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property(object_class,
PROP_MONITOR_COUNT,
g_param_spec_uint("monitor-count",
"Monitor Count",
"Virtual Machine Monitor Count",
0, G_MAXUINT,
0,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property(object_class,
PROP_TICKET,
g_param_spec_string("ticket",
"Ticket",
"Ticket to access the VM",
NULL,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property(object_class,
PROP_EXPIRY,
g_param_spec_uint("expiry",
"Expiry",
"Ticket Expiry Time",
0, G_MAXUINT,
0,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property(object_class,
PROP_CA_CERT,
g_param_spec_boxed("ca-cert",
"ca-cert",
"Virt CA certificate to use for TLS SPICE connections",
G_TYPE_BYTE_ARRAY,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property(object_class,
PROP_HOST_SUBJECT,
g_param_spec_string("host-subject",
"Host Subject",
"Host subject of the VM certificate",
NULL,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property(object_class,
PROP_SMARTCARD,
g_param_spec_boolean("smartcard",
"Smartcard",
"Indicates whether smartcard support is enabled",
FALSE,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property(object_class,
PROP_ALLOW_OVERRIDE,
g_param_spec_boolean("allow-override",
"Allow override",
"Allow to override display connection",
FALSE,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property(object_class,
PROP_PROXY_URL,
g_param_spec_string("proxy-url",
"Proxy URL",
"URL of the proxy to use to access the VM",
NULL,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
}
static void ovirt_vm_display_init(G_GNUC_UNUSED OvirtVmDisplay *display)
{
display->priv = OVIRT_VM_DISPLAY_GET_PRIVATE(display);
}
OvirtVmDisplay *ovirt_vm_display_new(void)
{
return OVIRT_VM_DISPLAY(g_object_new(OVIRT_TYPE_VM_DISPLAY, NULL));
}

66
govirt/ovirt-vm-display.h Normal file
View File

@ -0,0 +1,66 @@
/*
* ovirt-vm-display.h: oVirt virtual machine display information
*
* Copyright (C) 2012 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#ifndef __OVIRT_VM_DISPLAY_H__
#define __OVIRT_VM_DISPLAY_H__
#include <glib-object.h>
G_BEGIN_DECLS
#define OVIRT_TYPE_VM_DISPLAY (ovirt_vm_display_get_type ())
#define OVIRT_VM_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OVIRT_TYPE_VM_DISPLAY, OvirtVmDisplay))
#define OVIRT_VM_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OVIRT_TYPE_VM_DISPLAY, OvirtVmDisplayClass))
#define OVIRT_IS_VM_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OVIRT_TYPE_VM_DISPLAY))
#define OVIRT_IS_VM_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OVIRT_TYPE_VM_DISPLAY))
#define OVIRT_VM_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OVIRT_TYPE_VM_DISPLAY, OvirtVmDisplayClass))
typedef struct _OvirtVmDisplay OvirtVmDisplay;
typedef struct _OvirtVmDisplayPrivate OvirtVmDisplayPrivate;
typedef struct _OvirtVmDisplayClass OvirtVmDisplayClass;
struct _OvirtVmDisplay
{
GObject parent;
OvirtVmDisplayPrivate *priv;
/* Do not add fields to this struct */
};
struct _OvirtVmDisplayClass
{
GObjectClass parent_class;
gpointer padding[20];
};
typedef enum {
OVIRT_VM_DISPLAY_SPICE,
OVIRT_VM_DISPLAY_VNC
} OvirtVmDisplayType;
GType ovirt_vm_display_get_type(void);
OvirtVmDisplay *ovirt_vm_display_new(void);
G_END_DECLS
#endif /* __OVIRT_VM_DISPLAY_H__ */

206
govirt/ovirt-vm-pool.c Normal file
View File

@ -0,0 +1,206 @@
/*
* ovirt-vm-pool.c: oVirt virtual machine pool
*
* Copyright (C) 2013 Iordan Iordanov <i@iiordanov.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <stdlib.h>
#include <rest/rest-xml-node.h>
#include <rest/rest-xml-parser.h>
#include "govirt.h"
#include "govirt-private.h"
static gboolean ovirt_vm_pool_refresh_from_xml(OvirtVmPool *vm_pool, RestXmlNode *node);
#define OVIRT_VM_POOL_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE((obj), OVIRT_TYPE_VM_POOL, OvirtVmPoolPrivate))
struct _OvirtVmPoolPrivate {
guint prestarted_vms;
guint max_user_vms;
guint size;
};
G_DEFINE_TYPE(OvirtVmPool, ovirt_vm_pool, OVIRT_TYPE_RESOURCE);
enum OvirtResponseStatus {
OVIRT_RESPONSE_UNKNOWN,
OVIRT_RESPONSE_FAILED,
OVIRT_RESPONSE_PENDING,
OVIRT_RESPONSE_IN_PROGRESS,
OVIRT_RESPONSE_COMPLETE
};
enum {
PROP_0,
PROP_SIZE,
PROP_PRESTARTED_VMS,
PROP_MAX_USER_VMS
};
static void ovirt_vm_pool_get_property(GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
OvirtVmPool *vm_pool = OVIRT_VM_POOL(object);
switch (prop_id) {
case PROP_SIZE:
g_value_set_uint(value, vm_pool->priv->size);
break;
case PROP_PRESTARTED_VMS:
g_value_set_uint(value, vm_pool->priv->prestarted_vms);
break;
case PROP_MAX_USER_VMS:
g_value_set_uint(value, vm_pool->priv->max_user_vms);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
}
}
static void ovirt_vm_pool_set_property(GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
OvirtVmPool *vm_pool = OVIRT_VM_POOL(object);
switch (prop_id) {
case PROP_SIZE:
vm_pool->priv->size = g_value_get_uint(value);
break;
case PROP_PRESTARTED_VMS:
vm_pool->priv->prestarted_vms = g_value_get_uint(value);
break;
case PROP_MAX_USER_VMS:
vm_pool->priv->max_user_vms = g_value_get_uint(value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
}
}
static void ovirt_vm_pool_dispose(GObject *object)
{
G_OBJECT_CLASS(ovirt_vm_pool_parent_class)->dispose(object);
}
static gboolean ovirt_vm_pool_init_from_xml(OvirtResource *resource,
RestXmlNode *node,
GError **error)
{
gboolean parsed_ok;
OvirtResourceClass *parent_class;
parsed_ok = ovirt_vm_pool_refresh_from_xml(OVIRT_VM_POOL(resource), node);
if (!parsed_ok) {
return FALSE;
}
parent_class = OVIRT_RESOURCE_CLASS(ovirt_vm_pool_parent_class);
return parent_class->init_from_xml(resource, node, error);
}
static void ovirt_vm_pool_class_init(OvirtVmPoolClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS(klass);
OvirtResourceClass *resource_class = OVIRT_RESOURCE_CLASS(klass);
g_type_class_add_private(klass, sizeof(OvirtVmPoolPrivate));
resource_class->init_from_xml = ovirt_vm_pool_init_from_xml;
object_class->dispose = ovirt_vm_pool_dispose;
object_class->get_property = ovirt_vm_pool_get_property;
object_class->set_property = ovirt_vm_pool_set_property;
g_object_class_install_property(object_class,
PROP_SIZE,
g_param_spec_uint("size",
"Size of pool",
"The number of VMs in the pool",
0,
G_MAXUINT,
0,
G_PARAM_READWRITE));
g_object_class_install_property(object_class,
PROP_PRESTARTED_VMS,
g_param_spec_uint("prestarted_vms",
"Prestarted VMs",
"The number of VMs prestarted in the pool",
0,
G_MAXUINT,
0,
G_PARAM_READWRITE));
g_object_class_install_property(object_class,
PROP_MAX_USER_VMS,
g_param_spec_uint("max_user_vms",
"Max VMs per user",
"The number of VMs a user can allocate from the pool",
0,
G_MAXUINT,
0,
G_PARAM_READWRITE));
}
static void ovirt_vm_pool_init(G_GNUC_UNUSED OvirtVmPool *vm_pool)
{
vm_pool->priv = OVIRT_VM_POOL_GET_PRIVATE(vm_pool);
}
OvirtVmPool *ovirt_vm_pool_new(void)
{
return OVIRT_VM_POOL(g_initable_new(OVIRT_TYPE_VM_POOL, NULL, NULL, NULL));
}
gboolean ovirt_vm_pool_allocate_vm(OvirtVmPool *vm_pool, OvirtProxy *proxy, GError **error)
{
return ovirt_resource_action(OVIRT_RESOURCE(vm_pool), proxy, "allocatevm", NULL, error);
}
void ovirt_vm_pool_allocate_vm_async(OvirtVmPool *vm_pool, OvirtProxy *proxy,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
ovirt_resource_invoke_action_async(OVIRT_RESOURCE(vm_pool), "allocatevm",
proxy, NULL, cancellable,
callback, user_data);
}
gboolean ovirt_vm_pool_allocate_vm_finish(OvirtVmPool *vm_pool,
GAsyncResult *result, GError **err)
{
return ovirt_resource_action_finish(OVIRT_RESOURCE(vm_pool), result, err);
}
static gboolean ovirt_vm_pool_refresh_from_xml(OvirtVmPool *vm_pool, RestXmlNode *node)
{
g_object_set_guint_property_from_xml(G_OBJECT(vm_pool), node, "size", "size");
g_object_set_guint_property_from_xml(G_OBJECT(vm_pool), node, "prestarted_vms", "prestarted_vms");
g_object_set_guint_property_from_xml(G_OBJECT(vm_pool), node, "max_user_vms", "max_user_vms");
return TRUE;
}

71
govirt/ovirt-vm-pool.h Normal file
View File

@ -0,0 +1,71 @@
/*
* ovirt-vm-pool.h: oVirt VM pool
*
* Copyright (C) 2013 Iordan Iordanov <i@iiordanov.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef __OVIRT_VM_POOL_H__
#define __OVIRT_VM_POOL_H__
#include <gio/gio.h>
#include <glib-object.h>
#include <govirt/ovirt-collection.h>
#include <govirt/ovirt-resource.h>
#include <govirt/ovirt-types.h>
G_BEGIN_DECLS
#define OVIRT_TYPE_VM_POOL (ovirt_vm_pool_get_type ())
#define OVIRT_VM_POOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OVIRT_TYPE_VM_POOL, OvirtVmPool))
#define OVIRT_VM_POOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OVIRT_TYPE_VM_POOL, OvirtVmPoolClass))
#define OVIRT_IS_VM_POOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OVIRT_TYPE_VM_POOL))
#define OVIRT_IS_VM_POOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OVIRT_TYPE_VM_POOL))
#define OVIRT_VM_POOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OVIRT_TYPE_VM_POOL, OvirtVmPoolClass))
typedef struct _OvirtVmPool OvirtVmPool;
typedef struct _OvirtVmPoolPrivate OvirtVmPoolPrivate;
typedef struct _OvirtVmPoolClass OvirtVmPoolClass;
struct _OvirtVmPool
{
OvirtResource parent;
OvirtVmPoolPrivate *priv;
/* Do not add fields to this struct */
};
struct _OvirtVmPoolClass
{
OvirtResourceClass parent_class;
gpointer padding[20];
};
GType ovirt_vm_pool_get_type(void);
OvirtVmPool *ovirt_vm_pool_new(void);
gboolean ovirt_vm_pool_allocate_vm(OvirtVmPool *vm_pool, OvirtProxy *proxy, GError **error);
void ovirt_vm_pool_allocate_vm_async(OvirtVmPool *vm_pool, OvirtProxy *proxy,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean ovirt_vm_pool_allocate_vm_finish(OvirtVmPool *vm_pool,
GAsyncResult *result, GError **err);
G_END_DECLS
#endif /* __OVIRT_VM_POOL_H__ */

48
govirt/ovirt-vm-private.h Normal file
View File

@ -0,0 +1,48 @@
/*
* ovirt-vm-private.h: oVirt virtual machine private header
*
* Copyright (C) 2012 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#ifndef __OVIRT_VM_PRIVATE_H__
#define __OVIRT_VM_PRIVATE_H__
#include <ovirt-vm.h>
#include <rest/rest-xml-node.h>
G_BEGIN_DECLS
typedef enum {
OVIRT_VM_ACTION_SHUTDOWN,
OVIRT_VM_ACTION_START,
OVIRT_VM_ACTION_STOP,
OVIRT_VM_ACTION_SUSPEND,
OVIRT_VM_ACTION_DETACH,
OVIRT_VM_ACTION_EXPORT,
OVIRT_VM_ACTION_MOVE,
OVIRT_VM_ACTION_TICKET,
OVIRT_VM_ACTION_MIGRATE
} OvirtVmAction;
gboolean ovirt_vm_refresh_from_xml(OvirtVm *vm, RestXmlNode *node);
OvirtVm *ovirt_vm_new_from_xml(RestXmlNode *node, GError **error);
G_END_DECLS
#endif /* __OVIRT_VM_PRIVATE_H__ */

172
govirt/ovirt-vm-xml.c Normal file
View File

@ -0,0 +1,172 @@
/*
* ovirt-vm-xml.c
*
* Copyright (C) 2011, 2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#include <config.h>
#include <stdlib.h>
#include <string.h>
#include "ovirt-enum-types.h"
#include "ovirt-utils.h"
#include "ovirt-vm.h"
#include "ovirt-vm-display.h"
#include "ovirt-vm-private.h"
static gboolean vm_set_display_from_xml(OvirtVm *vm,
RestXmlNode *root)
{
RestXmlNode *node;
OvirtVmDisplay *display;
const char *display_key = g_intern_string("display");
const char *type_key = g_intern_string("type");
const char *address_key = g_intern_string("address");
const char *port_key = g_intern_string("port");
const char *secure_port_key = g_intern_string("secure_port");
const char *monitors_key = g_intern_string("monitors");
const char *certificate_key = g_intern_string("certificate");
const char *smartcard_key = g_intern_string("smartcard_enabled");
const char *allow_override_key = g_intern_string("allow_override");
const char *proxy_key = g_intern_string("proxy");
if (root == NULL) {
return FALSE;
}
root = g_hash_table_lookup(root->children, display_key);
if (root == NULL) {
g_debug("Could not find 'display' node");
return FALSE;
}
display = ovirt_vm_display_new();
node = g_hash_table_lookup(root->children, type_key);
g_return_val_if_fail(node != NULL, FALSE);
if (g_strcmp0(node->content, "spice") == 0) {
g_object_set(G_OBJECT(display), "type", OVIRT_VM_DISPLAY_SPICE, NULL);
} else if (g_strcmp0(node->content, "vnc") == 0) {
g_object_set(G_OBJECT(display), "type", OVIRT_VM_DISPLAY_VNC, NULL);
} else {
g_warning("Unknown display type: %s", node->content);
return FALSE;
}
node = g_hash_table_lookup(root->children, monitors_key);
g_return_val_if_fail(node != NULL, FALSE);
g_object_set(G_OBJECT(display),
"monitor-count", strtoul(node->content, NULL, 0),
NULL);
/* on non started VMs, these 2 values will not be available */
node = g_hash_table_lookup(root->children, address_key);
if (node != NULL) {
g_object_set(G_OBJECT(display), "address", node->content, NULL);
}
node = g_hash_table_lookup(root->children, port_key);
if (node != NULL) {
g_object_set(G_OBJECT(display),
"port", strtoul(node->content, NULL, 0),
NULL);
}
node = g_hash_table_lookup(root->children, secure_port_key);
if (node != NULL) {
g_object_set(G_OBJECT(display),
"secure-port", strtoul(node->content, NULL, 0),
NULL);
}
node = g_hash_table_lookup(root->children, smartcard_key);
if (node != NULL) {
gboolean smartcard;
smartcard = (g_strcmp0(node->content, "true") == 0);
g_object_set(G_OBJECT(display),
"smartcard", smartcard,
NULL);
}
node = g_hash_table_lookup(root->children, allow_override_key);
if (node != NULL) {
gboolean allow_override;
allow_override = (g_strcmp0(node->content, "true") == 0);
g_object_set(G_OBJECT(display),
"allow-override", allow_override,
NULL);
}
node = g_hash_table_lookup(root->children, certificate_key);
if (node != NULL) {
const char *subject_key = g_intern_string("subject");
node = g_hash_table_lookup(node->children, subject_key);
if (node != NULL) {
g_object_set(G_OBJECT(display),
"host-subject", node->content,
NULL);
}
}
node = g_hash_table_lookup(root->children, proxy_key);
if (node != NULL) {
g_object_set(G_OBJECT(display), "proxy-url", node->content, NULL);
}
/* FIXME: this overrides the ticket/expiry which may
* already be set
*/
g_object_set(G_OBJECT(vm), "display", display, NULL);
g_object_unref(G_OBJECT(display));
return TRUE;
}
static gboolean vm_set_state_from_xml(OvirtVm *vm, RestXmlNode *node)
{
RestXmlNode *state_node;
state_node = rest_xml_node_find(node, "status");
if (state_node == NULL) {
g_debug("Could not find 'status' node");
return FALSE;
}
state_node = rest_xml_node_find(state_node, "state");
if (state_node != NULL) {
int state;
g_return_val_if_fail(state_node->content != NULL, FALSE);
state = ovirt_utils_genum_get_value(OVIRT_TYPE_VM_STATE,
state_node->content,
OVIRT_VM_STATE_UNKNOWN);
g_object_set(G_OBJECT(vm), "state", state, NULL);
return TRUE;
}
return FALSE;
}
G_GNUC_INTERNAL gboolean ovirt_vm_refresh_from_xml(OvirtVm *vm, RestXmlNode *node)
{
vm_set_state_from_xml(vm, node);
vm_set_display_from_xml(vm, node);
return TRUE;
}

348
govirt/ovirt-vm.c Normal file
View File

@ -0,0 +1,348 @@
/*
* ovirt-vm.c: oVirt virtual machine
*
* Copyright (C) 2012, 2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#include <config.h>
#include <stdlib.h>
#include <glib/gi18n-lib.h>
#include <rest/rest-xml-node.h>
#include <rest/rest-xml-parser.h>
#include "govirt.h"
#include "govirt-private.h"
static gboolean parse_ticket_status(RestXmlNode *root, OvirtResource *resource,
GError **error);
#define OVIRT_VM_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE((obj), OVIRT_TYPE_VM, OvirtVmPrivate))
struct _OvirtVmPrivate {
OvirtCollection *cdroms;
OvirtVmState state;
OvirtVmDisplay *display;
} ;
G_DEFINE_TYPE(OvirtVm, ovirt_vm, OVIRT_TYPE_RESOURCE);
enum OvirtResponseStatus {
OVIRT_RESPONSE_UNKNOWN,
OVIRT_RESPONSE_FAILED,
OVIRT_RESPONSE_PENDING,
OVIRT_RESPONSE_IN_PROGRESS,
OVIRT_RESPONSE_COMPLETE
};
enum {
PROP_0,
PROP_STATE,
PROP_DISPLAY
};
static void ovirt_vm_get_property(GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
OvirtVm *vm = OVIRT_VM(object);
switch (prop_id) {
case PROP_STATE:
g_value_set_enum(value, vm->priv->state);
break;
case PROP_DISPLAY:
g_value_set_object(value, vm->priv->display);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
}
}
static void ovirt_vm_set_property(GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
OvirtVm *vm = OVIRT_VM(object);
switch (prop_id) {
case PROP_STATE:
vm->priv->state = g_value_get_enum(value);
break;
case PROP_DISPLAY:
if (vm->priv->display != NULL)
g_object_unref(vm->priv->display);
vm->priv->display = g_value_dup_object(value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
}
}
static void ovirt_vm_dispose(GObject *object)
{
OvirtVm *vm = OVIRT_VM(object);
g_clear_object(&vm->priv->cdroms);
g_clear_object(&vm->priv->display);
G_OBJECT_CLASS(ovirt_vm_parent_class)->dispose(object);
}
static gboolean ovirt_vm_init_from_xml(OvirtResource *resource,
RestXmlNode *node,
GError **error)
{
gboolean parsed_ok;
OvirtResourceClass *parent_class;
parsed_ok = ovirt_vm_refresh_from_xml(OVIRT_VM(resource), node);
if (!parsed_ok) {
return FALSE;
}
parent_class = OVIRT_RESOURCE_CLASS(ovirt_vm_parent_class);
return parent_class->init_from_xml(resource, node, error);
}
static void ovirt_vm_class_init(OvirtVmClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS(klass);
OvirtResourceClass *resource_class = OVIRT_RESOURCE_CLASS(klass);
g_type_class_add_private(klass, sizeof(OvirtVmPrivate));
resource_class->init_from_xml = ovirt_vm_init_from_xml;
object_class->dispose = ovirt_vm_dispose;
object_class->get_property = ovirt_vm_get_property;
object_class->set_property = ovirt_vm_set_property;
g_object_class_install_property(object_class,
PROP_STATE,
g_param_spec_enum("state",
"State",
"Virtual Machine State",
OVIRT_TYPE_VM_STATE,
OVIRT_VM_STATE_DOWN,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property(object_class,
PROP_DISPLAY,
g_param_spec_object("display",
"Display",
"Virtual Machine Display Information",
OVIRT_TYPE_VM_DISPLAY,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
}
static void ovirt_vm_init(G_GNUC_UNUSED OvirtVm *vm)
{
vm->priv = OVIRT_VM_GET_PRIVATE(vm);
}
OvirtVm *ovirt_vm_new_from_xml(RestXmlNode *node, GError **error)
{
return OVIRT_VM(g_initable_new(OVIRT_TYPE_VM, NULL, error,
"xml-node", node, NULL));
}
OvirtVm *ovirt_vm_new(void)
{
return OVIRT_VM(g_initable_new(OVIRT_TYPE_VM, NULL, NULL, NULL));
}
void
ovirt_vm_get_ticket_async(OvirtVm *vm, OvirtProxy *proxy,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
ovirt_resource_invoke_action_async(OVIRT_RESOURCE(vm), "ticket",
proxy, parse_ticket_status,
cancellable, callback,
user_data);
}
gboolean
ovirt_vm_get_ticket_finish(OvirtVm *vm, GAsyncResult *result, GError **err)
{
return ovirt_resource_action_finish(OVIRT_RESOURCE(vm), result, err);
}
void
ovirt_vm_start_async(OvirtVm *vm, OvirtProxy *proxy,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
ovirt_resource_invoke_action_async(OVIRT_RESOURCE(vm), "start", proxy, NULL,
cancellable, callback, user_data);
}
gboolean
ovirt_vm_start_finish(OvirtVm *vm, GAsyncResult *result, GError **err)
{
return ovirt_resource_action_finish(OVIRT_RESOURCE(vm), result, err);
}
void
ovirt_vm_stop_async(OvirtVm *vm, OvirtProxy *proxy,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
ovirt_resource_invoke_action_async(OVIRT_RESOURCE(vm), "stop", proxy, NULL,
cancellable, callback, user_data);
}
gboolean
ovirt_vm_stop_finish(OvirtVm *vm, GAsyncResult *result, GError **err)
{
return ovirt_resource_action_finish(OVIRT_RESOURCE(vm), result, err);
}
gboolean ovirt_vm_get_ticket(OvirtVm *vm, OvirtProxy *proxy, GError **error)
{
return ovirt_resource_action(OVIRT_RESOURCE(vm), proxy, "ticket",
parse_ticket_status,
error);
}
gboolean ovirt_vm_start(OvirtVm *vm, OvirtProxy *proxy, GError **error)
{
return ovirt_resource_action(OVIRT_RESOURCE(vm), proxy, "start",
NULL, error);
}
gboolean ovirt_vm_stop(OvirtVm *vm, OvirtProxy *proxy, GError **error)
{
return ovirt_resource_action(OVIRT_RESOURCE(vm), proxy, "stop",
NULL, error);
}
static gboolean parse_ticket_status(RestXmlNode *root, OvirtResource *resource, GError **error)
{
OvirtVm *vm;
RestXmlNode *node;
const char *ticket_key = g_intern_string("ticket");
const char *value_key = g_intern_string("value");
const char *expiry_key = g_intern_string("expiry");
OvirtVmDisplay *display;
g_return_val_if_fail(root != NULL, FALSE);
g_return_val_if_fail(OVIRT_IS_VM(resource), FALSE);
g_return_val_if_fail(error == NULL || *error == NULL, FALSE);
vm = OVIRT_VM(resource);
root = g_hash_table_lookup(root->children, ticket_key);
if (root == NULL) {
g_set_error(error, OVIRT_ERROR, OVIRT_ERROR_PARSING_FAILED,
_("Could not find 'ticket' node"));
g_return_val_if_reached(FALSE);
}
node = g_hash_table_lookup(root->children, value_key);
if (node == NULL) {
g_set_error(error, OVIRT_ERROR, OVIRT_ERROR_PARSING_FAILED,
_("Could not find 'value' node"));
g_return_val_if_reached(FALSE);
}
g_object_get(G_OBJECT(vm), "display", &display, NULL);
g_return_val_if_fail(display != NULL, FALSE);
g_object_set(G_OBJECT(display), "ticket", node->content, NULL);
node = g_hash_table_lookup(root->children, expiry_key);
if (node == NULL) {
g_set_error(error, OVIRT_ERROR, OVIRT_ERROR_PARSING_FAILED,
_("Could not find 'expiry' node"));
g_object_unref(G_OBJECT(display));
g_return_val_if_reached(FALSE);
}
g_object_set(G_OBJECT(display),
"expiry", strtoul(node->content, NULL, 0),
NULL);
g_object_unref(G_OBJECT(display));
return TRUE;
}
void ovirt_vm_refresh_async(OvirtVm *vm, OvirtProxy *proxy,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
g_return_if_fail(OVIRT_IS_VM(vm));
ovirt_resource_refresh_async(OVIRT_RESOURCE(vm), proxy,
cancellable, callback,
user_data);
}
gboolean ovirt_vm_refresh_finish(OvirtVm *vm,
GAsyncResult *result,
GError **err)
{
g_return_val_if_fail(OVIRT_IS_VM(vm), FALSE);
return ovirt_resource_refresh_finish(OVIRT_RESOURCE(vm),
result, err);
}
/**
* ovirt_vm_get_cdroms:
* @vm: a #OvirtVm
*
* Gets a #OvirtCollection representing the list of remote cdroms from a
* virtual machine object. This method does not initiate any network
* activity, the remote cdrom list must be then be fetched using
* ovirt_collection_fetch() or ovirt_collection_fetch_async().
*
* Return value: (transfer none): a #OvirtCollection representing the list
* of cdroms associated with @vm.
*/
OvirtCollection *ovirt_vm_get_cdroms(OvirtVm *vm)
{
const char *href;
g_return_val_if_fail(OVIRT_IS_VM(vm), NULL);
if (vm->priv->cdroms != NULL)
return vm->priv->cdroms;
href = ovirt_resource_get_sub_collection(OVIRT_RESOURCE(vm), "cdroms");
if (href == NULL)
return NULL;
vm->priv->cdroms = ovirt_collection_new(href, "cdroms",
OVIRT_TYPE_CDROM,
"cdrom");
return vm->priv->cdroms;
}

127
govirt/ovirt-vm.h Normal file
View File

@ -0,0 +1,127 @@
/*
* ovirt-vm.h: oVirt virtual machine
*
* Copyright (C) 2012 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#ifndef __OVIRT_VM_H__
#define __OVIRT_VM_H__
#include <gio/gio.h>
#include <glib-object.h>
#include <govirt/ovirt-collection.h>
#include <govirt/ovirt-resource.h>
#include <govirt/ovirt-types.h>
G_BEGIN_DECLS
#if !GLIB_CHECK_VERSION(2,32,0)
#define G_DEPRECATED_FOR(name) G_GNUC_DEPRECATED_FOR(name)
#endif
#define OVIRT_TYPE_VM (ovirt_vm_get_type ())
#define OVIRT_VM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OVIRT_TYPE_VM, OvirtVm))
#define OVIRT_VM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OVIRT_TYPE_VM, OvirtVmClass))
#define OVIRT_IS_VM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OVIRT_TYPE_VM))
#define OVIRT_IS_VM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OVIRT_TYPE_VM))
#define OVIRT_VM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OVIRT_TYPE_VM, OvirtVmClass))
typedef struct _OvirtVm OvirtVm;
typedef struct _OvirtVmPrivate OvirtVmPrivate;
typedef struct _OvirtVmClass OvirtVmClass;
struct _OvirtVm
{
OvirtResource parent;
OvirtVmPrivate *priv;
/* Do not add fields to this struct */
};
struct _OvirtVmClass
{
OvirtResourceClass parent_class;
gpointer padding[20];
};
typedef enum {
OVIRT_VM_STATE_DOWN,
OVIRT_VM_STATE_UP,
OVIRT_VM_STATE_REBOOTING,
OVIRT_VM_STATE_POWERING_UP, /*< nick=powering_up >*/
OVIRT_VM_STATE_POWERED_DOWN, /*< nick=powered_down >*/
OVIRT_VM_STATE_PAUSED,
OVIRT_VM_STATE_MIGRATING,
OVIRT_VM_STATE_UNKNOWN,
OVIRT_VM_STATE_NOT_RESPONDING, /*< nick=not_responding >*/
OVIRT_VM_STATE_WAIT_FOR_LAUNCH, /*< nick=wait_for_launch >*/
OVIRT_VM_STATE_REBOOT_IN_PROGRESS, /*< nick=reboot_in_progress >*/
OVIRT_VM_STATE_SAVING_STATE, /*< nick=saving_state >*/
OVIRT_VM_STATE_RESTORING_STATE, /*< nick=restoring_state >*/
OVIRT_VM_STATE_SUSPENDED,
OVIRT_VM_STATE_IMAGE_LOCKED, /*< nick=image_locked >*/
OVIRT_VM_STATE_POWERING_DOWN, /*< nick=powering_down >*/
} OvirtVmState;
GType ovirt_vm_get_type(void);
OvirtVm *ovirt_vm_new(void);
gboolean ovirt_vm_get_ticket(OvirtVm *vm, OvirtProxy *proxy, GError **error);
gboolean ovirt_vm_start(OvirtVm *vm, OvirtProxy *proxy, GError **error);
gboolean ovirt_vm_stop(OvirtVm *vm, OvirtProxy *proxy, GError **error);
void ovirt_vm_get_ticket_async(OvirtVm *vm, OvirtProxy *proxy,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean ovirt_vm_get_ticket_finish(OvirtVm *vm,
GAsyncResult *result,
GError **err);
void ovirt_vm_start_async(OvirtVm *vm, OvirtProxy *proxy,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean ovirt_vm_start_finish(OvirtVm *vm,
GAsyncResult *result,
GError **err);
void ovirt_vm_stop_async(OvirtVm *vm, OvirtProxy *proxy,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean ovirt_vm_stop_finish(OvirtVm *vm,
GAsyncResult *result,
GError **err);
G_DEPRECATED_FOR(ovirt_resource_refresh_async)
void ovirt_vm_refresh_async(OvirtVm *vm, OvirtProxy *proxy,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
G_DEPRECATED_FOR(ovirt_resource_refresh_finish)
gboolean ovirt_vm_refresh_finish(OvirtVm *vm,
GAsyncResult *result,
GError **err);
OvirtCollection *ovirt_vm_get_cdroms(OvirtVm *vm);
G_END_DECLS
#endif /* __OVIRT_VM_H__ */

0
intltool-extract.in Normal file
View File

0
intltool-merge.in Normal file
View File

0
intltool-update.in Normal file
View File

20
libgovirt.doap Normal file
View File

@ -0,0 +1,20 @@
<Project xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:gnome="http://api.gnome.org/doap-extensions#"
xmlns="http://usefulinc.com/ns/doap#">
<name xml:lang="en">libgovirt</name>
<shortdesc xml:lang="en">GObject-based library to access oVirt REST API</shortdesc>
<description xml:lang="en">libgovirt is a GObject-based library to
access oVirt REST API. It uses GObject and librest to integrate well with
GNOME applications.</description>
<download-page rdf:resource="http://ftp.gnome.org/pub/GNOME/sources/libgovirt/"/>
<bug-database rdf:resource="http://bugzilla.gnome.org/browse.cgi?product=libgovirt"/>
<maintainer>
<foaf:Person>
<foaf:name>Christophe Fergeau</foaf:name>
<foaf:mbox rdf:resource="mailto:teuf@gnome.org" />
<gnome:userid>teuf</gnome:userid>
</foaf:Person>
</maintainer>
</Project>

212
m4/intltool.m4 Normal file
View File

@ -0,0 +1,212 @@
## intltool.m4 - Configure intltool for the target system. -*-Shell-script-*-
## Copyright (C) 2001 Eazel, Inc.
## Author: Maciej Stachowiak <mjs@noisehavoc.org>
## Kenneth Christiansen <kenneth@gnu.org>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
##
## As a special exception to the GNU General Public License, if you
## distribute this file as part of a program that contains a
## configuration script generated by Autoconf, you may include it under
## the same distribution terms that you use for the rest of that program.
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
# serial 42 IT_PROG_INTLTOOL
AC_DEFUN([IT_PROG_INTLTOOL], [
AC_PREREQ([2.50])dnl
AC_REQUIRE([AM_NLS])dnl
case "$am__api_version" in
1.[01234])
AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
;;
*)
;;
esac
INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3`
INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
if test -n "$1"; then
AC_MSG_CHECKING([for intltool >= $1])
AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.])
fi
AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update])
AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge])
AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract])
if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then
AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.])
fi
if test -z "$AM_DEFAULT_VERBOSITY"; then
AM_DEFAULT_VERBOSITY=1
fi
AC_SUBST([AM_DEFAULT_VERBOSITY])
INTLTOOL_V_MERGE='$(INTLTOOL__v_MERGE_$(V))'
INTLTOOL__v_MERGE_='$(INTLTOOL__v_MERGE_$(AM_DEFAULT_VERBOSITY))'
INTLTOOL__v_MERGE_0='@echo " ITMRG " [$]@;'
AC_SUBST(INTLTOOL_V_MERGE)
AC_SUBST(INTLTOOL__v_MERGE_)
AC_SUBST(INTLTOOL__v_MERGE_0)
INTLTOOL_V_MERGE_OPTIONS='$(intltool__v_merge_options_$(V))'
intltool__v_merge_options_='$(intltool__v_merge_options_$(AM_DEFAULT_VERBOSITY))'
intltool__v_merge_options_0='-q'
AC_SUBST(INTLTOOL_V_MERGE_OPTIONS)
AC_SUBST(intltool__v_merge_options_)
AC_SUBST(intltool__v_merge_options_0)
INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -p $(top_srcdir)/po $< [$]@'
INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge 5000; then
INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u --no-translations $< [$]@'
else
INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)_it_tmp_dir=tmp.intltool.[$][$]RANDOM && mkdir [$][$]_it_tmp_dir && LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u [$][$]_it_tmp_dir $< [$]@ && rmdir [$][$]_it_tmp_dir'
fi
INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
_IT_SUBST(INTLTOOL_DESKTOP_RULE)
_IT_SUBST(INTLTOOL_DIRECTORY_RULE)
_IT_SUBST(INTLTOOL_KEYS_RULE)
_IT_SUBST(INTLTOOL_PROP_RULE)
_IT_SUBST(INTLTOOL_OAF_RULE)
_IT_SUBST(INTLTOOL_PONG_RULE)
_IT_SUBST(INTLTOOL_SERVER_RULE)
_IT_SUBST(INTLTOOL_SHEET_RULE)
_IT_SUBST(INTLTOOL_SOUNDLIST_RULE)
_IT_SUBST(INTLTOOL_UI_RULE)
_IT_SUBST(INTLTOOL_XAM_RULE)
_IT_SUBST(INTLTOOL_KBD_RULE)
_IT_SUBST(INTLTOOL_XML_RULE)
_IT_SUBST(INTLTOOL_XML_NOMERGE_RULE)
_IT_SUBST(INTLTOOL_CAVES_RULE)
_IT_SUBST(INTLTOOL_SCHEMAS_RULE)
_IT_SUBST(INTLTOOL_THEME_RULE)
_IT_SUBST(INTLTOOL_SERVICE_RULE)
_IT_SUBST(INTLTOOL_POLICY_RULE)
# Check the gettext tools to make sure they are GNU
AC_PATH_PROG(XGETTEXT, xgettext)
AC_PATH_PROG(MSGMERGE, msgmerge)
AC_PATH_PROG(MSGFMT, msgfmt)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
fi
xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`"
mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`"
mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`"
if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
fi
AC_PATH_PROG(INTLTOOL_PERL, perl)
if test -z "$INTLTOOL_PERL"; then
AC_MSG_ERROR([perl not found])
fi
AC_MSG_CHECKING([for perl >= 5.8.1])
$INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1
if test $? -ne 0; then
AC_MSG_ERROR([perl 5.8.1 is required for intltool])
else
IT_PERL_VERSION=`$INTLTOOL_PERL -e "printf '%vd', $^V"`
AC_MSG_RESULT([$IT_PERL_VERSION])
fi
if test "x$2" != "xno-xml"; then
AC_MSG_CHECKING([for XML::Parser])
if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
AC_MSG_RESULT([ok])
else
AC_MSG_ERROR([XML::Parser perl module is required for intltool])
fi
fi
# Substitute ALL_LINGUAS so we can use it in po/Makefile
AC_SUBST(ALL_LINGUAS)
IT_PO_SUBDIR([po])
])
# IT_PO_SUBDIR(DIRNAME)
# ---------------------
# All po subdirs have to be declared with this macro; the subdir "po" is
# declared by IT_PROG_INTLTOOL.
#
AC_DEFUN([IT_PO_SUBDIR],
[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
dnl
dnl The following CONFIG_COMMANDS should be executed at the very end
dnl of config.status.
AC_CONFIG_COMMANDS_PRE([
AC_CONFIG_COMMANDS([$1/stamp-it], [
if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ]; then
AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.])
fi
rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
>"$1/stamp-it.tmp"
[sed '/^#/d
s/^[[].*] *//
/^[ ]*$/d
'"s|^| $ac_top_srcdir/|" \
"$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
]
[sed '/^POTFILES =/,/[^\\]$/ {
/^POTFILES =/!d
r $1/POTFILES
}
' "$1/Makefile.in" >"$1/Makefile"]
rm -f "$1/Makefile.tmp"
mv "$1/stamp-it.tmp" "$1/stamp-it"
])
])dnl
])
# _IT_SUBST(VARIABLE)
# -------------------
# Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
#
AC_DEFUN([_IT_SUBST],
[
AC_SUBST([$1])
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
]
)
# deprecated macros
AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
# A hint is needed for aclocal from Automake <= 1.9.4:
# AC_DEFUN([AC_PROG_INTLTOOL], ...)

8372
m4/libtool.m4 vendored Normal file

File diff suppressed because it is too large Load Diff

437
m4/ltoptions.m4 vendored Normal file
View File

@ -0,0 +1,437 @@
# Helper functions for option handling. -*- Autoconf -*-
#
# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
# Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 8 ltoptions.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
# ------------------------------------------
m4_define([_LT_MANGLE_OPTION],
[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
# ---------------------------------------
# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
# matching handler defined, dispatch to it. Other OPTION-NAMEs are
# saved as a flag.
m4_define([_LT_SET_OPTION],
[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
_LT_MANGLE_DEFUN([$1], [$2]),
[m4_warning([Unknown $1 option '$2'])])[]dnl
])
# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
# ------------------------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
m4_define([_LT_IF_OPTION],
[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
# -------------------------------------------------------
# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
# are set.
m4_define([_LT_UNLESS_OPTIONS],
[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
[m4_define([$0_found])])])[]dnl
m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
])[]dnl
])
# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
# ----------------------------------------
# OPTION-LIST is a space-separated list of Libtool options associated
# with MACRO-NAME. If any OPTION has a matching handler declared with
# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
# the unknown option and exit.
m4_defun([_LT_SET_OPTIONS],
[# Set options
m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[_LT_SET_OPTION([$1], _LT_Option)])
m4_if([$1],[LT_INIT],[
dnl
dnl Simply set some default values (i.e off) if boolean options were not
dnl specified:
_LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
])
_LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
])
dnl
dnl If no reference was made to various pairs of opposing options, then
dnl we run the default mode handler for the pair. For example, if neither
dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
dnl archives by default:
_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
[_LT_ENABLE_FAST_INSTALL])
_LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
[_LT_WITH_AIX_SONAME([aix])])
])
])# _LT_SET_OPTIONS
## --------------------------------- ##
## Macros to handle LT_INIT options. ##
## --------------------------------- ##
# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
# -----------------------------------------
m4_define([_LT_MANGLE_DEFUN],
[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
# -----------------------------------------------
m4_define([LT_OPTION_DEFINE],
[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
])# LT_OPTION_DEFINE
# dlopen
# ------
LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
])
AU_DEFUN([AC_LIBTOOL_DLOPEN],
[_LT_SET_OPTION([LT_INIT], [dlopen])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the 'dlopen' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
# win32-dll
# ---------
# Declare package support for building win32 dll's.
LT_OPTION_DEFINE([LT_INIT], [win32-dll],
[enable_win32_dll=yes
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
;;
esac
test -z "$AS" && AS=as
_LT_DECL([], [AS], [1], [Assembler program])dnl
test -z "$DLLTOOL" && DLLTOOL=dlltool
_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
test -z "$OBJDUMP" && OBJDUMP=objdump
_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
])# win32-dll
AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
_LT_SET_OPTION([LT_INIT], [win32-dll])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the 'win32-dll' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
# _LT_ENABLE_SHARED([DEFAULT])
# ----------------------------
# implement the --enable-shared flag, and supports the 'shared' and
# 'disable-shared' LT_INIT options.
# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
m4_define([_LT_ENABLE_SHARED],
[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([shared],
[AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do
IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
IFS=$lt_save_ifs
;;
esac],
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
_LT_DECL([build_libtool_libs], [enable_shared], [0],
[Whether or not to build shared libraries])
])# _LT_ENABLE_SHARED
LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
# Old names:
AC_DEFUN([AC_ENABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
])
AC_DEFUN([AC_DISABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], [disable-shared])
])
AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_SHARED], [])
dnl AC_DEFUN([AM_DISABLE_SHARED], [])
# _LT_ENABLE_STATIC([DEFAULT])
# ----------------------------
# implement the --enable-static flag, and support the 'static' and
# 'disable-static' LT_INIT options.
# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
m4_define([_LT_ENABLE_STATIC],
[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([static],
[AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do
IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
IFS=$lt_save_ifs
;;
esac],
[enable_static=]_LT_ENABLE_STATIC_DEFAULT)
_LT_DECL([build_old_libs], [enable_static], [0],
[Whether or not to build static libraries])
])# _LT_ENABLE_STATIC
LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
# Old names:
AC_DEFUN([AC_ENABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
])
AC_DEFUN([AC_DISABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], [disable-static])
])
AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_STATIC], [])
dnl AC_DEFUN([AM_DISABLE_STATIC], [])
# _LT_ENABLE_FAST_INSTALL([DEFAULT])
# ----------------------------------
# implement the --enable-fast-install flag, and support the 'fast-install'
# and 'disable-fast-install' LT_INIT options.
# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
m4_define([_LT_ENABLE_FAST_INSTALL],
[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([fast-install],
[AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
[optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do
IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS=$lt_save_ifs
;;
esac],
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
_LT_DECL([fast_install], [enable_fast_install], [0],
[Whether or not to optimize for fast installation])dnl
])# _LT_ENABLE_FAST_INSTALL
LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
# Old names:
AU_DEFUN([AC_ENABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the 'fast-install' option into LT_INIT's first parameter.])
])
AU_DEFUN([AC_DISABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the 'disable-fast-install' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
# _LT_WITH_AIX_SONAME([DEFAULT])
# ----------------------------------
# implement the --with-aix-soname flag, and support the `aix-soname=aix'
# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'.
m4_define([_LT_WITH_AIX_SONAME],
[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
shared_archive_member_spec=
case $host,$enable_shared in
power*-*-aix[[5-9]]*,yes)
AC_MSG_CHECKING([which variant of shared library versioning to provide])
AC_ARG_WITH([aix-soname],
[AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
[shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
[case $withval in
aix|svr4|both)
;;
*)
AC_MSG_ERROR([Unknown argument to --with-aix-soname])
;;
esac
lt_cv_with_aix_soname=$with_aix_soname],
[AC_CACHE_VAL([lt_cv_with_aix_soname],
[lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
with_aix_soname=$lt_cv_with_aix_soname])
AC_MSG_RESULT([$with_aix_soname])
if test aix != "$with_aix_soname"; then
# For the AIX way of multilib, we name the shared archive member
# based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
# and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
# Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
# the AIX toolchain works better with OBJECT_MODE set (default 32).
if test 64 = "${OBJECT_MODE-32}"; then
shared_archive_member_spec=shr_64
else
shared_archive_member_spec=shr
fi
fi
;;
*)
with_aix_soname=aix
;;
esac
_LT_DECL([], [shared_archive_member_spec], [0],
[Shared archive member basename, for filename based shared library versioning on AIX])dnl
])# _LT_WITH_AIX_SONAME
LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
# _LT_WITH_PIC([MODE])
# --------------------
# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
# LT_INIT options.
# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'.
m4_define([_LT_WITH_PIC],
[AC_ARG_WITH([pic],
[AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
[lt_p=${PACKAGE-default}
case $withval in
yes|no) pic_mode=$withval ;;
*)
pic_mode=default
# Look at the argument we got. We use all the common list separators.
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for lt_pkg in $withval; do
IFS=$lt_save_ifs
if test "X$lt_pkg" = "X$lt_p"; then
pic_mode=yes
fi
done
IFS=$lt_save_ifs
;;
esac],
[pic_mode=m4_default([$1], [default])])
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
])# _LT_WITH_PIC
LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
# Old name:
AU_DEFUN([AC_LIBTOOL_PICMODE],
[_LT_SET_OPTION([LT_INIT], [pic-only])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the 'pic-only' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
## ----------------- ##
## LTDL_INIT Options ##
## ----------------- ##
m4_define([_LTDL_MODE], [])
LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
[m4_define([_LTDL_MODE], [nonrecursive])])
LT_OPTION_DEFINE([LTDL_INIT], [recursive],
[m4_define([_LTDL_MODE], [recursive])])
LT_OPTION_DEFINE([LTDL_INIT], [subproject],
[m4_define([_LTDL_MODE], [subproject])])
m4_define([_LTDL_TYPE], [])
LT_OPTION_DEFINE([LTDL_INIT], [installable],
[m4_define([_LTDL_TYPE], [installable])])
LT_OPTION_DEFINE([LTDL_INIT], [convenience],
[m4_define([_LTDL_TYPE], [convenience])])

124
m4/ltsugar.m4 vendored Normal file
View File

@ -0,0 +1,124 @@
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
# Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 6 ltsugar.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
# lt_join(SEP, ARG1, [ARG2...])
# -----------------------------
# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
# associated separator.
# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
# versions in m4sugar had bugs.
m4_define([lt_join],
[m4_if([$#], [1], [],
[$#], [2], [[$2]],
[m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
m4_define([_lt_join],
[m4_if([$#$2], [2], [],
[m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
# lt_car(LIST)
# lt_cdr(LIST)
# ------------
# Manipulate m4 lists.
# These macros are necessary as long as will still need to support
# Autoconf-2.59, which quotes differently.
m4_define([lt_car], [[$1]])
m4_define([lt_cdr],
[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
[$#], 1, [],
[m4_dquote(m4_shift($@))])])
m4_define([lt_unquote], $1)
# lt_append(MACRO-NAME, STRING, [SEPARATOR])
# ------------------------------------------
# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
# Note that neither SEPARATOR nor STRING are expanded; they are appended
# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
# No SEPARATOR is output if MACRO-NAME was previously undefined (different
# than defined and empty).
#
# This macro is needed until we can rely on Autoconf 2.62, since earlier
# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
m4_define([lt_append],
[m4_define([$1],
m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
# ----------------------------------------------------------
# Produce a SEP delimited list of all paired combinations of elements of
# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
# has the form PREFIXmINFIXSUFFIXn.
# Needed until we can rely on m4_combine added in Autoconf 2.62.
m4_define([lt_combine],
[m4_if(m4_eval([$# > 3]), [1],
[m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
[[m4_foreach([_Lt_prefix], [$2],
[m4_foreach([_Lt_suffix],
]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
# -----------------------------------------------------------------------
# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
m4_define([lt_if_append_uniq],
[m4_ifdef([$1],
[m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
[lt_append([$1], [$2], [$3])$4],
[$5])],
[lt_append([$1], [$2], [$3])$4])])
# lt_dict_add(DICT, KEY, VALUE)
# -----------------------------
m4_define([lt_dict_add],
[m4_define([$1($2)], [$3])])
# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
# --------------------------------------------
m4_define([lt_dict_add_subkey],
[m4_define([$1($2:$3)], [$4])])
# lt_dict_fetch(DICT, KEY, [SUBKEY])
# ----------------------------------
m4_define([lt_dict_fetch],
[m4_ifval([$3],
m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
# -----------------------------------------------------------------
m4_define([lt_if_dict_fetch],
[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
[$5],
[$6])])
# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
# --------------------------------------------------------------
m4_define([lt_dict_filter],
[m4_if([$5], [], [],
[lt_join(m4_quote(m4_default([$4], [[, ]])),
lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
[lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
])

23
m4/ltversion.m4 vendored Normal file
View File

@ -0,0 +1,23 @@
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# @configure_input@
# serial 4179 ltversion.m4
# This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.4.6])
m4_define([LT_PACKAGE_REVISION], [2.4.6])
AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.4.6'
macro_revision='2.4.6'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])

99
m4/lt~obsolete.m4 vendored Normal file
View File

@ -0,0 +1,99 @@
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
# Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 5 lt~obsolete.m4
# These exist entirely to fool aclocal when bootstrapping libtool.
#
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
# which have later been changed to m4_define as they aren't part of the
# exported API, or moved to Autoconf or Automake where they belong.
#
# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
# using a macro with the same name in our local m4/libtool.m4 it'll
# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
# and doesn't know about Autoconf macros at all.)
#
# So we provide this file, which has a silly filename so it's always
# included after everything else. This provides aclocal with the
# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
# because those macros already exist, or will be overwritten later.
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
#
# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
# Yes, that means every name once taken will need to remain here until
# we give up compatibility with versions before 1.7, at which point
# we need to keep only those names which we still refer to.
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])

21
po/LINGUAS Normal file
View File

@ -0,0 +1,21 @@
bs
cs
de
el
es
eu
fr
hu
id
lt
oc
pl
pt
pt_BR
ru
sl
sr
sr@latin
sv
tr
zh_CN

221
po/Makefile.in.in Normal file
View File

@ -0,0 +1,221 @@
# Makefile for program source directory in GNU NLS utilities package.
# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
# Copyright (C) 2004-2008 Rodney Dawes <dobey.pwns@gmail.com>
#
# This file may be copied and used freely without restrictions. It may
# be used in projects which are not available under a GNU Public License,
# but which still want to provide support for the GNU gettext functionality.
#
# - Modified by Owen Taylor <otaylor@redhat.com> to use GETTEXT_PACKAGE
# instead of PACKAGE and to look for po2tbl in ./ not in intl/
#
# - Modified by jacob berkman <jacob@ximian.com> to install
# Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
#
# - Modified by Rodney Dawes <dobey.pwns@gmail.com> for use with intltool
#
# We have the following line for use by intltoolize:
# INTLTOOL_MAKEFILE
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
PACKAGE = @PACKAGE@
VERSION = @VERSION@
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
datadir = @datadir@
datarootdir = @datarootdir@
libdir = @libdir@
localedir = @localedir@
subdir = po
install_sh = @install_sh@
# Automake >= 1.8 provides @mkdir_p@.
# Until it can be supposed, use the safe fallback:
mkdir_p = $(install_sh) -d
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
GMSGFMT = @GMSGFMT@
MSGFMT = @MSGFMT@
XGETTEXT = @XGETTEXT@
INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
MSGMERGE = INTLTOOL_EXTRACT="$(INTLTOOL_EXTRACT)" XGETTEXT="$(XGETTEXT)" srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist
GENPOT = INTLTOOL_EXTRACT="$(INTLTOOL_EXTRACT)" XGETTEXT="$(XGETTEXT)" srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot
ALL_LINGUAS = @ALL_LINGUAS@
PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi)
USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep \^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep \^$$lang$$`"; then printf "$$lang "; fi; done; fi)
USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
DISTFILES = Makefile.in.in POTFILES.in $(POFILES)
EXTRA_DISTFILES = ChangeLog POTFILES.skip Makevars LINGUAS
POTFILES = \
# This comment gets stripped out
CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)
.SUFFIXES:
.SUFFIXES: .po .pox .gmo .mo .msg .cat
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
INTLTOOL_V_MSGFMT = $(INTLTOOL__v_MSGFMT_$(V))
INTLTOOL__v_MSGFMT_= $(INTLTOOL__v_MSGFMT_$(AM_DEFAULT_VERBOSITY))
INTLTOOL__v_MSGFMT_0 = @echo " MSGFMT" $@;
.po.pox:
$(MAKE) $(GETTEXT_PACKAGE).pot
$(MSGMERGE) $* $(GETTEXT_PACKAGE).pot -o $*.pox
.po.mo:
$(INTLTOOL_V_MSGFMT)$(MSGFMT) -o $@ $<
.po.gmo:
$(INTLTOOL_V_MSGFMT)file=`echo $* | sed 's,.*/,,'`.gmo \
&& rm -f $$file && $(GMSGFMT) -o $$file $<
.po.cat:
sed -f ../intl/po2msg.sed < $< > $*.msg \
&& rm -f $@ && gencat $@ $*.msg
all: all-@USE_NLS@
all-yes: $(CATALOGS)
all-no:
$(GETTEXT_PACKAGE).pot: $(POTFILES)
$(GENPOT)
install: install-data
install-data: install-data-@USE_NLS@
install-data-no: all
install-data-yes: all
linguas="$(USE_LINGUAS)"; \
for lang in $$linguas; do \
dir=$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES; \
$(mkdir_p) $$dir; \
if test -r $$lang.gmo; then \
$(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \
else \
$(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
echo "installing $(srcdir)/$$lang.gmo as" \
"$$dir/$(GETTEXT_PACKAGE).mo"; \
fi; \
if test -r $$lang.gmo.m; then \
$(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \
echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \
else \
if test -r $(srcdir)/$$lang.gmo.m ; then \
$(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \
$$dir/$(GETTEXT_PACKAGE).mo.m; \
echo "installing $(srcdir)/$$lang.gmo.m as" \
"$$dir/$(GETTEXT_PACKAGE).mo.m"; \
else \
true; \
fi; \
fi; \
done
# Empty stubs to satisfy archaic automake needs
dvi info ctags tags CTAGS TAGS ID:
# Define this as empty until I found a useful application.
install-exec installcheck:
uninstall:
linguas="$(USE_LINGUAS)"; \
for lang in $$linguas; do \
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
done
check: all $(GETTEXT_PACKAGE).pot
rm -f missing notexist
srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m
if [ -r missing -o -r notexist ]; then \
exit 1; \
fi
mostlyclean:
rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
rm -f .intltool-merge-cache
clean: mostlyclean
distclean: clean
rm -f Makefile Makefile.in POTFILES stamp-it
rm -f *.mo *.msg *.cat *.cat.m *.gmo
maintainer-clean: distclean
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
rm -f Makefile.in.in
distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
dist distdir: $(DISTFILES)
dists="$(DISTFILES)"; \
extra_dists="$(EXTRA_DISTFILES)"; \
for file in $$extra_dists; do \
test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \
done; \
for file in $$dists; do \
test -f $$file || file="$(srcdir)/$$file"; \
ln $$file $(distdir) 2> /dev/null \
|| cp -p $$file $(distdir); \
done
update-po: Makefile
$(MAKE) $(GETTEXT_PACKAGE).pot
tmpdir=`pwd`; \
linguas="$(USE_LINGUAS)"; \
for lang in $$linguas; do \
echo "$$lang:"; \
result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \
if $$result; then \
if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
rm -f $$tmpdir/$$lang.new.po; \
else \
if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
:; \
else \
echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
rm -f $$tmpdir/$$lang.new.po; \
exit 1; \
fi; \
fi; \
else \
echo "msgmerge for $$lang.gmo failed!"; \
rm -f $$tmpdir/$$lang.new.po; \
fi; \
done
Makefile POTFILES: stamp-it
@if test ! -f $@; then \
rm -f stamp-it; \
$(MAKE) stamp-it; \
fi
stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \
$(SHELL) ./config.status
# Tell versions [3.59,3.63) of GNU make not to export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

8
po/POTFILES.in Normal file
View File

@ -0,0 +1,8 @@
govirt/ovirt-action-rest-call.c
govirt/ovirt-collection.c
govirt/ovirt-options.c
govirt/ovirt-proxy.c
govirt/ovirt-resource-rest-call.c
govirt/ovirt-resource.c
govirt/ovirt-utils.c
govirt/ovirt-vm.c

130
po/bs.po Normal file
View File

@ -0,0 +1,130 @@
# Bosnian translation for bosnianuniversetranslation
# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014
# This file is distributed under the same license as the bosnianuniversetranslation package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
#
msgid ""
msgstr ""
"Project-Id-Version: bosnianuniversetranslation\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
"product=libgovirt&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2015-02-26 22:46+0000\n"
"PO-Revision-Date: 2015-02-05 00:45+0000\n"
"Last-Translator: Omar Dervisevic <omardervisevic@live.com>\n"
"Language-Team: Bosnian <bs@li.org>\n"
"Language: bs\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2015-02-05 07:34+0000\n"
"X-Generator: Launchpad (build 17331)\n"
#: ../govirt/ovirt-action-rest-call.c:57
#: ../govirt/ovirt-resource-rest-call.c:146
#, c-format
msgid "Unexpected parameter type in REST call"
msgstr "Nočekivani tip parametra u REST pozivu"
#: ../govirt/ovirt-collection.c:241
#, c-format
msgid "Got '%s' node, expected '%s'"
msgstr "Dobiven '%s' čvor, očekivano '%s'"
#: ../govirt/ovirt-options.c:54
msgid "Root CA certificate file for secure SSL connections"
msgstr "Utvrditi CA ceritifikat datoteku za sigurnu SSL konekciju"
#: ../govirt/ovirt-options.c:54
msgid "<file>"
msgstr "<file>"
#: ../govirt/ovirt-options.c:56
msgid "Display libgovirt version information"
msgstr "Prikaz informacija libgovirt verzije"
#: ../govirt/ovirt-options.c:61
msgid "oVirt Options:"
msgstr "oVrit opcije:"
#: ../govirt/ovirt-options.c:61
msgid "Show oVirt Options"
msgstr "Prikaži oVirt opcije"
#: ../govirt/ovirt-proxy.c:499
#, c-format
msgid "Failed to write to '%s': %s"
msgstr "Neuspjelo ispisivanje na '%s': %s"
#: ../govirt/ovirt-proxy.c:517
#, c-format
msgid "Failed to close '%s': %s"
msgstr "Neuspjelo zatvaranje '%s': %s"
#: ../govirt/ovirt-proxy.c:583
#, c-format
msgid "Could not extract CA certificate filename from URI"
msgstr "Nije moguće izvaditi ime datoteke CA certifikat iz URI-ja"
#: ../govirt/ovirt-resource.c:179
msgid "Cancellable initialization not supported"
msgstr "Ne podržava poretanje uz mogućnost prekida"
#: ../govirt/ovirt-resource.c:430
#, c-format
msgid "Missing mandatory 'id' attribute"
msgstr "Nedostaje obavezni 'id' atribut"
#: ../govirt/ovirt-resource.c:437
#, c-format
msgid "Missing mandatory 'href' attribute"
msgstr "Nedostaje obavezni 'href' atribut"
#: ../govirt/ovirt-resource.c:691
#, c-format
msgid "Could not find 'status' node"
msgstr "Ne mogu pronaći 'status' čvor"
#: ../govirt/ovirt-resource.c:697
#, c-format
msgid "Could not find 'state' node"
msgstr "Ne mogu pronaći 'state' čvor"
#: ../govirt/ovirt-resource.c:705
#, c-format
msgid "Action is pending"
msgstr "Radnja je na čekanju"
#: ../govirt/ovirt-resource.c:709
#, c-format
msgid "Action is in progress"
msgstr "Radnja je u tijeku"
#: ../govirt/ovirt-resource.c:713
#, c-format
msgid "Action has failed"
msgstr "Radnja nije uspjela"
#: ../govirt/ovirt-resource.c:718
#, c-format
msgid "Unknown action failure"
msgstr "Nepoznato zatajenje radnje"
#: ../govirt/ovirt-utils.c:193
#, c-format
msgid "Could not find 'reason' node"
msgstr "Ne mogu pronaći 'reason' čvor"
#: ../govirt/ovirt-vm.c:265
#, c-format
msgid "Could not find 'ticket' node"
msgstr "Ne mogu pronaći 'ticket' čvor"
#: ../govirt/ovirt-vm.c:271
#, c-format
msgid "Could not find 'value' node"
msgstr "Ne mogu pronaći 'value' čvor"
#: ../govirt/ovirt-vm.c:284
#, c-format
msgid "Could not find 'expiry' node"
msgstr "Ne mogu pronaći 'expiry cvor"

131
po/cs.po Normal file
View File

@ -0,0 +1,131 @@
# Czech translation for libgovirt.
# Copyright (C) 2014 libgovirt's COPYRIGHT HOLDER
# This file is distributed under the same license as the libgovirt package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# Marek Černocký <marek@manet.cz>, 2014.
#
msgid ""
msgstr ""
"Project-Id-Version: libgovirt master\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
"product=libgovirt&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2014-09-22 21:42+0000\n"
"PO-Revision-Date: 2014-09-23 09:31+0200\n"
"Last-Translator: Marek Černocký <marek@manet.cz>\n"
"Language-Team: Czech <gnome-cs-list@gnome.org>\n"
"Language: cs\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
"X-Generator: Gtranslator 2.91.6\n"
#: ../govirt/ovirt-action-rest-call.c:57
#: ../govirt/ovirt-resource-rest-call.c:146
#, c-format
msgid "Unexpected parameter type in REST call"
msgstr "Neočekávaný typ parametru ve volání REST"
#: ../govirt/ovirt-collection.c:241
#, c-format
msgid "Got '%s' node, expected '%s'"
msgstr "Obdržen uzel „%s“, očekáván byl „%s“"
#: ../govirt/ovirt-options.c:50
msgid "Root CA certificate file for secure SSL connections"
msgstr "Kořenový certifikát CA pro bezpečné připojení přes SSL"
#: ../govirt/ovirt-options.c:50
msgid "<file>"
msgstr "<soubor>"
#: ../govirt/ovirt-options.c:52
msgid "Display libgovirt version information"
msgstr "Zobrazit informace o verzi libgovirt"
#: ../govirt/ovirt-options.c:57
msgid "oVirt Options:"
msgstr "Volby oVirt:"
#: ../govirt/ovirt-options.c:57
msgid "Show oVirt Options"
msgstr "Zobrazit volby oVirt"
#: ../govirt/ovirt-proxy.c:499
#, c-format
msgid "Failed to write to '%s': %s"
msgstr "Selhal zápis do „%s“: %s"
#: ../govirt/ovirt-proxy.c:517
#, c-format
msgid "Failed to close '%s': %s"
msgstr "Selhalo zavření „%s“: %s"
#: ../govirt/ovirt-proxy.c:583
#, c-format
msgid "Could not extract CA certificate filename from URI"
msgstr "Nelze získat název souboru s certifikátem CA z adresy URI"
#: ../govirt/ovirt-resource.c:179
msgid "Cancellable initialization not supported"
msgstr "Přerušitelná inicializace není podporována"
#: ../govirt/ovirt-resource.c:430
#, c-format
msgid "Missing mandatory 'id' attribute"
msgstr "Schází povinný atribut „id“"
#: ../govirt/ovirt-resource.c:437
#, c-format
msgid "Missing mandatory 'href' attribute"
msgstr "Schází povinný atribut „href“"
#: ../govirt/ovirt-resource.c:691
#, c-format
msgid "Could not find 'status' node"
msgstr "Nelze najít uzel „status“"
#: ../govirt/ovirt-resource.c:697
#, c-format
msgid "Could not find 'state' node"
msgstr "Nelze najít uzel „state“"
#: ../govirt/ovirt-resource.c:705
#, c-format
msgid "Action is pending"
msgstr "Činnost čeká na provedení"
#: ../govirt/ovirt-resource.c:709
#, c-format
msgid "Action is in progress"
msgstr "Činnost se právě provádí"
#: ../govirt/ovirt-resource.c:713
#, c-format
msgid "Action has failed"
msgstr "Činnost selhala"
#: ../govirt/ovirt-resource.c:718
#, c-format
msgid "Unknown action failure"
msgstr "Neznámé selhání činnosti"
#: ../govirt/ovirt-utils.c:193
#, c-format
msgid "Could not find 'reason' node"
msgstr "Nelze najít uzel „reason“"
#: ../govirt/ovirt-vm.c:265
#, c-format
msgid "Could not find 'ticket' node"
msgstr "Nelze najít uzel „ticket“"
#: ../govirt/ovirt-vm.c:271
#, c-format
msgid "Could not find 'value' node"
msgstr "Nelze najít uzel „value“"
#: ../govirt/ovirt-vm.c:284
#, c-format
msgid "Could not find 'expiry' node"
msgstr "Nelze najít uzel „expiry“"

130
po/de.po Normal file
View File

@ -0,0 +1,130 @@
# German translation for libgovirt.
# Copyright (C) 2014 libgovirt's COPYRIGHT HOLDER
# This file is distributed under the same license as the libgovirt package.
# Christian Kirbach <Christian.Kirbach@gmail.com>, 2014.
#
msgid ""
msgstr ""
"Project-Id-Version: libgovirt master\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
"product=libgovirt&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2014-09-27 09:33+0000\n"
"PO-Revision-Date: 2014-10-05 22:29+0100\n"
"Last-Translator: Christian Kirbach <christian.kirbach@gmail.com>\n"
"Language-Team: German <gnome-de@gnome.org>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.5.4\n"
#: ../govirt/ovirt-action-rest-call.c:57
#: ../govirt/ovirt-resource-rest-call.c:146
#, c-format
msgid "Unexpected parameter type in REST call"
msgstr "Unerwarteter Parametertyp im REST-Aufruf"
#: ../govirt/ovirt-collection.c:241
#, c-format
msgid "Got '%s' node, expected '%s'"
msgstr "Knoten »%s« erhalten, »%s« erwartet"
#: ../govirt/ovirt-options.c:50
msgid "Root CA certificate file for secure SSL connections"
msgstr "Root CA Zertifikat-Datei für sichere SSL-Verbindungen"
#: ../govirt/ovirt-options.c:50
msgid "<file>"
msgstr "<Datei>"
#: ../govirt/ovirt-options.c:52
msgid "Display libgovirt version information"
msgstr "Versionsinformationen zu libgovirt anzeigen"
#: ../govirt/ovirt-options.c:57
msgid "oVirt Options:"
msgstr "oVirt-Optionen:"
#: ../govirt/ovirt-options.c:57
msgid "Show oVirt Options"
msgstr "oVirt-Optionen anzeigen"
#: ../govirt/ovirt-proxy.c:499
#, c-format
msgid "Failed to write to '%s': %s"
msgstr "Schreiben von »%s« fehlgeschlagen: %s"
#: ../govirt/ovirt-proxy.c:517
#, c-format
msgid "Failed to close '%s': %s"
msgstr "Schließen von »%s« fehlgeschlagen: %s"
#: ../govirt/ovirt-proxy.c:583
#, c-format
msgid "Could not extract CA certificate filename from URI"
msgstr "CA Zertifikat-Dateiname konnte nicht aus der Adresse ermittelt werden"
#: ../govirt/ovirt-resource.c:179
msgid "Cancellable initialization not supported"
msgstr "Abbrechbare Initialisierung wird nicht unterstützt"
#: ../govirt/ovirt-resource.c:430
#, c-format
msgid "Missing mandatory 'id' attribute"
msgstr "Erforderliches Attribut »id« fehlt"
#: ../govirt/ovirt-resource.c:437
#, c-format
msgid "Missing mandatory 'href' attribute"
msgstr "Erforderliches Attribut »href« fehlt"
#: ../govirt/ovirt-resource.c:691
#, c-format
msgid "Could not find 'status' node"
msgstr "Knoten »Status« konnte nicht gefunden werden"
#: ../govirt/ovirt-resource.c:697
#, c-format
msgid "Could not find 'state' node"
msgstr "Knoten »Zustand« konnte nicht gefunden werden"
#: ../govirt/ovirt-resource.c:705
#, c-format
msgid "Action is pending"
msgstr "Aktion steht aus"
#: ../govirt/ovirt-resource.c:709
#, c-format
msgid "Action is in progress"
msgstr "Aktion läuft"
#: ../govirt/ovirt-resource.c:713
#, c-format
msgid "Action has failed"
msgstr "Aktion ist gescheitert"
#: ../govirt/ovirt-resource.c:718
#, c-format
msgid "Unknown action failure"
msgstr "Unbekanntes Fehlschlagen der Aktion"
#: ../govirt/ovirt-utils.c:193
#, c-format
msgid "Could not find 'reason' node"
msgstr "Knoten »Grund« konnte nicht gefunden werden"
#: ../govirt/ovirt-vm.c:265
#, c-format
msgid "Could not find 'ticket' node"
msgstr "Knoten »Ticket« konnte nicht gefunden werden"
#: ../govirt/ovirt-vm.c:271
#, c-format
msgid "Could not find 'value' node"
msgstr "Knoten »Wert« konnte nicht gefunden werden"
#: ../govirt/ovirt-vm.c:284
#, c-format
msgid "Could not find 'expiry' node"
msgstr "Knoten »Ablauf« konnte nicht gefunden werden"

131
po/el.po Normal file
View File

@ -0,0 +1,131 @@
# Greek translation for libgovirt.
# Copyright (C) 2014 libgovirt's COPYRIGHT HOLDER
# This file is distributed under the same license as the libgovirt package.
# Dimitris Spingos <dmtrs32@gmail.com>, 2014.
# Dimitris Spingos (Δημήτρης Σπίγγος) <dmtrs32@gmail.com>, 2014.
msgid ""
msgstr ""
"Project-Id-Version: libgovirt master\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=libgov"
"irt&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2014-11-07 22:22+0000\n"
"PO-Revision-Date: 2014-11-08 12:02+0300\n"
"Last-Translator: Dimitris Spingos (Δημήτρης Σπίγγος) <dmtrs32@gmail.com>\n"
"Language-Team: team@lists.gnome.gr\n"
"Language: el\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Virtaal 0.7.1\n"
"X-Project-Style: gnome\n"
#: ../govirt/ovirt-action-rest-call.c:57
#: ../govirt/ovirt-resource-rest-call.c:146
#, c-format
msgid "Unexpected parameter type in REST call"
msgstr "Απροσδόκητος τύπος παραμέτρου σε κλήση REST"
#: ../govirt/ovirt-collection.c:241
#, c-format
msgid "Got '%s' node, expected '%s'"
msgstr "Ελήφθη κόμβος '%s', αναμενόταν '%s'"
#: ../govirt/ovirt-options.c:50
msgid "Root CA certificate file for secure SSL connections"
msgstr "Αρχείο ριζικού πιστοποιητικού CA για ασφαλείς συνδέσεις SSL"
#: ../govirt/ovirt-options.c:50
msgid "<file>"
msgstr "<file>"
#: ../govirt/ovirt-options.c:52
msgid "Display libgovirt version information"
msgstr "Εμφάνιση πληροφοριών έκδοσης libgovirt"
#: ../govirt/ovirt-options.c:57
msgid "oVirt Options:"
msgstr "Επιλογές oVirt:"
#: ../govirt/ovirt-options.c:57
msgid "Show oVirt Options"
msgstr "Εμφάνιση επιλογών oVirt"
#: ../govirt/ovirt-proxy.c:499
#, c-format
msgid "Failed to write to '%s': %s"
msgstr "Αποτυχία εγγραφής στο '%s': %s"
#: ../govirt/ovirt-proxy.c:517
#, c-format
msgid "Failed to close '%s': %s"
msgstr "Αποτυχία κλεισίματος του '%s': %s"
#: ../govirt/ovirt-proxy.c:583
#, c-format
msgid "Could not extract CA certificate filename from URI"
msgstr "Αδύνατη η εξαγωγή ονόματος αρχείου πιστοποιητικού CA από το URI"
#: ../govirt/ovirt-resource.c:179
msgid "Cancellable initialization not supported"
msgstr "Δεν υποστηρίζεται ακύρωση της αρχικοποίησης"
#: ../govirt/ovirt-resource.c:430
#, c-format
msgid "Missing mandatory 'id' attribute"
msgstr "Λείπει το υποχρεωτικό γνώρισμα 'id' (αναγνωριστικό)"
#: ../govirt/ovirt-resource.c:437
#, c-format
msgid "Missing mandatory 'href' attribute"
msgstr "Λείπει το υποχρεωτικό γνώρισμα 'href' (αναφορά υπερκειμένου)"
#: ../govirt/ovirt-resource.c:691
#, c-format
msgid "Could not find 'status' node"
msgstr "Αδύνατη η εύρεση κόμβου 'status' (κατάστασης)"
#: ../govirt/ovirt-resource.c:697
#, c-format
msgid "Could not find 'state' node"
msgstr "Αδύνατη η εύρεση κόμβου 'state' (κατάστασης)"
#: ../govirt/ovirt-resource.c:705
#, c-format
msgid "Action is pending"
msgstr "Εκκρεμεί η ενέργεια"
#: ../govirt/ovirt-resource.c:709
#, c-format
msgid "Action is in progress"
msgstr "Η ενέργεια εξελίσσεται"
#: ../govirt/ovirt-resource.c:713
#, c-format
msgid "Action has failed"
msgstr "Η ενέργεια έχει αποτύχει"
#: ../govirt/ovirt-resource.c:718
#, c-format
msgid "Unknown action failure"
msgstr "Αποτυχία άγνωστης ενέργειας"
#: ../govirt/ovirt-utils.c:193
#, c-format
msgid "Could not find 'reason' node"
msgstr "Αδύνατη η εύρεση κόμβου 'reason' (αιτίας)"
#: ../govirt/ovirt-vm.c:265
#, c-format
msgid "Could not find 'ticket' node"
msgstr "Αδύνατη η εύρεση κόμβου 'ticket' (δελτίου)"
#: ../govirt/ovirt-vm.c:271
#, c-format
msgid "Could not find 'value' node"
msgstr "Αδύνατη η εύρεση κόμβου 'value' (τιμής)"
#: ../govirt/ovirt-vm.c:284
#, c-format
msgid "Could not find 'expiry' node"
msgstr "Αδύνατη η εύρεση κόμβου 'expiry' (λήξης)"

131
po/es.po Normal file
View File

@ -0,0 +1,131 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# Daniel Mustieles <daniel.mustieles@gmail.com>, 2014.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
"product=libgovirt&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2014-09-23 09:32+0000\n"
"PO-Revision-Date: 2014-09-23 19:25+0200\n"
"Last-Translator: Daniel Mustieles <daniel.mustieles@gmail.com>\n"
"Language-Team: Español; Castellano <gnome-es-list@gnome.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Gtranslator 2.91.6\n"
#: ../govirt/ovirt-action-rest-call.c:57
#: ../govirt/ovirt-resource-rest-call.c:146
#, c-format
msgid "Unexpected parameter type in REST call"
msgstr "Tipo de parámetro no esperado en la llamada a REST"
#: ../govirt/ovirt-collection.c:241
#, c-format
msgid "Got '%s' node, expected '%s'"
msgstr "Se obtuvo el nodo «%s», se esperaba «%s»"
#: ../govirt/ovirt-options.c:50
msgid "Root CA certificate file for secure SSL connections"
msgstr "Archivo de certificado CA raíz para conexiones SSL seguras"
#: ../govirt/ovirt-options.c:50
msgid "<file>"
msgstr "<archivo>"
#: ../govirt/ovirt-options.c:52
msgid "Display libgovirt version information"
msgstr "Mostrar la información de la versión de libgovirt"
#: ../govirt/ovirt-options.c:57
msgid "oVirt Options:"
msgstr "Opciones de oVirt:"
#: ../govirt/ovirt-options.c:57
msgid "Show oVirt Options"
msgstr "Mostrar las opciones de oVirt"
#: ../govirt/ovirt-proxy.c:499
#, c-format
msgid "Failed to write to '%s': %s"
msgstr "Falló al escribir en «%s»: %s"
#: ../govirt/ovirt-proxy.c:517
#, c-format
msgid "Failed to close '%s': %s"
msgstr "Falló al cerrar «%s»: %s"
#: ../govirt/ovirt-proxy.c:583
#, c-format
msgid "Could not extract CA certificate filename from URI"
msgstr "No se pudo extraer el nombre del archivo del certificado CA del URI"
#: ../govirt/ovirt-resource.c:179
msgid "Cancellable initialization not supported"
msgstr "Inicialización cancelable no soportada"
#: ../govirt/ovirt-resource.c:430
#, c-format
msgid "Missing mandatory 'id' attribute"
msgstr "Falta el atributo obligatorio «id»"
#: ../govirt/ovirt-resource.c:437
#, c-format
msgid "Missing mandatory 'href' attribute"
msgstr "Falta el atributo obligatorio «href»"
#: ../govirt/ovirt-resource.c:691
#, c-format
msgid "Could not find 'status' node"
msgstr "No se pudo encontrar el nodo «status»"
#: ../govirt/ovirt-resource.c:697
#, c-format
msgid "Could not find 'state' node"
msgstr "No se pudo encontrar el nodo «state»"
#: ../govirt/ovirt-resource.c:705
#, c-format
msgid "Action is pending"
msgstr "La acción está pendiente"
#: ../govirt/ovirt-resource.c:709
#, c-format
msgid "Action is in progress"
msgstr "La acción está en progreso"
#: ../govirt/ovirt-resource.c:713
#, c-format
msgid "Action has failed"
msgstr "La acción ha fallado"
#: ../govirt/ovirt-resource.c:718
#, c-format
msgid "Unknown action failure"
msgstr "Fallo en acción desconocido"
#: ../govirt/ovirt-utils.c:193
#, c-format
msgid "Could not find 'reason' node"
msgstr "No se pudo encontrar el nodo «reason»"
#: ../govirt/ovirt-vm.c:265
#, c-format
msgid "Could not find 'ticket' node"
msgstr "No se pudo encontrar el nodo «ticket»"
#: ../govirt/ovirt-vm.c:271
#, c-format
msgid "Could not find 'value' node"
msgstr "No se pudo encontrar el nodo «value»"
#: ../govirt/ovirt-vm.c:284
#, c-format
msgid "Could not find 'expiry' node"
msgstr "No se pudo encontrar el nodo «expiry»"

132
po/eu.po Normal file
View File

@ -0,0 +1,132 @@
# Basque translation for libgovirt.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# Iñaki Larrañaga Murgoitio <dooteo@zundan.com>, 2015.
#
msgid ""
msgstr ""
"Project-Id-Version: libgovirt master\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
"product=libgovirt&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2015-04-04 17:58+0200\n"
"PO-Revision-Date: 2015-04-04 17:58+0200\n"
"Last-Translator: Iñaki Larrañaga Murgoitio <dooteo@zundan.com>\n"
"Language-Team: Basque <librezale@librezale.org>\n"
"Language: eu\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Lokalize 1.5\n"
#: ../govirt/ovirt-action-rest-call.c:57
#: ../govirt/ovirt-resource-rest-call.c:146
#, c-format
msgid "Unexpected parameter type in REST call"
msgstr "Ustekabeko parametro mota REST deian"
#: ../govirt/ovirt-collection.c:241
#, c-format
msgid "Got '%s' node, expected '%s'"
msgstr "'%s' nodoa lortu da, '%s' espero zen"
#: ../govirt/ovirt-options.c:54
msgid "Root CA certificate file for secure SSL connections"
msgstr "Erroko ZE ziurtagiri-fitxategia SSL konexio seguruentzako"
#: ../govirt/ovirt-options.c:54
msgid "<file>"
msgstr "<fitxategia>"
#: ../govirt/ovirt-options.c:56
msgid "Display libgovirt version information"
msgstr "Bistaratu libgovirt-ren bertsioa"
#: ../govirt/ovirt-options.c:61
msgid "oVirt Options:"
msgstr "oVirt-ren aukerak:"
#: ../govirt/ovirt-options.c:61
msgid "Show oVirt Options"
msgstr "Erakutsi oVirt-ren aukerak"
#: ../govirt/ovirt-proxy.c:499
#, c-format
msgid "Failed to write to '%s': %s"
msgstr "Huts egin du '%s'(e)n idaztean: %s"
#: ../govirt/ovirt-proxy.c:517
#, c-format
msgid "Failed to close '%s': %s"
msgstr "Huts egin du '%s' ixtean: %s"
#: ../govirt/ovirt-proxy.c:583
#, c-format
msgid "Could not extract CA certificate filename from URI"
msgstr "Ezin izan da ZE ziurtagiri-fitxategia erauzi URItik"
#: ../govirt/ovirt-resource.c:179
msgid "Cancellable initialization not supported"
msgstr "Bertan behera utz daitekeen hasieratzea ez dago onartuta"
#: ../govirt/ovirt-resource.c:430
#, c-format
msgid "Missing mandatory 'id' attribute"
msgstr "Derrigorrezko 'id' atributua falta da"
#: ../govirt/ovirt-resource.c:437
#, c-format
msgid "Missing mandatory 'href' attribute"
msgstr "Derrigorrezko 'href' atributua falta da"
#: ../govirt/ovirt-resource.c:691
#, c-format
msgid "Could not find 'status' node"
msgstr "Ezin izan da 'status' (egoera) nodoa bilatu"
#: ../govirt/ovirt-resource.c:697
#, c-format
msgid "Could not find 'state' node"
msgstr "Ezin izan da 'state' nodoa bilatu"
#: ../govirt/ovirt-resource.c:705
#, c-format
msgid "Action is pending"
msgstr "Ekintza egiteko dago"
#: ../govirt/ovirt-resource.c:709
#, c-format
msgid "Action is in progress"
msgstr "Ekintza egiten ari da"
#: ../govirt/ovirt-resource.c:713
#, c-format
msgid "Action has failed"
msgstr "Ekintzak huts egin du"
#: ../govirt/ovirt-resource.c:718
#, c-format
msgid "Unknown action failure"
msgstr "Ekintzaren hutsegite ezezaguna"
#: ../govirt/ovirt-utils.c:224
#, c-format
msgid "Could not find 'reason' node"
msgstr "Ezin izan da 'reason' (zergatia) nodoa bilatu"
#: ../govirt/ovirt-vm.c:265
#, c-format
msgid "Could not find 'ticket' node"
msgstr "Ezin izan da 'ticket' (txartela) nodoa bilatu"
#: ../govirt/ovirt-vm.c:271
#, c-format
msgid "Could not find 'value' node"
msgstr "Ezin izan da 'value' (balioa) nodoa bilatu"
#: ../govirt/ovirt-vm.c:284
#, c-format
msgid "Could not find 'expiry' node"
msgstr "Ezin izan da 'expiry' (iraungitzea) nodoa bilatu"

130
po/fr.po Normal file
View File

@ -0,0 +1,130 @@
# French translation for libgovirt.
# Copyright (C) 2015 libgovirt's COPYRIGHT HOLDER
# This file is distributed under the same license as the libgovirt package.
# Erwan GEORGET <dremor@dremor.info>, 2015.
#
msgid ""
msgstr ""
"Project-Id-Version: libgovirt master\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
"product=libgovirt&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2015-08-25 10:27+0000\n"
"PO-Revision-Date: 2015-09-20 19:02+0200\n"
"Last-Translator: Erwan Georget <dremor@dremor.info>\n"
"Language-Team: French <gnomefr@traduc.org>\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Poedit 1.8.4\n"
#: ../govirt/ovirt-action-rest-call.c:57
#: ../govirt/ovirt-resource-rest-call.c:146
#, c-format
msgid "Unexpected parameter type in REST call"
msgstr "Type de paramètre inattendu dans l'appel REST"
#: ../govirt/ovirt-collection.c:260
#, c-format
msgid "Got '%s' node, expected '%s'"
msgstr "Nœud « %s » reçus, « %s » attendu"
#: ../govirt/ovirt-options.c:54
msgid "Root CA certificate file for secure SSL connections"
msgstr "Fichier de certificat CA racine pour connexion SSL sécurisée"
#: ../govirt/ovirt-options.c:54
msgid "<file>"
msgstr "<fichier>"
#: ../govirt/ovirt-options.c:56
msgid "Display libgovirt version information"
msgstr "Afficher les informations de version de libgovirt"
#: ../govirt/ovirt-options.c:61
msgid "oVirt Options:"
msgstr "Options oVirt :"
#: ../govirt/ovirt-options.c:61
msgid "Show oVirt Options"
msgstr "Afficher les options oVirt"
#: ../govirt/ovirt-proxy.c:516
#, c-format
msgid "Failed to write to '%s': %s"
msgstr "Échec de l'écriture vers « %s » : %s"
#: ../govirt/ovirt-proxy.c:534
#, c-format
msgid "Failed to close '%s': %s"
msgstr "Échec de la fermeture de « %s » : %s"
#: ../govirt/ovirt-proxy.c:644
#, c-format
msgid "Could not extract CA certificate filename from URI"
msgstr "Échec de l'extraction du certificat CA depuis l'URI"
#: ../govirt/ovirt-resource.c:179
msgid "Cancellable initialization not supported"
msgstr "Initialisation annulable non prise en charge"
#: ../govirt/ovirt-resource.c:430
#, c-format
msgid "Missing mandatory 'id' attribute"
msgstr "Attribut obligatoire « id » manquant"
#: ../govirt/ovirt-resource.c:437
#, c-format
msgid "Missing mandatory 'href' attribute"
msgstr "Attribut obligatoire « href » manquant"
#: ../govirt/ovirt-resource.c:691
#, c-format
msgid "Could not find 'status' node"
msgstr "Impossible de trouver le nœud « status »"
#: ../govirt/ovirt-resource.c:697
#, c-format
msgid "Could not find 'state' node"
msgstr "Impossible de trouver le nœud « state »"
#: ../govirt/ovirt-resource.c:705
#, c-format
msgid "Action is pending"
msgstr "L'action est en attente"
#: ../govirt/ovirt-resource.c:709
#, c-format
msgid "Action is in progress"
msgstr "L'action est en cours"
#: ../govirt/ovirt-resource.c:713
#, c-format
msgid "Action has failed"
msgstr "L'action a échoué"
#: ../govirt/ovirt-resource.c:718
#, c-format
msgid "Unknown action failure"
msgstr "Échec d'action inconnu"
#: ../govirt/ovirt-utils.c:224
#, c-format
msgid "Could not find 'reason' node"
msgstr "Impossible de trouver le nœud « reason »"
#: ../govirt/ovirt-vm.c:265
#, c-format
msgid "Could not find 'ticket' node"
msgstr "Impossible de trouver le nœud « ticket »"
#: ../govirt/ovirt-vm.c:271
#, c-format
msgid "Could not find 'value' node"
msgstr "Impossible de trouver le nœud « value »"
#: ../govirt/ovirt-vm.c:284
#, c-format
msgid "Could not find 'expiry' node"
msgstr "Impossible de trouver le nœud « expiry »"

Some files were not shown because too many files have changed in this diff Show More