Skip to content

Commit

Permalink
* Makefile.am README TODO autogen.sh configure.in libvir.pc.in
Browse files Browse the repository at this point in the history
  libvir.spec.in docs/Makefile.am docs/apibuild.py docs/structures.fig
  include/Makefile.am include/libvir.h src/Makefile.am src/hash.c
  src/hash.h src/internal.h src/libvir.c src/libvir_sym.version
  src/virsh.c: renamed to libvir
Daniel
  • Loading branch information
veillard committed Dec 5, 2005
1 parent 79b4345 commit 1192a2a
Show file tree
Hide file tree
Showing 23 changed files with 358 additions and 350 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
@@ -1,3 +1,11 @@
Mon Dec 5 12:15:16 CET 2005 Daniel Veillard <veillard@redhat.com>

* Makefile.am README TODO autogen.sh configure.in libvir.pc.in
libvir.spec.in docs/Makefile.am docs/apibuild.py docs/structures.fig
include/Makefile.am include/libvir.h src/Makefile.am src/hash.c
src/hash.h src/internal.h src/libvir.c src/libvir_sym.version
src/virsh.c: renamed to libvir

Fri Dec 2 15:15:26 CET 2005 Daniel Veillard <veillard@redhat.com>

* include/libxen.h src/libxen.c src/libxen_sym.version: adding
Expand Down
6 changes: 3 additions & 3 deletions Makefile.am
@@ -1,12 +1,12 @@
## Process this file with automake to produce Makefile.in

SUBDIRS = src include docs
EXTRA_DIST = libxen.spec.in libxen.spec COPYING.LIB \
libxen.pc.in libxen.pc TODO AUTHORS ChangeLog \
EXTRA_DIST = libvir.spec.in libvir.spec COPYING.LIB \
libvir.pc.in libvir.pc TODO AUTHORS ChangeLog \
NEWS README

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libxen.pc
pkgconfig_DATA = libvir.pc

rpm: clean
@(unset CDPATH ; $(MAKE) dist && rpmbuild -ta $(distdir).tar.gz)
2 changes: 1 addition & 1 deletion README
@@ -1,5 +1,5 @@

LibXen : simple library to use the Xen hypervisor
LibVir : simple library to use the Xen hypervisor

As of Wed Nov 2 2005, this is a completely new project, it is not
usable in any way yet.
Expand Down
2 changes: 1 addition & 1 deletion TODO
Expand Up @@ -2,4 +2,4 @@

Done:
- make dist and make rpm targets
- set a no public by default policy for libxen symbols
- set a no public by default policy for libvir symbols
4 changes: 2 additions & 2 deletions autogen.sh
Expand Up @@ -36,7 +36,7 @@ if test "$DIE" -eq 1; then
exit 1
fi

test -f src/libxen.c || {
test -f src/libvir.c || {
echo "You must run this script in the top-level libxen directory"
exit 1
}
Expand All @@ -61,4 +61,4 @@ fi
$srcdir/configure "$@"

echo
echo "Now type 'make' to compile libxen."
echo "Now type 'make' to compile libvir."
8 changes: 4 additions & 4 deletions configure.in
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/libxen.c)
AC_INIT(src/libvir.c)
AM_CONFIG_HEADER(config.h)
AC_CANONICAL_HOST

Expand Down Expand Up @@ -31,7 +31,7 @@ AC_SUBST(LIBXEN_VERSION_EXTRA)

VERSION=${LIBXEN_VERSION}

AM_INIT_AUTOMAKE(libxen, $VERSION)
AM_INIT_AUTOMAKE(libvir, $VERSION)

dnl Checks for programs.
AC_PROG_CC
Expand All @@ -50,7 +50,7 @@ AM_PROG_LIBTOOL
dnl
dnl specific tests to setup DV devel environments with debug etc ...
dnl
if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/libxen" ]] ; then
if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/libvir" ]] ; then
if test "${GCC}" = "yes" ; then
CFLAGS="-g -O -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wall"
fi
Expand All @@ -64,4 +64,4 @@ dnl search for the low level Xen library
AC_SEARCH_LIBS(xc_domain_create, [xenctrl], [], [AC_MSG_ERROR([Xen control library not found])])
AC_SEARCH_LIBS(xs_read, [xenstore], [], [AC_MSG_ERROR([Xen store library not found])])

AC_OUTPUT(Makefile src/Makefile include/Makefile docs/Makefile libxen.pc libxen.spec)
AC_OUTPUT(Makefile src/Makefile include/Makefile docs/Makefile libvir.pc libvir.spec)
8 changes: 4 additions & 4 deletions docs/Makefile.am
Expand Up @@ -8,14 +8,14 @@ PAGES= # index.html
APIPAGES=APIconstructors.html APIfiles.html APIfunctions.html \
APIsymbols.html APIchunk0.html
EXTRA_DIST= \
libxen-api.xml apibuild.py
libvir-api.xml apibuild.py


man_MANS=

all: web $(man_MANS)

api: libxen-api.xml libxen-refs.xml
api: libvir-api.xml libvir-refs.xml

web: $(PAGES)

Expand Down Expand Up @@ -45,14 +45,14 @@ web: $(PAGES)
# echo "Validating the resulting XHTML pages" ; \
# $(XMLLINT) --nonet --valid --noout html/*.html ; fi );

libxen-api.xml libxen-refs.xml: apibuild.py ../include/*.h ../src/*.h ../src/*.c
libvir-api.xml libvir-refs.xml: apibuild.py ../include/*.h ../src/*.h ../src/*.c
-(./apibuild.py)

clean-local:
rm -f *~ *.bak *.hierarchy *.signals *-unused.txt

maintainer-clean-local: clean-local
rm -rf libxen-api.xml libxen-refs.xml
rm -rf libvir-api.xml libvir-refs.xml

rebuild: api all

Expand Down
14 changes: 7 additions & 7 deletions docs/apibuild.py
Expand Up @@ -18,7 +18,7 @@
# C parser analysis code
#
ignored_files = {
"xensh.c": "testing tool",
"virsh.c": "testing tool",
"hash.c": "internal hash table stuff",
"hash.h": "internal hash table stuff",
}
Expand Down Expand Up @@ -1068,7 +1068,7 @@ def parseBlock(self, token):
if self.collect_ref == 1:
oldtok = token
token = self.token()
if oldtok[0] == "name" and oldtok[1][0:3] == "xen":
if oldtok[0] == "name" and oldtok[1][0:3] == "vir":
if token[0] == "sep" and token[1] == "(":
self.index_add_ref(oldtok[1], self.filename,
0, "function")
Expand Down Expand Up @@ -2044,13 +2044,13 @@ def serialize(self):

def rebuild():
builder = None
if glob.glob("../src/libxen.c") != [] :
print "Rebuilding API description for libxen"
builder = docBuilder("libxen", ["../src", "../include"],
if glob.glob("../src/libvir.c") != [] :
print "Rebuilding API description for libvir"
builder = docBuilder("libvir", ["../src", "../include"],
[])
elif glob.glob("src/parser.c") != [] :
print "Rebuilding API description for libxml2"
builder = docBuilder("libxen", ["src", "include"],
print "Rebuilding API description for libvir"
builder = docBuilder("libvir", ["src", "include"],
[])
else:
print "rebuild() failed, unable to guess the module"
Expand Down
4 changes: 2 additions & 2 deletions docs/structures.fig
Expand Up @@ -59,8 +59,8 @@ Single
2250 4800 3900 4800
4 0 0 50 -1 0 18 0.0000 4 195 1005 1275 1125 Domains\001
4 0 0 50 -1 0 18 0.0000 4 195 585 1275 1440 hash \001
4 0 0 50 -1 0 18 0.0000 4 195 1650 4725 750 xenDomainPtr\001
4 0 0 50 -1 0 18 0.0000 4 195 2055 975 5700 xenConnectionPtr\001
4 0 0 50 -1 0 18 0.0000 4 195 1650 4725 750 virDomainPtr\001
4 0 0 50 -1 0 18 0.0000 4 195 2055 975 5700 virConnectionPtr\001
4 0 0 50 -1 0 18 0.0000 4 195 945 900 4200 domains\001
4 0 0 50 -1 0 18 0.0000 4 135 555 3450 2475 conn\001
4 0 0 50 -1 0 18 0.0000 4 135 615 6075 1050 name\001
Expand Down
6 changes: 3 additions & 3 deletions include/Makefile.am
@@ -1,9 +1,9 @@
## Process this file with automake to produce Makefile.in

xenincdir = $(includedir)/libxen
virincdir = $(includedir)/libvir

xeninc_HEADERS = libxen.h
virinc_HEADERS = libvir.h

install-exec-hook:
$(mkinstalldirs) $(DESTDIR)$(xenincdir)
$(mkinstalldirs) $(DESTDIR)$(virincdir)

109 changes: 109 additions & 0 deletions include/libvir.h
@@ -0,0 +1,109 @@
/*
* libvir.h: interface for the libvir library to handle Xen domains
* from a process running in domain 0
*
* Copyright (C) 2005 Red Hat, Inc.
*
* See COPYING.LIB for the License of this software
*
* Daniel Veillard <veillard@redhat.com>
*/

#ifndef __VIR_VIRLIB_H__
#define __VIR_VIRLIB_H__

#ifdef __cplusplus
extern "C" {
#endif

/**
* virConnect:
*
* a virConnect is a private structure representing a connection to
* the Xen Hypervisor.
*/
typedef struct _virConnect virConnect;

/**
* virConnectPtr:
*
* a virConnectPtr is pointer to a virConnect private structure, this is the
* type used to reference a connection to the Xen Hypervisor in the API.
*/
typedef virConnect *virConnectPtr;

/**
* virDomain:
*
* a virDomain is a private structure representing a Xen domain.
*/
typedef struct _virDomain virDomain;

/**
* virDomainPtr:
*
* a virDomainPtr is pointer to a virDomain private structure, this is the
* type used to reference a Xen domain in the API.
*/
typedef virDomain *virDomainPtr;

/**
* virDomainFlags:
*
* Flags OR'ed together to provide specific behaviour when creating a
* Domain.
*/
typedef enum {
VIR_DOMAIN_NONE = 0
} virDomainFlags;

/*
* Connection and disconnections to the Hypervisor
*/
virConnectPtr virConnectOpen (const char *name);
virConnectPtr virConnectOpenReadOnly (const char *name);
int virConnectClose (virConnectPtr conn);
unsigned long virConnectGetVersion (virConnectPtr conn);

/*
* Gather list of running domains
*/
int virConnectListDomains (virConnectPtr conn,
int *ids,
int maxids);

/*
* Domain creation and destruction
*/
virDomainPtr virDomainCreateLinux (virConnectPtr conn,
const char *kernel_path,
const char *initrd_path,
const char *cmdline,
unsigned long memory,
unsigned int flags);
virDomainPtr virDomainLookupByName (virConnectPtr conn,
const char *name);
virDomainPtr virDomainLookupByID (virConnectPtr conn,
int id);
int virDomainDestroy (virDomainPtr domain);

/*
* Domain suspend/resume
*/
int virDomainSuspend (virDomainPtr domain);
int virDomainResume (virDomainPtr domain);

/*
* Dynamic control of domains
*/
const char * virDomainGetName (virDomainPtr domain);
unsigned int virDomainGetID (virDomainPtr domain);
unsigned long virDomainGetMaxMemory (virDomainPtr domain);
int virDomainSetMaxMemory (virDomainPtr domain,
unsigned long memory);

#ifdef __cplusplus
}
#endif

#endif /* __VIR_VIRLIB_H__ */
6 changes: 3 additions & 3 deletions include/libvirt/Makefile.am
@@ -1,9 +1,9 @@
## Process this file with automake to produce Makefile.in

xenincdir = $(includedir)/libxen
virincdir = $(includedir)/libvir

xeninc_HEADERS = libxen.h
virinc_HEADERS = libvir.h

install-exec-hook:
$(mkinstalldirs) $(DESTDIR)$(xenincdir)
$(mkinstalldirs) $(DESTDIR)$(virincdir)

0 comments on commit 1192a2a

Please sign in to comment.