From 1d8d4f86b6f8594b67fdb5da3fbe2c6dbbc95cf2 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 23 May 2008 08:24:41 +0000 Subject: [PATCH] Standardize use of header files, making internal.h primary. * qemud/internal.h, qemud/qemud.h: Rename this file so it doesn't conflict with src/internal.h. * HACKING: Document how header files should be used. * qemud/Makefile.am: Add src/ directory to includes. * qemud/event.c, qemud/mdns.c, qemud/qemud.c, qemud/remote.c, qemud/remote_protocol.c, qemud/remote_protocol.h, qemud/remote_protocol.x, src/buf.c, src/libvirt.c, src/nodeinfo.c, src/qemu_conf.c, src/qemu_driver.c, src/stats_linux.c, src/storage_backend.c, src/storage_backend_fs.c, src/storage_backend_iscsi.c, src/storage_backend_logical.c, src/storage_conf.c, src/storage_driver.c, src/util.c, src/util.h, src/virsh.c, src/virterror.c, src/xend_internal.c, src/xml.c, tests/reconnect.c, tests/xmlrpctest.c, tests/qparamtest.c: Standardize use of header files. * docs/*, po/*: Rebuild docs. --- ChangeLog | 19 + HACKING | 41 + docs/FAQ.html | 235 +++-- docs/apps.html | 118 ++- docs/archdomain.html | 75 +- docs/architecture.html | 102 +- docs/archnetwork.html | 99 +- docs/archnode.html | 75 +- docs/archstorage.html | 86 +- docs/auth.html | 103 +- docs/bindings.html | 77 +- docs/bugs.html | 71 +- docs/contact.html | 45 +- docs/deployment.html | 75 +- docs/docs.html | 60 +- docs/downloads.html | 62 +- docs/drivers.html | 112 ++- docs/drvlxc.html | 84 +- docs/drvopenvz.html | 84 +- docs/drvqemu.html | 99 +- docs/drvremote.html | 84 +- docs/drvtest.html | 84 +- docs/drvxen.html | 103 +- docs/errors.html | 80 +- docs/format.html | 78 +- docs/formatcaps.html | 78 +- docs/formatnetwork.html | 162 +++- docs/formatnode.html | 78 +- docs/hvsupport.html | 654 ++++++++++++- docs/index.html | 89 +- docs/news.html | 425 ++++++--- docs/python.html | 103 +- docs/relatedlinks.html | 105 ++- docs/sitemap.html | 357 ++++--- docs/storage.html | 279 ++++-- docs/uri.html | 242 +++-- docs/windows.html | 236 +++-- po/af.po | 1664 +++++++++++++++++--------------- po/am.po | 1664 +++++++++++++++++--------------- po/ar.po | 1664 +++++++++++++++++--------------- po/as.po | 1664 +++++++++++++++++--------------- po/be.po | 1664 +++++++++++++++++--------------- po/bg.po | 1664 +++++++++++++++++--------------- po/bn.po | 1664 +++++++++++++++++--------------- po/bn_IN.po | 1664 +++++++++++++++++--------------- po/bs.po | 1664 +++++++++++++++++--------------- po/ca.po | 1664 +++++++++++++++++--------------- po/cs.po | 1664 +++++++++++++++++--------------- po/cy.po | 1664 +++++++++++++++++--------------- po/da.po | 1664 +++++++++++++++++--------------- po/de.po | 1667 ++++++++++++++++++--------------- po/el.po | 1664 +++++++++++++++++--------------- po/en_GB.po | 1664 +++++++++++++++++--------------- po/es.po | 1664 +++++++++++++++++--------------- po/et.po | 1664 +++++++++++++++++--------------- po/eu_ES.po | 1664 +++++++++++++++++--------------- po/fa.po | 1664 +++++++++++++++++--------------- po/fi.po | 1664 +++++++++++++++++--------------- po/fr.po | 1664 +++++++++++++++++--------------- po/gl.po | 1664 +++++++++++++++++--------------- po/gu.po | 1664 +++++++++++++++++--------------- po/he.po | 1664 +++++++++++++++++--------------- po/hi.po | 1664 +++++++++++++++++--------------- po/hr.po | 1664 +++++++++++++++++--------------- po/hu.po | 1664 +++++++++++++++++--------------- po/hy.po | 1664 +++++++++++++++++--------------- po/id.po | 1664 +++++++++++++++++--------------- po/is.po | 1664 +++++++++++++++++--------------- po/it.po | 1666 +++++++++++++++++--------------- po/ja.po | 1664 +++++++++++++++++--------------- po/ka.po | 1664 +++++++++++++++++--------------- po/kn.po | 1664 +++++++++++++++++--------------- po/ko.po | 1664 +++++++++++++++++--------------- po/ku.po | 1664 +++++++++++++++++--------------- po/lo.po | 1664 +++++++++++++++++--------------- po/lt.po | 1664 +++++++++++++++++--------------- po/lv.po | 1664 +++++++++++++++++--------------- po/mk.po | 1664 +++++++++++++++++--------------- po/ml.po | 1664 +++++++++++++++++--------------- po/mr.po | 1664 +++++++++++++++++--------------- po/ms.po | 1664 +++++++++++++++++--------------- po/my.po | 1664 +++++++++++++++++--------------- po/nb.po | 1664 +++++++++++++++++--------------- po/nl.po | 1661 +++++++++++++++++--------------- po/nn.po | 1664 +++++++++++++++++--------------- po/no.po | 1664 +++++++++++++++++--------------- po/nso.po | 1664 +++++++++++++++++--------------- po/or.po | 1664 +++++++++++++++++--------------- po/pa.po | 1664 +++++++++++++++++--------------- po/pl.po | 1666 +++++++++++++++++--------------- po/pt.po | 1664 +++++++++++++++++--------------- po/pt_BR.po | 1667 ++++++++++++++++++--------------- po/ro.po | 1664 +++++++++++++++++--------------- po/ru.po | 1664 +++++++++++++++++--------------- po/si.po | 1664 +++++++++++++++++--------------- po/sk.po | 1664 +++++++++++++++++--------------- po/sl.po | 1664 +++++++++++++++++--------------- po/sq.po | 1664 +++++++++++++++++--------------- po/sr.po | 1666 +++++++++++++++++--------------- po/sr@latin.po | 1666 +++++++++++++++++--------------- po/sv.po | 1664 +++++++++++++++++--------------- po/ta.po | 1664 +++++++++++++++++--------------- po/te.po | 1664 +++++++++++++++++--------------- po/th.po | 1664 +++++++++++++++++--------------- po/tr.po | 1664 +++++++++++++++++--------------- po/uk.po | 1664 +++++++++++++++++--------------- po/ur.po | 1664 +++++++++++++++++--------------- po/vi.po | 1664 +++++++++++++++++--------------- po/zh_CN.po | 1664 +++++++++++++++++--------------- po/zh_TW.po | 1664 +++++++++++++++++--------------- po/zu.po | 1664 +++++++++++++++++--------------- qemud/Makefile.am | 1 + qemud/event.c | 2 +- qemud/mdns.c | 5 +- qemud/qemud.c | 10 +- qemud/{internal.h => qemud.h} | 6 +- qemud/remote.c | 4 +- qemud/remote_protocol.c | 2 +- qemud/remote_protocol.h | 2 +- qemud/remote_protocol.x | 2 +- src/buf.c | 2 - src/libvirt.c | 1 - src/nodeinfo.c | 1 + src/qemu_conf.c | 3 +- src/qemu_driver.c | 3 +- src/stats_linux.c | 1 + src/storage_backend.c | 4 +- src/storage_backend_fs.c | 1 + src/storage_backend_iscsi.c | 1 + src/storage_backend_logical.c | 1 + src/storage_conf.c | 4 +- src/storage_driver.c | 1 + src/util.c | 1 - src/util.h | 1 - src/virsh.c | 4 +- src/virterror.c | 4 +- src/xend_internal.c | 2 +- src/xml.c | 2 - tests/qparamtest.c | 1 + tests/reconnect.c | 2 - tests/xmlrpctest.c | 2 +- 141 files changed, 70370 insertions(+), 57812 deletions(-) rename qemud/{internal.h => qemud.h} (97%) diff --git a/ChangeLog b/ChangeLog index dd0abb82d2..ea4c4a62a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +Fri May 23 08:56:00 BST 2008 Richard W.M. Jones + + Standardize use of header files, making internal.h primary. + * qemud/internal.h, qemud/qemud.h: Rename this file so it + doesn't conflict with src/internal.h. + * HACKING: Document how header files should be used. + * qemud/Makefile.am: Add src/ directory to includes. + * qemud/event.c, qemud/mdns.c, qemud/qemud.c, qemud/remote.c, + qemud/remote_protocol.c, qemud/remote_protocol.h, + qemud/remote_protocol.x, src/buf.c, src/libvirt.c, + src/nodeinfo.c, src/qemu_conf.c, src/qemu_driver.c, + src/stats_linux.c, src/storage_backend.c, src/storage_backend_fs.c, + src/storage_backend_iscsi.c, src/storage_backend_logical.c, + src/storage_conf.c, src/storage_driver.c, src/util.c, + src/util.h, src/virsh.c, src/virterror.c, src/xend_internal.c, + src/xml.c, tests/reconnect.c, tests/xmlrpctest.c, + tests/qparamtest.c: Standardize use of header files. + * docs/*, po/*: Rebuild docs. + Fri May 23 08:54:00 BST 2008 Richard W.M. Jones Fix type-punning warning in remote code. diff --git a/HACKING b/HACKING index e780ce7791..c4ec6ca036 100644 --- a/HACKING +++ b/HACKING @@ -158,3 +158,44 @@ eg typical usage is as follows: return virBufferContentAndReset(&buf); } + + +Include files +============= + +There are now quite a large number of include files, both libvirt +internal and external, and system includes. To manage all this +complexity it's best to stick to the following general plan for all +*.c source files: + + /* + * Copyright notice + * .... + * .... + * .... + * + */ + + #include Must come first in every file. + + #include Any system includes you need. + #include + #include + + #if HAVE_NUMACTL Some system includes aren't supported + #include everywhere so need these #if defences. + #endif + + #include "internal.h" Include this first, after system includes. + + #include "util.h" Any libvirt internal header files. + #include "buf.h" + + static myInternalFunc () The actual code. + { + ... + +Of particular note: *DO NOT* include libvirt/libvirt.h or +libvirt/virterror.h. It is included by "internal.h" already and there +are some special reasons why you cannot include these files +explicitly. \ No newline at end of file diff --git a/docs/FAQ.html b/docs/FAQ.html index f6858eada6..595a13f112 100644 --- a/docs/FAQ.html +++ b/docs/FAQ.html @@ -16,178 +16,209 @@

FAQ

Table of Contents:

- +

License(s)

-
  1. - Licensing Terms for libvirt -

    libvirt is released under the GNU Lesser +

      +
    1. + Licensing Terms for libvirt +

      libvirt is released under the GNU Lesser General Public License, see the file COPYING.LIB in the distribution for the precise wording. The only library that libvirt depends upon is the Xen store access library which is also licenced under the LGPL.

      -
    2. - Can I embed libvirt in a proprietary application ? -

      Yes. The LGPL allows you to embed libvirt into a proprietary +

    3. +
    4. + Can I embed libvirt in a proprietary application ? +

      Yes. The LGPL allows you to embed libvirt into a proprietary application. It would be graceful to send-back bug fixes and improvements as patches for possible incorporation in the main development tree. It will decrease your maintenance costs anyway if you do so.

      -
    +
  2. +

- Installation -

-
  1. Where can I get libvirt ? + Installation + +
      +
    1. Where can I get libvirt ?

      The original distribution comes from ftp://libvirt.org/libvirt/.

      -
    2. - I can't install the libvirt/libvirt-devel RPM packages due to +
    3. +
    4. + I can't install the libvirt/libvirt-devel RPM packages due to failed dependencies -

      The most generic solution is to re-fetch the latest src.rpm , and +

      The most generic solution is to re-fetch the latest src.rpm , and rebuild it locally with

      -

      rpm --rebuild libvirt-xxx.src.rpm.

      -

      If everything goes well it will generate two binary rpm packages (one +

      rpm --rebuild libvirt-xxx.src.rpm.

      +

      If everything goes well it will generate two binary rpm packages (one providing the shared libs and virsh, and the other one, the -devel package, providing includes, static libraries and scripts needed to build applications with libvirt that you can install locally.

      -

      One can also rebuild the RPMs from a tarball:

      -

      - rpmbuild -ta libdir-xxx.tar.gz -

      -

      Or from a configured tree with:

      -

      - make rpm -

      -
    5. - Failure to use the API for non-root users -

      Large parts of the API may only be accessible with root privileges, +

      One can also rebuild the RPMs from a tarball:

      +

      + rpmbuild -ta libdir-xxx.tar.gz +

      +

      Or from a configured tree with:

      +

      + make rpm +

      +
    6. +
    7. + Failure to use the API for non-root users +

      Large parts of the API may only be accessible with root privileges, however the read only access to the xenstore data doesnot have to be forbidden to user, at least for monitoring purposes. If "virsh dominfo" fails to run as an user, change the mode of the xenstore read-only socket with:

      -

      - chmod 666 /var/run/xenstored/socket_ro -

      -

      and also make sure that the Xen Daemon is running correctly with local +

      + chmod 666 /var/run/xenstored/socket_ro +

      +

      and also make sure that the Xen Daemon is running correctly with local HTTP server enabled, this is defined in /etc/xen/xend-config.sxp which need the following line to be enabled:

      -

      - (xend-http-server yes) -

      -

      If needed restart the xend daemon after making the change with the +

      + (xend-http-server yes) +

      +

      If needed restart the xend daemon after making the change with the following command run as root:

      -

      - service xend restart -

      -
    +

    + service xend restart +

    +
  2. +

- Compilation -

-
  1. - What is the process to compile libvirt ? -

    As most UNIX libraries libvirt follows the "standard":

    -

    - gunzip -c libvirt-xxx.tar.gz | tar xvf - -

    -

    - cd libvirt-xxxx -

    -

    - ./configure --help -

    -

    to see the options, then the compilation/installation proper

    -

    - ./configure [possible options] -

    -

    - make -

    -

    - make install -

    -

    At that point you may have to rerun ldconfig or a similar utility to + Compilation + +

      +
    1. + What is the process to compile libvirt ? +

      As most UNIX libraries libvirt follows the "standard":

      +

      + gunzip -c libvirt-xxx.tar.gz | tar xvf - +

      +

      + cd libvirt-xxxx +

      +

      + ./configure --help +

      +

      to see the options, then the compilation/installation proper

      +

      + ./configure [possible options] +

      +

      + make +

      +

      + make install +

      +

      At that point you may have to rerun ldconfig or a similar utility to update your list of installed shared libs.

      -
    2. - What other libraries are needed to compile/install libvirt ? -

      Libvirt requires libxenstore, which is usually provided by the xen +

    3. +
    4. + What other libraries are needed to compile/install libvirt ? +

      Libvirt requires libxenstore, which is usually provided by the xen packages as well as the public headers to compile against libxenstore.

      -
    5. - I use the CVS version and there is no configure script -

      The configure script (and other Makefiles) are generated. Use the +

    6. +
    7. + I use the CVS version and there is no configure script +

      The configure script (and other Makefiles) are generated. Use the autogen.sh script to regenerate the configure script and Makefiles, like:

      -

      - ./autogen.sh --prefix=/usr --disable-shared -

      -
    +

    + ./autogen.sh --prefix=/usr --disable-shared +

    +
  2. +

Developer corner

-
  1. - Troubles compiling or linking programs using libvirt -

    To simplify the process of reusing the library, libvirt comes with +

      +
    1. + Troubles compiling or linking programs using libvirt +

      To simplify the process of reusing the library, libvirt comes with pkgconfig support, which can be used directly from autoconf support or via the pkg-config command line tool, like:

      -

      - pkg-config libvirt --libs -

      -
    +

    + pkg-config libvirt --libs +

    +
  2. +