[libvirt] CfP with Extended Deadline 5th Workshop on Virtualization in High-Performance Cloud Computing (VHPC'10)
by Michael Alexander
Apologies if you received multiple copies of this message.
=================================================================
CALL FOR PAPERS
5th Workshop on
Virtualization in High-Performance Cloud Computing
VHPC'10
as part of Euro-Par 2010, Island of Ischia-Naples, Italy
=================================================================
Date: August 31, 2010
Euro-Par 2009: http://www.europar2010.org/
Workshop URL: http://vhpc.org
SUBMISSION DEADLINE:
Abstracts: April 4, 2010 (extended)
Full Paper: June 19, 2010 (extended)
Scope:
Virtualization has become a common abstraction layer in modern data
centers, enabling resource owners to manage complex infrastructure
independently of their applications. Conjointly virtualization is
becoming a driving technology for a manifold of industry grade IT
services. Piloted by the Amazon Elastic Computing Cloud services, the
cloud concept includes the notion of a separation between resource
owners and users, adding services such as hosted application
frameworks and queuing. Utilizing the same infrastructure, clouds
carry significant potential for use in high-performance scientific
computing. The ability of clouds to provide for requests and releases
of vast computing resource dynamically and close to the marginal cost
of providing the services is unprecedented in the history of
scientific and commercial computing.
Distributed computing concepts that leverage federated resource access
are popular within the grid community, but have not seen previously
desired deployed levels so far. Also, many of the scientific
datacenters have not adopted virtualization or cloud concepts yet.
This workshop aims to bring together industrial providers with the
scientific community in order to foster discussion, collaboration and
mutual exchange of knowledge and experience.
The workshop will be one day in length, composed of 20 min paper
presentations, each followed by 10 min discussion sections.
Presentations may be accompanied by interactive demonstrations. It
concludes with a 30 min panel discussion by presenters.
TOPICS
Topics include, but are not limited to, the following subjects:
- Virtualization in cloud, cluster and grid HPC environments
- VM cloud, cluster load distribution algorithms
- Cloud, cluster and grid filesystems
- QoS and and service level guarantees
- Cloud programming models, APIs and databases
- Software as a service (SaaS)
- Cloud provisioning
- Virtualized I/O
- VMMs and storage virtualization
- MPI, PVM on virtual machines
- High-performance network virtualization
- High-speed interconnects
- Hypervisor extensions
- Tools for cluster and grid computing
- Xen/other VMM cloud/cluster/grid tools
- Raw device access from VMs
- Cloud reliability, fault-tolerance, and security
- Cloud load balancing
- VMs - power efficiency
- Network architectures for VM-based environments
- VMMs/Hypervisors
- Hardware support for virtualization
- Fault tolerant VM environments
- Workload characterizations for VM-based environments
- Bottleneck management
- Metering
- VM-based cloud performance modeling
- Cloud security, access control and data integrity
- Performance management and tuning hosts and guest VMs
- VMM performance tuning on various load types
- Research and education use cases
- Cloud use cases
- Management of VM environments and clouds
- Deployment of VM-based environments
PAPER SUBMISSION
Papers submitted to the workshop will be reviewed by at least two
members of the program committee and external reviewers. Submissions
should include abstract, key words, the e-mail address of the
corresponding author, and must not exceed 10 pages, including tables
and figures at a main font size no smaller than 11 point. Submission
of a paper should be regarded as a commitment that, should the paper
be accepted, at least one of the authors will register and attend the
conference to present the work.
Accepted papers will be published in the Springer LNCS series - the
format must be according to the Springer LNCS Style. Initial
submissions are in PDF, accepted papers will be requested to provided
source files.
Format Guidelines: http://www.springer.de/comp/lncs/authors.html
Submission Link: http://edas.info/newPaper.php?c=8553
IMPORTANT DATES
April 4 - Abstract submission due (extended)
May 19 - Full paper submission (extended)
July 14 - Acceptance notification
August 3 - Camera-ready version due
August 31 - September 3 - conference
CHAIR
Michael Alexander (chair), scaledinfra technologies GmbH, Austria
Gianluigi Zanetti (co-chair), CRS4, Italy
PROGRAM COMMITTEE
Padmashree Apparao, Intel Corp., USA
Volker Buege, University of Karlsruhe, Germany
Roberto Canonico, University of Napoli Federico II, Italy
Tommaso Cucinotta, Scuola Superiore Sant'Anna, Italy
Werner Fischer, Thomas Krenn AG, Germany
William Gardner, University of Guelph, Canada
Wolfgang Gentzsch, DEISA. Max Planck Gesellschaft, Germany
Derek Groen, UVA, The Netherlands
Marcus Hardt, Forschungszentrum Karlsruhe, Germany
Sverre Jarp, CERN, Switzerland
Shantenu Jha, Louisiana State University, USA
Xuxian Jiang, NC State, USA
Kenji Kaneda, Google, Japan
Yves Kemp, DESY Hamburg, Germany
Ignacio Llorente, Universidad Complutense de Madrid, Spain
Naoya Maruyama, Tokyo Institute of Technology, Japan
Jean-Marc Menaud, Ecole des Mines de Nantes, France
Anastassios Nano, National Technical University of Athens, Greece
Oliver Oberst, Karlsruhe Institute of Technology, Germany
Jose Renato Santos, HP Labs, USA
Borja Sotomayor, University of Chicago, USA
Yoshio Turner, HP Labs, USA
Kurt Tuschku, University of Vienna, Austria
Lizhe Wang, Indiana University, USA
Chao-Tung Yang, Tunghai University, Taiwan
DURATION: Workshop Duration is one day.
GENERAL INFORMATION
The workshop will be held as part of Euro-Par 2010,
Island of Ischia-Naples, Italy.
Euro-Par 2010: http://www.europar2010.org/
14 years, 7 months
[libvirt] ESX snapshot deletion
by Chris Lalancette
Hey Mattias,
I'm currently working on the semantics of
virDomainSnapshotDelete(), which has been renamed from
the earlier virDomainSnapshotDeactivate(). In qemu/kvm,
it seems like it is possible to delete a snapshot at any
time, even while that snapshot is running (though I'm not
yet sure exactly what happens in that case). Talking
to Jirka, it seems like the virtualbox GUI doesn't allow you to
do any operations at all on snapshots while a domain is running,
although we don't know yet if this is a restriction in the
API as well.
My questions for you are about how ESX handles this situation:
1) Can you manipulate a domain's snapshots while that domain is
running?
2) If so, can you delete the snapshot that is currently running?
If so, what happens?
--
Chris Lalancette
14 years, 7 months
[libvirt] [PATCH 1/2] build: update gnulib
by Eric Blake
Picks up fixes for gethostname compilation problems on mingw.
* .gnulib: Update to latest.
* build-aux/.gitignore: Regenerate.
* cfg.mk (local-checks-to-skip): Avoid new test not relevent to
libvirt.
---
This replaces
https://www.redhat.com/archives/libvir-list/2010-March/msg00915.html,
and should fix the issues Matthias was seeing with compiling gnulib
on mingw.
.gnulib | 2 +-
build-aux/.gitignore | 1 +
cfg.mk | 1 +
3 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/.gnulib b/.gnulib
index 10d66ae..4f01268 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit 10d66aedfdd610f731c8c54152b9dfca3efbee12
+Subproject commit 4f01268d0c584c20704e42527f4fa125e7525aae
diff --git a/build-aux/.gitignore b/build-aux/.gitignore
index 29b1e03..8717628 100644
--- a/build-aux/.gitignore
+++ b/build-aux/.gitignore
@@ -6,6 +6,7 @@
/useless-if-before-free
/vc-list-files
arg-nonnull.h
+c++defs.h
config.rpath
gitlog-to-changelog
mkinstalldirs
diff --git a/cfg.mk b/cfg.mk
index 27cfca4..0c41ae5 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -51,6 +51,7 @@ local-checks-to-skip = \
sc_space_tab \
sc_sun_os_names \
sc_system_h_headers \
+ sc_texinfo_acronym \
sc_tight_scope \
sc_two_space_separator_in_usage \
sc_error_message_uppercase \
--
1.6.6.1
14 years, 7 months
[libvirt] [PATCH] maint: show which compiler warning triggered
by Eric Blake
* acinclude.m4 (LIBVIRT_COMPILE_WARNINGS): Add
-fdiagnostics-show-option.
---
Here's an example of how things change, when using './configure
--enable-compiler-warnings=error' and introducing something gcc
would warn about:
CC libvirt_driver_nwfilter_la-nwfilter_ebiptables_driver.lo
cc1: warnings being treated as errors
nwfilter/nwfilter_ebiptables_driver.c: In function '_iptablesCreateRuleInstance':
nwfilter/nwfilter_ebiptables_driver.c:1059: error: unused variable 'oops' [-Wunused-variable]
acinclude.m4 | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/acinclude.m4 b/acinclude.m4
index f00933f..7fa2d67 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -13,13 +13,17 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
dnl ******************************
AC_ARG_ENABLE(compile-warnings,
- AC_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
- [Turn on compiler warnings]),,
+ [AC_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
+ [Turn on compiler warnings])],,
[enable_compile_warnings="m4_default([$1],[maximum])"])
warnCFLAGS=
- common_flags="-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fasynchronous-unwind-tables"
+ common_flags=
+ common_flags="$common_flags -Wp,-D_FORTIFY_SOURCE=2"
+ common_flags="$common_flags -fexceptions"
+ common_flags="$common_flags -fasynchronous-unwind-tables"
+ common_flags="$common_flags -fdiagnostics-show-option"
case "$enable_compile_warnings" in
no)
--
1.6.6.1
14 years, 7 months
[libvirt] [PATCH] Add dummy nwfilter driver to test driver
by Stefan Berger
This patch adds a dummy nwfilter driver to the test driver so that the
int-overflow test passes without modifications.
Signed-off-by: Stefan Berger <Stefanb(a)us.ibm.com>
Index: libvirt/src/test/test_driver.c
===================================================================
--- libvirt.orig/src/test/test_driver.c
+++ libvirt/src/test/test_driver.c
@@ -5205,6 +5205,22 @@ static int testSecretClose(virConnectPtr
return 0;
}
+
+static virDrvOpenStatus testNWFilterOpen(virConnectPtr conn,
+ virConnectAuthPtr auth ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED) {
+ if (STRNEQ(conn->driver->name, "Test"))
+ return VIR_DRV_OPEN_DECLINED;
+
+ conn->secretPrivateData = conn->privateData;
+ return VIR_DRV_OPEN_SUCCESS;
+}
+
+static int testNWFilterClose(virConnectPtr conn) {
+ conn->nwfilterPrivateData = NULL;
+ return 0;
+}
+
static virDriver testDriver = {
VIR_DRV_TEST,
"Test",
@@ -5398,6 +5414,12 @@ static virSecretDriver testSecretDriver
};
+static virNWFilterDriver testNWFilterDriver = {
+ .name = "Test",
+ .open = testNWFilterOpen,
+ .close = testNWFilterClose,
+};
+
/**
* testRegister:
*
@@ -5418,6 +5440,8 @@ testRegister(void)
return -1;
if (virRegisterSecretDriver(&testSecretDriver) < 0)
return -1;
+ if (virRegisterNWFilterDriver(&testNWFilterDriver) < 0)
+ return -1;
return 0;
}
14 years, 7 months
[libvirt] [PATCH] Use libvirt's existing ipv6/ipv4 parser/printer rather than self-written ones
by Stefan Berger
This patch changes the network filtering code to use libvirt's existing
IPv4 and IPv6 address parsers/printers rather than my self-written ones.
I am introducing a new function in network.c that counts the number of
bits in a netmask and ensures that the given address is indeed a
netmask, return -1 on error or values of 0-32 for IPv4 addresses and
0-128 for IPv6 addresses. I then based the function checking for valid
netmask on invoking this function.
Signed-off-by: Stefan Berger <stefanb(a)us.ibm.com>
---
src/conf/nwfilter_conf.c | 181 ++----------------------------
src/conf/nwfilter_conf.h | 8 -
src/nwfilter/nwfilter_ebiptables_driver.c | 46 ++++---
src/util/network.c | 173 +++++++++++++++-------------
src/util/network.h | 3
5 files changed, 142 insertions(+), 269 deletions(-)
Index: libvirt-acl/src/conf/nwfilter_conf.h
===================================================================
--- libvirt-acl.orig/src/conf/nwfilter_conf.h
+++ libvirt-acl/src/conf/nwfilter_conf.h
@@ -33,6 +33,8 @@
# include "util.h"
# include "hash.h"
# include "xml.h"
+# include "network.h"
+
/**
* Chain suffix size is:
@@ -85,11 +87,7 @@ struct _nwMACAddress {
typedef struct _nwIPAddress nwIPAddress;
typedef nwIPAddress *nwIPAddressPtr;
struct _nwIPAddress {
- int isIPv6;
- union {
- unsigned char ipv4Addr[4];
- unsigned char ipv6Addr[16];
- } addr;
+ virSocketAddr addr;
};
Index: libvirt-acl/src/util/network.c
===================================================================
--- libvirt-acl.orig/src/util/network.c
+++ libvirt-acl/src/util/network.c
@@ -219,88 +219,10 @@ virSocketGetPort(virSocketAddrPtr addr)
* Returns 0 in case of success and -1 in case of error
*/
int virSocketAddrIsNetmask(virSocketAddrPtr netmask) {
- int i;
-
- if (netmask == NULL)
- return(-1);
-
- if (netmask->stor.ss_family == AF_INET) {
- virIPv4Addr tm;
- unsigned char tmp;
- int ok = 0;
-
- if (getIPv4Addr(netmask, &tm) < 0)
- return(-1);
-
- for (i = 0;i < 4;i++) {
- if (tm[i] != 0)
- break;
- }
-
- if (i >= 4)
- return(0);
-
- tmp = 0xFF;
- do {
- if (tm[i] == tmp) {
- ok = 1;
- break;
- }
- tmp <<= 1;
- } while (tmp != 0);
- if (ok == 0)
- return(-1);
- i++;
-
- if (i >= 4)
- return(0);
-
- for (;i < 4;i++) {
- if (tm[i] != 0xFF)
- return(-1);
- }
- } else if (netmask->stor.ss_family == AF_INET6) {
- virIPv6Addr tm;
- unsigned short tmp;
- int ok = 0;
-
- /*
- * Hum, on IPv6 people use prefixes instead of netmask
- */
- if (getIPv6Addr(netmask, &tm) < 0)
- return(-1);
-
- for (i = 0;i < 8;i++) {
- if (tm[i] != 0)
- break;
- }
-
- if (i >= 8)
- return(0);
-
- tmp = 0xFFFF;
- do {
- if (tm[i] == tmp) {
- ok = 1;
- break;
- }
- tmp <<= 1;
- } while (tmp != 0);
- if (ok == 0)
- return(-1);
- i++;
-
- if (i >= 8)
- return(0);
-
- for (;i < 8;i++) {
- if (tm[i] != 0xFFFF)
- return(-1);
- }
- } else {
- return(-1);
- }
- return(0);
+ int n = virSocketGetNumNetmaskBits(netmask);
+ if (n < 0)
+ return -1;
+ return 0;
}
/**
@@ -415,3 +337,90 @@ int virSocketGetRange(virSocketAddrPtr s
}
return(ret);
}
+
+
+/**
+ * virGetNumNetmaskBits
+ * @netmask: the presumed netmask
+ *
+ * Get the number of netmask bits in a netmask.
+ *
+ * Returns the number of bits in the netmask or -1 if an error occurred
+ * or the netmask is invalid.
+ */
+int virSocketGetNumNetmaskBits(const virSocketAddrPtr netmask)
+{
+ int i, j;
+ int c = 0;
+
+ if (netmask->stor.ss_family == AF_INET) {
+ virIPv4Addr tm;
+ uint8_t bit;
+
+ if (getIPv4Addr(netmask, &tm) < 0)
+ return -1;
+
+ for (i = 0; i < 4; i++)
+ if (tm[i] == 0xff)
+ c += 8;
+ else
+ break;
+
+ if (c == 8 * 4)
+ return c;
+
+ j = i << 3;
+ while (j < (8 * 4)) {
+ bit = 1 << (7 - (j & 7));
+ if ((tm[j >> 3] & bit)) {
+ c++;
+ } else
+ break;
+ j++;
+ }
+
+ while (j < (8 * 4)) {
+ bit = 1 << (7 - (j & 7));
+ if ((tm[j >> 3] & bit))
+ return -1;
+ j++;
+ }
+
+ return c;
+ } else if (netmask->stor.ss_family == AF_INET6) {
+ virIPv6Addr tm;
+ uint16_t bit;
+
+ if (getIPv6Addr(netmask, &tm) < 0)
+ return -1;
+
+ for (i = 0; i < 8; i++)
+ if (tm[i] == 0xffff)
+ c += 16;
+ else
+ break;
+
+ if (c == 16 * 8)
+ return c;
+
+ j = i << 4;
+ while (j < (16 * 8)) {
+ bit = 1 << (15 - (j & 0xf));
+ if ((tm[j >> 4] & bit)) {
+ c++;
+ } else
+ break;
+ j++;
+ }
+
+ while (j < (16 * 8)) {
+ bit = 1 << (15 - (j & 0xf));
+ if ((tm[j >> 4]) & bit)
+ return -1;
+ j++;
+ }
+
+ return c;
+ }
+ return -1;
+}
Index: libvirt-acl/src/util/network.h
===================================================================
--- libvirt-acl.orig/src/util/network.h
+++ libvirt-acl/src/util/network.h
@@ -48,4 +48,7 @@ int virSocketAddrIsNetmask(virSocketAddr
int virSocketCheckNetmask (virSocketAddrPtr addr1,
virSocketAddrPtr addr2,
virSocketAddrPtr netmask);
+
+int virSocketGetNumNetmaskBits(const virSocketAddrPtr netmask);
+
#endif /* __VIR_NETWORK_H__ */
Index: libvirt-acl/src/conf/nwfilter_conf.c
===================================================================
--- libvirt-acl.orig/src/conf/nwfilter_conf.c
+++ libvirt-acl/src/conf/nwfilter_conf.c
@@ -473,22 +473,6 @@ checkValidMask(unsigned char *data, int
}
-/* check for a valid IPv4 mask */
-static bool
-checkIPv4Mask(enum attrDatatype datatype ATTRIBUTE_UNUSED, void *maskptr,
- virNWFilterRuleDefPtr nwf ATTRIBUTE_UNUSED)
-{
- return checkValidMask(maskptr, 4);
-}
-
-static bool
-checkIPv6Mask(enum attrDatatype datatype ATTRIBUTE_UNUSED, void *maskptr,
- virNWFilterRuleDefPtr nwf ATTRIBUTE_UNUSED)
-{
- return checkValidMask(maskptr, 16);
-}
-
-
static bool
checkMACMask(enum attrDatatype datatype ATTRIBUTE_UNUSED,
void *macMask,
@@ -498,16 +482,6 @@ checkMACMask(enum attrDatatype datatype
}
-static int getMaskNumBits(const unsigned char *mask, int len) {
- int i = 0;
- while (i < (len << 3)) {
- if (!(mask[i>>3] & (0x80 >> (i & 3))))
- break;
- i++;
- }
- return i;
-}
-
/*
* supported arp opcode -- see 'ebtables -h arp' for the naming
*/
@@ -1227,21 +1201,8 @@ static bool
virNWIPv4AddressParser(const char *input,
nwIPAddressPtr output)
{
- int i;
- char *endptr;
- const char *n = input;
- long int d;
-
- for (i = 0; i < 4; i++) {
- d = strtol(n, &endptr, 10);
- if (d < 0 || d > 255 ||
- (endptr - n > 3 ) ||
- (i <= 2 && *endptr != '.' ) ||
- (i == 3 && *endptr != '\0'))
- return 0;
- output->addr.ipv4Addr[i] = (unsigned char)d;
- n = endptr + 1;
- }
+ if (virSocketParseIpv4Addr(input, &output->addr) == -1)
+ return 0;
return 1;
}
@@ -1250,81 +1211,8 @@ static bool
virNWIPv6AddressParser(const char *input,
nwIPAddressPtr output)
{
- int i, j, pos;
- uint16_t n;
- int shiftpos = -1;
- char prevchar;
- char base;
-
- memset(output, 0x0, sizeof(*output));
-
- output->isIPv6 = 1;
-
- pos = 0;
- i = 0;
-
- while (i < 8) {
- j = 0;
- n = 0;
- while (1) {
- prevchar = input[pos++];
- if (prevchar == ':' || prevchar == 0) {
- if (j > 0) {
- output->addr.ipv6Addr[i * 2 + 0] = n >> 8;
- output->addr.ipv6Addr[i * 2 + 1] = n;
- i++;
- }
- break;
- }
-
- if (j >= 4)
- return 0;
-
- if (prevchar >= '0' && prevchar <= '9')
- base = '0';
- else if (prevchar >= 'a' && prevchar <= 'f')
- base = 'a' - 10;
- else if (prevchar >= 'A' && prevchar <= 'F')
- base = 'A' - 10;
- else
- return 0;
- n <<= 4;
- n |= (prevchar - base);
- j++;
- }
-
- if (prevchar == 0)
- break;
-
- if (input[pos] == ':') {
- pos ++;
- // sequence of zeros
- if (prevchar != ':')
- return 0;
-
- if (shiftpos != -1)
- return 0;
-
- shiftpos = i;
- }
- }
-
- if (shiftpos != -1) {
- if (i >= 7)
- return 0;
- i--;
- j = 0;
- while (i >= shiftpos) {
- output->addr.ipv6Addr[15 - (j*2) - 1] =
- output->addr.ipv6Addr[i * 2 + 0];
- output->addr.ipv6Addr[15 - (j*2) - 0] =
- output->addr.ipv6Addr[i * 2 + 1];
- output->addr.ipv6Addr[i * 2 + 0] = 0;
- output->addr.ipv6Addr[i * 2 + 1] = 0;
- i--;
- j++;
- }
- }
+ if (virSocketParseIpv6Addr(input, &output->addr) == -1)
+ return 0;
return 1;
}
@@ -1442,11 +1330,10 @@ virNWFilterRuleDetailsParse(virConnectPt
} else
rc = -1;
} else {
- if (checkIPv4Mask(datatype,
- ipaddr.addr.ipv4Addr, nwf))
- *(uint8_t *)storage_ptr =
- getMaskNumBits(ipaddr.addr.ipv4Addr,
- sizeof(ipaddr.addr.ipv4Addr));
+ int_val = virSocketGetNumNetmaskBits(
+ &ipaddr.addr);
+ if (int_val >= 0)
+ *(uint8_t *)storage_ptr = int_val;
else
rc = -1;
found = 1;
@@ -1497,11 +1384,10 @@ virNWFilterRuleDetailsParse(virConnectPt
} else
rc = -1;
} else {
- if (checkIPv6Mask(datatype,
- ipaddr.addr.ipv6Addr, nwf))
- *(uint8_t *)storage_ptr =
- getMaskNumBits(ipaddr.addr.ipv6Addr,
- sizeof(ipaddr.addr.ipv6Addr));
+ int_val = virSocketGetNumNetmaskBits(
+ &ipaddr.addr);
+ if (int_val >= 0)
+ *(uint8_t *)storage_ptr = int_val;
else
rc = -1;
found = 1;
@@ -2571,43 +2457,12 @@ virNWFilterPoolObjDeleteDef(virConnectPt
static void
virNWIPAddressFormat(virBufferPtr buf, nwIPAddressPtr ipaddr)
{
- if (!ipaddr->isIPv6) {
- virBufferVSprintf(buf, "%d.%d.%d.%d",
- ipaddr->addr.ipv4Addr[0],
- ipaddr->addr.ipv4Addr[1],
- ipaddr->addr.ipv4Addr[2],
- ipaddr->addr.ipv4Addr[3]);
- } else {
- int i;
- int dcshown = 0, in_dc = 0;
- unsigned short n;
- while (i < 8) {
- n = (ipaddr->addr.ipv6Addr[i * 2 + 0] << 8) |
- ipaddr->addr.ipv6Addr[i * 2 + 1];
- if (n == 0) {
- if (!dcshown) {
- in_dc = 1;
- if (i == 0)
- virBufferAddLit(buf, ":");
- dcshown = 1;
- }
- if (in_dc) {
- i++;
- continue;
- }
- }
- if (in_dc) {
- dcshown = 1;
- virBufferAddLit(buf, ":");
- in_dc = 0;
- }
- i++;
- virBufferVSprintf(buf, "%x", n);
- if (i < 8)
- virBufferAddLit(buf, ":");
- }
- if (in_dc)
- virBufferAddLit(buf, ":");
+ virSocketAddrPtr addr = &ipaddr->addr;
+ char *output = virSocketFormatAddr(addr);
+
+ if (output) {
+ virBufferVSprintf(buf, "%s", output);
+ VIR_FREE(output);
}
}
Index: libvirt-acl/src/nwfilter/nwfilter_ebiptables_driver.c
===================================================================
--- libvirt-acl.orig/src/nwfilter/nwfilter_ebiptables_driver.c
+++ libvirt-acl/src/nwfilter/nwfilter_ebiptables_driver.c
@@ -144,7 +144,7 @@ printDataType(virConnectPtr conn,
nwItemDescPtr item)
{
int done;
- int i, pos, s;
+ char *data;
if (printVar(conn, vars, buf, bufsize, item, &done))
return 1;
@@ -154,30 +154,38 @@ printDataType(virConnectPtr conn,
switch (item->datatype) {
case DATATYPE_IPADDR:
- if (snprintf(buf, bufsize, "%d.%d.%d.%d",
- item->u.ipaddr.addr.ipv4Addr[0],
- item->u.ipaddr.addr.ipv4Addr[1],
- item->u.ipaddr.addr.ipv4Addr[2],
- item->u.ipaddr.addr.ipv4Addr[3]) >= bufsize) {
- virNWFilterReportError(conn, VIR_ERR_INVALID_NWFILTER,
- _("Buffer too small for IP address"));
+ data = virSocketFormatAddr(&item->u.ipaddr.addr);
+ if (!data) {
+ virNWFilterReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("internal IPv4 address representation "
+ "is bad"));
+ return 1;
+ }
+ if (snprintf(buf, bufsize, "%s", data) >= bufsize) {
+ virNWFilterReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("buffer too small for IP address"));
+ VIR_FREE(data);
return 1;
}
+ VIR_FREE(data);
break;
case DATATYPE_IPV6ADDR:
- pos = 0;
- for (i = 0; i < 16; i++) {
- s = snprintf(&buf[pos], bufsize - pos, "%x%s",
- (unsigned int)item->u.ipaddr.addr.ipv6Addr[i],
- ((i & 1) && (i < 15)) ? ":" : "" );
- if (s >= bufsize - pos) {
- virNWFilterReportError(conn, VIR_ERR_INVALID_NWFILTER,
- _("Buffer too small for IPv6 address"));
- return 1;
- }
- pos += s;
+ data = virSocketFormatAddr(&item->u.ipaddr.addr);
+ if (!data) {
+ virNWFilterReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("internal IPv6 address representation "
+ "is bad"));
+ return 1;
+ }
+
+ if (snprintf(buf, bufsize, "%s", data) >= bufsize) {
+ virNWFilterReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("buffer too small for IPv6 address"));
+ VIR_FREE(data);
+ return 1;
}
+ VIR_FREE(data);
break;
case DATATYPE_MACADDR:
14 years, 7 months
[libvirt] [PATCH] Remove driver dependency from nwfilter_conf.c
by Stefan Berger
This patch removes the driver dependency from nwfilter_conf.c and moves
a callback function calling into the driver into
nwfilter_gentech_driver.c and passes a pointer to that callback function
upon initialization of nwfilter_conf.c.
Signed-off-by: Stefan Berger <stefanb(a)us.ibm.com>
Index: libvirt-acl/src/conf/nwfilter_conf.c
===================================================================
--- libvirt-acl.orig/src/conf/nwfilter_conf.c
+++ libvirt-acl/src/conf/nwfilter_conf.c
@@ -39,7 +39,6 @@
#include "nwfilter_params.h"
#include "nwfilter_conf.h"
#include "domain_conf.h"
-#include "nwfilter/nwfilter_gentech_driver.h"
#define VIR_FROM_THIS VIR_FROM_NWFILTER
@@ -2064,56 +2063,7 @@ virNWFilterRegisterCallbackDriver(virNWF
}
-enum UpdateStep {
- STEP_APPLY_NEW,
- STEP_TEAR_NEW,
- STEP_TEAR_OLD,
-};
-
-struct cbStruct {
- virConnectPtr conn;
- enum UpdateStep step;
- int err;
-};
-
-static void
-virNWFilterDomainFWUpdateCB(void *payload,
- const char *name ATTRIBUTE_UNUSED,
- void *data)
-{
- virDomainObjPtr obj = payload;
- virDomainDefPtr vm = obj->def;
- struct cbStruct *cb = data;
- int i;
-
- virDomainObjLock(obj);
-
- if (virDomainObjIsActive(obj)) {
- for (i = 0; i < vm->nnets; i++) {
- virDomainNetDefPtr net = vm->nets[i];
- if ((net->filter) && (net->ifname)) {
- switch (cb->step) {
- case STEP_APPLY_NEW:
- cb->err = virNWFilterUpdateInstantiateFilter(cb->conn,
- net);
- break;
-
- case STEP_TEAR_NEW:
- cb->err = virNWFilterRollbackUpdateFilter(cb->conn, net);
- break;
-
- case STEP_TEAR_OLD:
- cb->err = virNWFilterTearOldFilter(cb->conn, net);
- break;
- }
- if (cb->err)
- break;
- }
- }
- }
-
- virDomainObjUnlock(obj);
-}
+static virHashIterator virNWFilterDomainFWUpdateCB;
static int
@@ -2121,7 +2071,7 @@ virNWFilterTriggerVMFilterRebuild(virCon
{
int i;
int err;
- struct cbStruct cb = {
+ struct domUpdateCBStruct cb = {
.conn = conn,
.err = 0,
.step = STEP_APPLY_NEW,
@@ -2717,8 +2667,10 @@ char *virNWFilterConfigFile(virConnectPt
}
-int virNWFilterConfLayerInit(void)
+int virNWFilterConfLayerInit(virHashIterator domUpdateCB)
{
+ virNWFilterDomainFWUpdateCB = domUpdateCB;
+
if (virMutexInit(&updateMutex))
return 1;
Index: libvirt-acl/src/conf/nwfilter_conf.h
===================================================================
--- libvirt-acl.orig/src/conf/nwfilter_conf.h
+++ libvirt-acl/src/conf/nwfilter_conf.h
@@ -402,6 +402,19 @@ struct _virNWFilterRuleInst {
};
+enum UpdateStep {
+ STEP_APPLY_NEW,
+ STEP_TEAR_NEW,
+ STEP_TEAR_OLD,
+};
+
+struct domUpdateCBStruct {
+ virConnectPtr conn;
+ enum UpdateStep step;
+ int err;
+};
+
+
enum virDomainNetType;
typedef int (*virNWFilterRuleCreateInstance)(virConnectPtr conn,
@@ -516,7 +529,7 @@ virNWFilterDefPtr virNWFilterDefParseFil
void virNWFilterPoolObjLock(virNWFilterPoolObjPtr obj);
void virNWFilterPoolObjUnlock(virNWFilterPoolObjPtr obj);
-int virNWFilterConfLayerInit(void);
+int virNWFilterConfLayerInit(virHashIterator domUpdateCB);
void virNWFilterConfLayerShutdown(void);
int virNWFilterParamConfLayerInit(void);
Index: libvirt-acl/src/nwfilter/nwfilter_driver.c
===================================================================
--- libvirt-acl.orig/src/nwfilter/nwfilter_driver.c
+++ libvirt-acl/src/nwfilter/nwfilter_driver.c
@@ -34,6 +34,7 @@
#include "memory.h"
#include "domain_conf.h"
#include "nwfilter_driver.h"
+#include "nwfilter_gentech_driver.h"
#define VIR_FROM_THIS VIR_FROM_NWFILTER
@@ -64,7 +65,7 @@ static int
nwfilterDriverStartup(int privileged) {
char *base = NULL;
- if (virNWFilterConfLayerInit() < 0)
+ if (virNWFilterConfLayerInit(virNWFilterDomainFWUpdateCB) < 0)
return -1;
if (VIR_ALLOC(driverState) < 0)
Index: libvirt-acl/src/nwfilter/nwfilter_gentech_driver.c
===================================================================
--- libvirt-acl.orig/src/nwfilter/nwfilter_gentech_driver.c
+++ libvirt-acl/src/nwfilter/nwfilter_gentech_driver.c
@@ -681,3 +681,43 @@ virNWFilterTeardownFilter(const virDomai
return 0;
}
+
+
+void
+virNWFilterDomainFWUpdateCB(void *payload,
+ const char *name ATTRIBUTE_UNUSED,
+ void *data)
+{
+ virDomainObjPtr obj = payload;
+ virDomainDefPtr vm = obj->def;
+ struct domUpdateCBStruct *cb = data;
+ int i;
+
+ virDomainObjLock(obj);
+
+ if (virDomainObjIsActive(obj)) {
+ for (i = 0; i < vm->nnets; i++) {
+ virDomainNetDefPtr net = vm->nets[i];
+ if ((net->filter) && (net->ifname)) {
+ switch (cb->step) {
+ case STEP_APPLY_NEW:
+ cb->err = virNWFilterUpdateInstantiateFilter(cb->conn,
+ net);
+ break;
+
+ case STEP_TEAR_NEW:
+ cb->err = virNWFilterRollbackUpdateFilter(cb->conn, net);
+ break;
+
+ case STEP_TEAR_OLD:
+ cb->err = virNWFilterTearOldFilter(cb->conn, net);
+ break;
+ }
+ if (cb->err)
+ break;
+ }
+ }
+ }
+
+ virDomainObjUnlock(obj);
+}
Index: libvirt-acl/src/nwfilter/nwfilter_gentech_driver.h
===================================================================
--- libvirt-acl.orig/src/nwfilter/nwfilter_gentech_driver.h
+++ libvirt-acl/src/nwfilter/nwfilter_gentech_driver.h
@@ -51,4 +51,8 @@ int virNWFilterTeardownFilter(const virD
virNWFilterHashTablePtr virNWFilterCreateVarHashmap(virConnectPtr conn,
char *macaddr);
+void virNWFilterDomainFWUpdateCB(void *payload,
+ const char *name ATTRIBUTE_UNUSED,
+ void *data);
+
#endif
14 years, 7 months
[libvirt] [PATCH] [0/6] implement synchronous hook scripts
by Daniel Veillard
As discussed previously this implement hook scripts which
may be called from libvirtd at specific times.
The script are supposed to be small, execute fast as it's synchronous,
their exit value is 0 otherwise it's considered a failure (which may
be ignored but in general will stops the ongoing operation).
Scripts are stored under
/etc/libvirt/hook/
(or rather $SYSCONF_DIR/libvirt/hook/)
if missing no script invocation will ever be done. There is one script
per 'driver' there is currently hooks for the daemon, qemu and lxc,
so right now only
/etc/libvirt/hook/daemon
/etc/libvirt/hook/qemu
/etc/libvirt/hook/lxc
are potentially used. The implemented set of operations is rather simple
currently daemon start, reload, and exit, and for domain operations,
domain startup and exit.
This can be extended to more drivers in the future of more fine-grained
modularity for the scripts.
The current API to the script israther simple it get passed arguments
about the object name, the operation name, suboperation, and an extra
string. Right now for the daemon the script would get the fallowing
calls:
/etc/libvirt/hooks/daemon - start - start
/etc/libvirt/hooks/daemon - reload begin SIGHUP
/etc/libvirt/hooks/daemon - shutdown - shutdown
and for qemu (or lxc):
/etc/libvirt/hooks/qemu RHEL-5.4-64 start begin -
/etc/libvirt/hooks/qemu RHEL-5.4-64 stopped end -
with the XML configuration of the domain passed on the script stdin if
needed.
In case of script failure at domain startup, this is raised as an normal
error, e.g.:
[root@paphio tmp]# virsh start RHEL-5.4-64
error: Failed to start domain RHEL-5.4-64
error: Hook script execution failed: Hook script /etc/libvirt/hooks/qemu
qemu failed with error code 256:forbidden startup
[root@paphio tmp]#
Some hooks could certainly be added at different place in domain
lifetime operations, for example we plan to add some for migration,
but one thing to remember is that those synchronous scripts can have
a serious impact on execution, so to some extend it's better to use the
asynchronous async event mechanism when possible.
Among the things left to improve and check, there is the behaviour
when the daemon is started by the user for example for qemu:///user
and double check some of the script interaction with security, SELinux
in particular.
But the basics are there, and I would hope to have this in the next
release,
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
14 years, 7 months
[libvirt] virsh setmaxmem
by Chris Lalancette
All,
My recent patch to remove qemudDomainSetMaxMem() revealed some surprising
(to me) behavior of "virsh setmaxmem". In particular, if you run setmaxmem, and
the hypervisor doesn't support it, this fact will be reported to you. However,
if the amount you were setting for maxmem happens to be lower than "currentMemory",
setmaxmem will silently balloon down the domain for you. This is a surprising
result exactly because virsh reports error, but did something anyway. What I
would expect is that if a hypervisor doesn't support virDomainSetMaxMem(), nothing
at all is done.
If we agree that this is behavior that needs to be fixed, I would suggest
that we move the code to do the auto-ballooning into each of the individual
drivers that *do* support virDomainSetMaxMem(). Currently that includes the
test driver, the LXC driver, and the Xen driver. This way, we maintain the
current behavior for the hypervisors that support this call, and make sure
not to do anything at all for the hypervisors that do not.
Opinions?
--
Chris Lalancette
14 years, 7 months