From 567b42ce6a07828c0ca4705e629bc9fa937bf48c Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Mon, 3 Jul 2006 15:48:49 +0000 Subject: [PATCH] * NEWS docs/* configure.in libvirt.spec.in include/libvirt/libvirt.h: preparing release of 0.1.2 * src/proxy_internal.c: don't warn on open if using http and not the proxy. Daniel --- ChangeLog | 7 +++++++ NEWS | 7 +++++++ configure.in | 2 +- docs/libvir.html | 5 +++++ docs/news.html | 4 +++- include/libvirt/libvirt.h | 2 +- libvirt.spec.in | 4 ++++ src/proxy_internal.c | 39 +++++++++++++++++++++------------------ 8 files changed, 49 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index a7987d851c..dea5e32c3a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Mon Jul 3 15:41:58 EDT 2006 Daniel Veillard + + * NEWS docs/* configure.in libvirt.spec.in include/libvirt/libvirt.h: + preparing release of 0.1.2 + * src/proxy_internal.c: don't warn on open if using http and not the + proxy. + Mon Jul 3 13:54:03 EDT 2006 Daniel Veillard * libvirt.spec.in proxy/Makefile.am src/proxy_internal.c diff --git a/NEWS b/NEWS index 8ba8e3786d..bb26f8caaa 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,13 @@ http://libvirt.org/news.html Releases +0.1.2: Jul 3 2006: + - headers include paths fixup + + - proxy mechanism for unpriviledged read-only access by httpu + + + 0.1.1: Jun 21 2006: - building fixes: ncurses fallback (Jim Fehlig), VPATH builds (Daniel P. Berrange) diff --git a/configure.in b/configure.in index 57ae0d949a..ba28df135b 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ AC_CANONICAL_HOST LIBVIRT_MAJOR_VERSION=0 LIBVIRT_MINOR_VERSION=1 -LIBVIRT_MICRO_VERSION=1 +LIBVIRT_MICRO_VERSION=2 LIBVIRT_MICRO_VERSION_SUFFIX= LIBVIRT_VERSION=$LIBVIRT_MAJOR_VERSION.$LIBVIRT_MINOR_VERSION.$LIBVIRT_MICRO_VERSION$LIBVIRT_MICRO_VERSION_SUFFIX LIBVIRT_VERSION_INFO=`expr $LIBVIRT_MAJOR_VERSION + $LIBVIRT_MINOR_VERSION`:$LIBVIRT_MICRO_VERSION:$LIBVIRT_MINOR_VERSION diff --git a/docs/libvir.html b/docs/libvir.html index c26c39187d..2f64c86208 100644 --- a/docs/libvir.html +++ b/docs/libvir.html @@ -33,6 +33,11 @@ development of libvirt, it is preferable when possible to just use the CVS version or snapshot, contact the mailing list and check the ChangeLog to gauge progresses.

+

0.1.2: Jul 3 2006

+
    +
  • headers include paths fixup +
  • proxy mechanism for unpriviledged read-only access by httpu +

0.1.1: Jun 21 2006

  • building fixes: ncurses fallback (Jim Fehlig), VPATH builds (Daniel P. diff --git a/docs/news.html b/docs/news.html index dc27c01b06..ceffbdae61 100644 --- a/docs/news.html +++ b/docs/news.html @@ -2,7 +2,9 @@ Releases

    Releases

    Here is the list of official releases, however since it is early on in the development of libvirt, it is preferable when possible to just use the CVS version or snapshot, contact the mailing list -and check the ChangeLog to gauge progresses.

    0.1.1: Jun 21 2006

    • building fixes: ncurses fallback (Jim Fehlig), VPATH builds (Daniel P. +and check the ChangeLog to gauge progresses.

      0.1.2: Jul 3 2006

      • headers include paths fixup +
      • proxy mechanism for unpriviledged read-only access by httpu +

      0.1.1: Jun 21 2006

      • building fixes: ncurses fallback (Jim Fehlig), VPATH builds (Daniel P. Berrange)
      • driver cleanups: new entry points, cleanup of libvirt.c (with Daniel P. Berrange) diff --git a/include/libvirt/libvirt.h b/include/libvirt/libvirt.h index ecd3efe76d..627f3b419f 100644 --- a/include/libvirt/libvirt.h +++ b/include/libvirt/libvirt.h @@ -184,7 +184,7 @@ typedef virNodeInfo *virNodeInfoPtr; * version * 1,000,000 + minor * 1000 + micro */ -#define LIBVIR_VERSION_NUMBER 1001 +#define LIBVIR_VERSION_NUMBER 1002 int virGetVersion (unsigned long *libVer, const char *type, diff --git a/libvirt.spec.in b/libvirt.spec.in index 7ec8d2b5f8..3ccadc7bc8 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -104,6 +104,10 @@ rm -fr %{buildroot} %doc docs/examples/python %changelog +* Mon Jul 3 2006 Daniel Veillard 0.1.2-1 +- added a proxy mechanism for read only access using httpu +- fixed header includes paths + * Wed Jun 21 2006 Daniel Veillard 0.1.1-1 - extend and cleanup the driver infrastructure and code - python examples diff --git a/src/proxy_internal.c b/src/proxy_internal.c index e588f1e720..5f1037afea 100644 --- a/src/proxy_internal.c +++ b/src/proxy_internal.c @@ -106,7 +106,7 @@ virProxyError(virConnectPtr conn, virErrorNumber error, const char *info) return; errmsg = __virErrorMsg(error, info); - __virRaiseError(conn, NULL, VIR_FROM_XEND, error, VIR_ERR_ERROR, + __virRaiseError(conn, NULL, VIR_FROM_PROXY, error, VIR_ERR_ERROR, errmsg, info, NULL, 0, 0, errmsg, info); } @@ -285,13 +285,14 @@ virProxyCloseClientSocket(int fd) { * @fd: the socket * @buffer: the target memory area * @len: the lenght in bytes + * @quiet: quiet access * * Process a read from a client socket * * Returns the number of byte read or -1 in case of error. */ static int -virProxyReadClientSocket(int fd, char *buffer, int len) { +virProxyReadClientSocket(int fd, char *buffer, int len, int quiet) { int ret; if ((fd < 0) || (buffer == NULL) || (len < 0)) @@ -305,7 +306,8 @@ retry: fprintf(stderr, "read socket %d interrupted\n", fd); goto retry; } - fprintf(stderr, "Failed to read socket %d\n", fd); + if (!quiet) + fprintf(stderr, "Failed to read socket %d\n", fd); return(-1); } @@ -372,7 +374,7 @@ xenProxyClose(virConnectPtr conn) { static int xenProxyCommand(virConnectPtr conn, virProxyPacketPtr request, - virProxyFullPacketPtr answer) { + virProxyFullPacketPtr answer, int quiet) { static int serial = 0; int ret; virProxyPacketPtr res = NULL; @@ -396,7 +398,7 @@ retry: if (answer == NULL) { /* read in situ */ ret = virProxyReadClientSocket(conn->proxy, (char *) request, - sizeof(virProxyPacket)); + sizeof(virProxyPacket), quiet); if (ret < 0) return(-1); if (ret != sizeof(virProxyPacket)) { @@ -417,7 +419,7 @@ retry: } else { /* read in packet provided */ ret = virProxyReadClientSocket(conn->proxy, (char *) answer, - sizeof(virProxyPacket)); + sizeof(virProxyPacket), quiet); if (ret < 0) return(-1); if (ret != sizeof(virProxyPacket)) { @@ -439,7 +441,7 @@ retry: if (res->len > sizeof(virProxyPacket)) { ret = virProxyReadClientSocket(conn->proxy, (char *) &(answer->extra.arg[0]), - res->len - ret); + res->len - ret, quiet); if (ret != (int) (res->len - sizeof(virProxyPacket))) { fprintf(stderr, "Communication error with proxy: got %d bytes of %d\n", @@ -502,9 +504,10 @@ xenProxyOpen(virConnectPtr conn, const char *name, int flags) memset(&req, 0, sizeof(req)); req.command = VIR_PROXY_NONE; req.len = sizeof(req); - ret = xenProxyCommand(conn, &req, NULL); + ret = xenProxyCommand(conn, &req, NULL, 1); if ((ret < 0) || (req.command != VIR_PROXY_NONE)) { - virProxyError(conn, VIR_ERR_OPERATION_FAILED, __FUNCTION__); + if (!(flags & VIR_DRV_OPEN_QUIET)) + virProxyError(conn, VIR_ERR_OPERATION_FAILED, __FUNCTION__); xenProxyClose(conn); return(-1); } @@ -545,7 +548,7 @@ xenProxyGetVersion(virConnectPtr conn, unsigned long *hvVer) memset(&req, 0, sizeof(req)); req.command = VIR_PROXY_VERSION; req.len = sizeof(req); - ret = xenProxyCommand(conn, &req, NULL); + ret = xenProxyCommand(conn, &req, NULL, 0); if (ret < 0) { xenProxyClose(conn); return(-1); @@ -583,7 +586,7 @@ xenProxyListDomains(virConnectPtr conn, int *ids, int maxids) memset(&req, 0, sizeof(req)); req.command = VIR_PROXY_LIST; req.len = sizeof(req); - ret = xenProxyCommand(conn, &req, &ans); + ret = xenProxyCommand(conn, &req, &ans, 0); if (ret < 0) { xenProxyClose(conn); return(-1); @@ -623,7 +626,7 @@ xenProxyNumOfDomains(virConnectPtr conn) memset(&req, 0, sizeof(req)); req.command = VIR_PROXY_NUM_DOMAIN; req.len = sizeof(req); - ret = xenProxyCommand(conn, &req, NULL); + ret = xenProxyCommand(conn, &req, NULL, 0); if (ret < 0) { xenProxyClose(conn); return(-1); @@ -655,7 +658,7 @@ xenProxyDomainGetDomMaxMemory(virConnectPtr conn, int id) req.command = VIR_PROXY_MAX_MEMORY; req.data.arg = id; req.len = sizeof(req); - ret = xenProxyCommand(conn, &req, NULL); + ret = xenProxyCommand(conn, &req, NULL, 0); if (ret < 0) { xenProxyClose(conn); return(-1); @@ -716,7 +719,7 @@ xenProxyDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info) req.command = VIR_PROXY_DOMAIN_INFO; req.data.arg = domain->handle; req.len = sizeof(req); - ret = xenProxyCommand(domain->conn, &req, &ans); + ret = xenProxyCommand(domain->conn, &req, &ans, 0); if (ret < 0) { xenProxyClose(domain->conn); return(-1); @@ -761,7 +764,7 @@ xenProxyLookupByID(virConnectPtr conn, int id) req.command = VIR_PROXY_LOOKUP_ID; req.data.arg = id; req.len = sizeof(req); - ret = xenProxyCommand(conn, &req, &ans); + ret = xenProxyCommand(conn, &req, &ans, 0); if (ret < 0) { xenProxyClose(conn); return(NULL); @@ -809,7 +812,7 @@ xenProxyLookupByUUID(virConnectPtr conn, const unsigned char *uuid) memset(&req, 0, sizeof(virProxyPacket)); req.command = VIR_PROXY_LOOKUP_UUID; req.len = sizeof(virProxyPacket) + 16; - ret = xenProxyCommand(conn, (virProxyPacketPtr) &req, &req); + ret = xenProxyCommand(conn, (virProxyPacketPtr) &req, &req, 0); if (ret < 0) { xenProxyClose(conn); return(NULL); @@ -861,7 +864,7 @@ xenProxyDomainLookupByName(virConnectPtr conn, const char *name) req.command = VIR_PROXY_LOOKUP_NAME; req.len = sizeof(virProxyPacket) + len + 1; strcpy(&req.extra.str[0], name); - ret = xenProxyCommand(conn, (virProxyPacketPtr) &req, &req); + ret = xenProxyCommand(conn, (virProxyPacketPtr) &req, &req, 0); if (ret < 0) { xenProxyClose(conn); return(NULL); @@ -906,7 +909,7 @@ xenProxyNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info) { req.command = VIR_PROXY_NODE_INFO; req.data.arg = 0; req.len = sizeof(req); - ret = xenProxyCommand(conn, &req, &ans); + ret = xenProxyCommand(conn, &req, &ans, 0); if (ret < 0) { xenProxyClose(conn); return(-1);