[libvirt] [PATCH 0/6] lxc: Improve startup debugging
by Cole Robinson
The following patches improve lxc container startup debugging, by logging
the lxc_controller and <init> commands to the domain log file.
To get there, we convert the commands to use virCommand.
Cole Robinson (6):
command: Add virCommandEnvAddFormat
lxc: driver: Convert emulator launching to virCommand
lxc: driver: Improve logging when launching emulator
command: Add virCommandExec helper
lxc: container: Convert <init> exec to virCommand
lxc: container: Build init cmd before we close stdout
src/libvirt_private.syms | 2 +
src/lxc/lxc_container.c | 68 ++++++++--------
src/lxc/lxc_driver.c | 200 +++++++++++++---------------------------------
src/util/command.c | 45 +++++++++-
src/util/command.h | 17 ++++
5 files changed, 146 insertions(+), 186 deletions(-)
--
1.7.4.4
13 years, 6 months
[libvirt] [PATCH] Fix two uninitialized variable warnings
by Matthias Bolte
gcc only reports them when compiling with -O3.
---
src/util/interface.c | 2 +-
tools/virsh.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/util/interface.c b/src/util/interface.c
index 5e1987a..04a922c 100644
--- a/src/util/interface.c
+++ b/src/util/interface.c
@@ -91,7 +91,7 @@ ifaceGetFlags(const char *ifname, short *flags) {
int
ifaceIsUp(const char *ifname, bool *up) {
- short flags;
+ short flags = 0;
int rc = ifaceGetFlags(ifname, &flags);
if (rc)
diff --git a/tools/virsh.c b/tools/virsh.c
index 2b16714..8b5572c 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -2857,7 +2857,7 @@ static bool
cmdSetvcpus(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
- int count;
+ int count = 0;
bool ret = true;
int maximum = vshCommandOptBool(cmd, "maximum");
int config = vshCommandOptBool(cmd, "config");
--
1.7.0.4
13 years, 6 months
[libvirt] [PATCH v2] Allow destroying QEMU VM even if a job is active
by Daniel P. Berrange
Introduce a virProcessKill function that can be safely called
even when the job mutex is held. This allows virDomainDestroy
to kill any VM even if it is asleep in a monitor job. The PID
will die and the thread asleep on the monitor will then wake
up releasing the job mutex.
* src/qemu/qemu_driver.c: Kill process before using qemuProcessStop
to ensure job is released
* src/qemu/qemu_process.c: Add virProcessKill for killing off
QEMU processes
---
src/qemu/qemu_driver.c | 7 ++++++
src/qemu/qemu_process.c | 49 +++++++++++++++++++++++++++++++++++++++-------
src/qemu/qemu_process.h | 2 +
3 files changed, 50 insertions(+), 8 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index b3f9e00..e12dfd8 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1482,6 +1482,13 @@ static int qemudDomainDestroy(virDomainPtr dom) {
goto cleanup;
}
+ /* Although qemuProcessStop does this already, there may
+ * be an outstanding job active. We want to make sure we
+ * can kill the process even if a job is active. Killing
+ * it now means the job will be released
+ */
+ qemuProcessKill(vm);
+
if (qemuDomainObjBeginJobWithDriver(driver, vm) < 0)
goto cleanup;
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 4c2bb84..285d1e8 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -2369,6 +2369,46 @@ cleanup:
}
+void qemuProcessKill(virDomainObjPtr vm)
+{
+ int i;
+ int rc;
+ VIR_DEBUG("vm=%s pid=%d", vm->def->name, vm->pid);
+
+ if (!virDomainObjIsActive(vm)) {
+ VIR_DEBUG("VM '%s' not active", vm->def->name);
+ return;
+ }
+
+ /* This loop sends SIGTERM, then waits a few iterations
+ * (1.6 seconds) to see if it dies. If still alive then
+ * it does SIGKILL, and waits a few more iterations (1.6
+ * seconds more) to confirm that it has really gone.
+ */
+ for (i = 0 ; i < 15 ; i++) {
+ int signum;
+ if (i == 0)
+ signum = SIGTERM;
+ else if (i == 8)
+ signum = SIGKILL;
+ else
+ signum = 0; /* Just check for existence */
+
+ rc = virKillProcess(vm->pid, signum);
+ if (rc < 0) {
+ if (rc != -ERSCH) {
+ char ebuf[1024];
+ VIR_WARN("Failed to kill process %d %s",
+ vm->pid, virStrerror(errno, ebuf, sizeof ebuf));
+ }
+ break;
+ }
+
+ usleep(200 * 1000);
+ }
+}
+
+
void qemuProcessStop(struct qemud_driver *driver,
virDomainObjPtr vm,
int migrated)
@@ -2436,13 +2476,6 @@ void qemuProcessStop(struct qemud_driver *driver,
}
}
- /* This will safely handle a non-running guest with pid=0 or pid=-1*/
- if (virKillProcess(vm->pid, 0) == 0 &&
- virKillProcess(vm->pid, SIGTERM) < 0)
- virReportSystemError(errno,
- _("Failed to send SIGTERM to %s (%d)"),
- vm->def->name, vm->pid);
-
if (priv->mon)
qemuMonitorClose(priv->mon);
@@ -2454,7 +2487,7 @@ void qemuProcessStop(struct qemud_driver *driver,
}
/* shut it off for sure */
- virKillProcess(vm->pid, SIGKILL);
+ qemuProcessKill(vm);
/* now that we know it's stopped call the hook if present */
if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) {
diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h
index f1ab599..d8afab0 100644
--- a/src/qemu/qemu_process.h
+++ b/src/qemu/qemu_process.h
@@ -49,4 +49,6 @@ void qemuProcessStop(struct qemud_driver *driver,
virDomainObjPtr vm,
int migrated);
+void qemuProcessKill(virDomainObjPtr vm);
+
#endif /* __QEMU_PROCESS_H__ */
--
1.7.4.4
13 years, 6 months
[libvirt] [PATCH v2] Add support for YAJL version 2 API/ABI
by Daniel P. Berrange
Version 2.0.0 or yajl changed API. It is fairly trivial for us to
cope with both APIs in libvirt, so adapt.
* configure.ac: Probe for yajl2 API
* src/util/json.c: Conditional support for yajl2 API
---
configure.ac | 8 ++++++
src/util/json.c | 74 +++++++++++++++++++++++++++++++++++++++++-------------
2 files changed, 64 insertions(+), 18 deletions(-)
diff --git a/configure.ac b/configure.ac
index dcec371..62c0560 100644
--- a/configure.ac
+++ b/configure.ac
@@ -878,6 +878,7 @@ AC_ARG_WITH([yajl],
YAJL_CFLAGS=
YAJL_LIBS=
+with_yajl2=no
if test "x$with_yajl" != "xno"; then
if test "x$with_yajl" != "xyes" && test "x$with_yajl" != "xcheck"; then
YAJL_CFLAGS="-I$with_yajl/include"
@@ -898,6 +899,9 @@ if test "x$with_yajl" != "xno"; then
AC_CHECK_LIB([yajl], [yajl_parse],[
YAJL_LIBS="$YAJL_LIBS -lyajl"
with_yajl=yes
+ AC_CHECK_LIB([yajl], [yajl_tree_parse],[
+ with_yajl2=yes
+ ],[])
],[
if test "x$with_yajl" = "xcheck" ; then
with_yajl=no
@@ -914,6 +918,10 @@ if test "x$with_yajl" != "xno"; then
AC_DEFINE_UNQUOTED([HAVE_YAJL], 1,
[whether YAJL is available for JSON parsing/formatting])
fi
+ if test "x$with_yajl2" = "xyes" ; then
+ AC_DEFINE_UNQUOTED([HAVE_YAJL2], 1,
+ [whether YAJL has API version 2])
+ fi
fi
AM_CONDITIONAL([HAVE_YAJL], [test "x$with_yajl" = "xyes"])
AC_SUBST([YAJL_CFLAGS])
diff --git a/src/util/json.c b/src/util/json.c
index df4771d..8bbb87b 100644
--- a/src/util/json.c
+++ b/src/util/json.c
@@ -32,6 +32,13 @@
#if HAVE_YAJL
# include <yajl/yajl_gen.h>
# include <yajl/yajl_parse.h>
+
+#ifdef HAVE_YAJL2
+#define yajl_size_t size_t
+#else
+#define yajl_size_t unsigned int
+#endif
+
#endif
/* XXX fixme */
@@ -672,7 +679,7 @@ static int virJSONParserInsertValue(virJSONParserPtr parser,
return 0;
}
-static int virJSONParserHandleNull(void * ctx)
+static int virJSONParserHandleNull(void *ctx)
{
virJSONParserPtr parser = ctx;
virJSONValuePtr value = virJSONValueNewNull();
@@ -690,7 +697,7 @@ static int virJSONParserHandleNull(void * ctx)
return 1;
}
-static int virJSONParserHandleBoolean(void * ctx, int boolean_)
+static int virJSONParserHandleBoolean(void *ctx, int boolean_)
{
virJSONParserPtr parser = ctx;
virJSONValuePtr value = virJSONValueNewBoolean(boolean_);
@@ -708,9 +715,9 @@ static int virJSONParserHandleBoolean(void * ctx, int boolean_)
return 1;
}
-static int virJSONParserHandleNumber(void * ctx,
- const char * s,
- unsigned int l)
+static int virJSONParserHandleNumber(void *ctx,
+ const char *s,
+ yajl_size_t l)
{
virJSONParserPtr parser = ctx;
char *str = strndup(s, l);
@@ -734,9 +741,9 @@ static int virJSONParserHandleNumber(void * ctx,
return 1;
}
-static int virJSONParserHandleString(void * ctx,
- const unsigned char * stringVal,
- unsigned int stringLen)
+static int virJSONParserHandleString(void *ctx,
+ const unsigned char *stringVal,
+ yajl_size_t stringLen)
{
virJSONParserPtr parser = ctx;
virJSONValuePtr value = virJSONValueNewStringLen((const char *)stringVal,
@@ -755,9 +762,9 @@ static int virJSONParserHandleString(void * ctx,
return 1;
}
-static int virJSONParserHandleMapKey(void * ctx,
- const unsigned char * stringVal,
- unsigned int stringLen)
+static int virJSONParserHandleMapKey(void *ctx,
+ const unsigned char *stringVal,
+ yajl_size_t stringLen)
{
virJSONParserPtr parser = ctx;
virJSONParserStatePtr state;
@@ -776,7 +783,7 @@ static int virJSONParserHandleMapKey(void * ctx,
return 1;
}
-static int virJSONParserHandleStartMap(void * ctx)
+static int virJSONParserHandleStartMap(void *ctx)
{
virJSONParserPtr parser = ctx;
virJSONValuePtr value = virJSONValueNewObject();
@@ -803,7 +810,7 @@ static int virJSONParserHandleStartMap(void * ctx)
}
-static int virJSONParserHandleEndMap(void * ctx)
+static int virJSONParserHandleEndMap(void *ctx)
{
virJSONParserPtr parser = ctx;
virJSONParserStatePtr state;
@@ -827,7 +834,7 @@ static int virJSONParserHandleEndMap(void * ctx)
return 1;
}
-static int virJSONParserHandleStartArray(void * ctx)
+static int virJSONParserHandleStartArray(void *ctx)
{
virJSONParserPtr parser = ctx;
virJSONValuePtr value = virJSONValueNewArray();
@@ -853,7 +860,7 @@ static int virJSONParserHandleStartArray(void * ctx)
return 1;
}
-static int virJSONParserHandleEndArray(void * ctx)
+static int virJSONParserHandleEndArray(void *ctx)
{
virJSONParserPtr parser = ctx;
virJSONParserStatePtr state;
@@ -895,14 +902,29 @@ static const yajl_callbacks parserCallbacks = {
/* XXX add an incremental streaming parser - yajl trivially supports it */
virJSONValuePtr virJSONValueFromString(const char *jsonstring)
{
- yajl_parser_config cfg = { 1, 1 };
yajl_handle hand;
virJSONParser parser = { NULL, NULL, 0 };
virJSONValuePtr ret = NULL;
+#ifndef HAVE_YAJL2
+ yajl_parser_config cfg = { 1, 1 };
+#endif
VIR_DEBUG("string=%s", jsonstring);
+#ifdef HAVE_YAJL2
+ hand = yajl_alloc(&parserCallbacks, NULL, &parser);
+ if (hand) {
+ yajl_config(hand, yajl_allow_comments, 1);
+ yajl_config(hand, yajl_dont_validate_strings, 0);
+ }
+#else
hand = yajl_alloc(&parserCallbacks, &cfg, NULL, &parser);
+#endif
+ if (!hand) {
+ virJSONError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to create JSON parser"));
+ goto cleanup;
+ }
if (yajl_parse(hand,
(const unsigned char *)jsonstring,
@@ -1003,15 +1025,31 @@ static int virJSONValueToStringOne(virJSONValuePtr object,
char *virJSONValueToString(virJSONValuePtr object)
{
- yajl_gen_config conf = { 0, " " }; /* Turns off pretty printing since QEMU can't cope */
yajl_gen g;
const unsigned char *str;
char *ret = NULL;
- unsigned int len;
+ yajl_size_t len;
+#ifndef HAVE_YAJL2
+ yajl_gen_config conf = { 0, " " }; /* Turns off pretty printing since QEMU can't cope */
+#endif
VIR_DEBUG("object=%p", object);
+#ifdef HAVE_YAJL2
+ g = yajl_gen_alloc(NULL);
+ if (g) {
+ yajl_gen_config(g, yajl_gen_beautify, 0);
+ yajl_gen_config(g, yajl_gen_indent_string, " ");
+ yajl_gen_config(g, yajl_gen_validate_utf8, 1);
+ }
+#else
g = yajl_gen_alloc(&conf, NULL);
+#endif
+ if (!g) {
+ virJSONError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to create JSON formatter"));
+ goto cleanup;
+ }
if (virJSONValueToStringOne(object, g) < 0) {
virReportOOMError();
--
1.7.4.4
13 years, 6 months
[libvirt] [PATCH v3 0/8] Add support for taking screenshots of domain console
by Michal Privoznik
This series adds support for taking screenshots of a running domain console.
The iohelper was added a new argument - delete file after transfer. This is
needed, because the screenshot is written to file and asynchronously transferred
to client.
New API is accessible via virsh screenshot <domain> <path>;
For now, we just save the file in format as returned by hypervisor:
PPM for Qemu, PNG for VirtualBox.
diff to v2:
- rebase
Michal Privoznik (8):
screenshot: Defining the public API
screenshot: Defining the internal API
screenshot: Implementing the public API
screenshot: Implementing the remote protocol
screenshot: Expose the new API in virsh
virFDStream: Add option for delete file after it's opening
qemu: Implement the driver methods
vbox: Implement the driver methods
daemon/remote.c | 57 +++++++++++++++++++++
daemon/remote_generator.pl | 2 +
include/libvirt/libvirt.h.in | 7 +++
src/driver.h | 5 ++
src/esx/esx_driver.c | 1 +
src/fdstream.c | 29 ++++++++---
src/fdstream.h | 6 ++-
src/libvirt.c | 56 ++++++++++++++++++++
src/libvirt_public.syms | 5 ++
src/libxl/libxl_driver.c | 1 +
src/lxc/lxc_driver.c | 4 +-
src/openvz/openvz_driver.c | 1 +
src/phyp/phyp_driver.c | 1 +
src/qemu/qemu_driver.c | 82 ++++++++++++++++++++++++++++++-
src/qemu/qemu_monitor.c | 20 +++++++
src/qemu/qemu_monitor.h | 3 +
src/qemu/qemu_monitor_json.c | 23 ++++++++
src/qemu/qemu_monitor_json.h | 4 ++
src/qemu/qemu_monitor_text.c | 31 +++++++++++
src/qemu/qemu_monitor_text.h | 2 +
src/remote/remote_driver.c | 39 ++++++++++++++
src/remote/remote_protocol.x | 12 ++++-
src/remote_protocol-structs | 7 +++
src/storage/storage_driver.c | 4 +-
src/test/test_driver.c | 1 +
src/uml/uml_driver.c | 4 +-
src/util/iohelper.c | 12 ++++-
src/vbox/vbox_tmpl.c | 114 ++++++++++++++++++++++++++++++++++++++++++
src/vmware/vmware_driver.c | 1 +
src/xen/xen_driver.c | 4 +-
src/xen/xen_driver.h | 1 +
src/xen/xen_hypervisor.c | 1 +
src/xen/xen_inotify.c | 1 +
src/xen/xend_internal.c | 1 +
src/xen/xm_internal.c | 1 +
src/xen/xs_internal.c | 1 +
src/xenapi/xenapi_driver.c | 1 +
tools/virsh.c | 90 +++++++++++++++++++++++++++++++++
tools/virsh.pod | 4 ++
39 files changed, 621 insertions(+), 18 deletions(-)
--
1.7.5.rc3
13 years, 6 months
[libvirt] [TCK] [PATCH] Switch to installation of FC14 image and other fixes
by Stefan Berger
This patch fixes the creation of VM images. Previously, FC12 images were
created but the files necessary for FC12 image creation are no longer
available in the public repositories. This patch now switches it to
create FC14 images. To get such a new image one may want to remove all
content in /var/cache/libvirt-tck. I takes a long time for the image to
install, though.
The new FC14 image takes a lot longer to boot. Rather than waiting a
fixed timeout during which the VM presumably has booted it is now
waiting for the VM to become pingable and then starts the actual tests.
Also, the name of the DHCP lease file used by dnsmasq has changed.
Rather than hardcoding its name, try to pick it up from the running
dnsmasq process's parameters. Fall back to the old name if the name of
the leasefile could be determined via 'ps aux'.
Signed-off-by: Stefan Berger <stefanb(a)linux.vnet.ibm.com>
---
conf/default.cfg | 12 ++--
conf/ks.cfg | 3 -
lib/Sys/Virt/TCK/NetworkHelpers.pm | 84 +++++++++++++++++++++++++++---
scripts/nwfilter/090-install-image.t | 11 ++-
scripts/nwfilter/100-ping-still-working.t | 5 -
scripts/nwfilter/210-no-mac-spoofing.t | 5 -
scripts/nwfilter/220-no-ip-spoofing.t | 5 -
scripts/nwfilter/230-no-mac-broadcast.t | 5 -
scripts/nwfilter/240-no-arp-spoofing.t | 5 -
scripts/nwfilter/300-vsitype.t | 3 -
10 files changed, 104 insertions(+), 34 deletions(-)
Index: libvirt-tck/lib/Sys/Virt/TCK/NetworkHelpers.pm
===================================================================
--- libvirt-tck.orig/lib/Sys/Virt/TCK/NetworkHelpers.pm
+++ libvirt-tck/lib/Sys/Virt/TCK/NetworkHelpers.pm
@@ -11,12 +11,76 @@ sub get_first_macaddress {
sub get_ip_from_leases{
my $mac = shift;
- my $tmp = `grep $mac /var/lib/dnsmasq/dnsmasq.leases`;
+ my $leasefile = `ps x | sed -n "s/.*dnsmasq.*default.*dhcp-leasefile=\\([/.[:alnum:]]*\\).*/\\1/p"`;
+ if ( $leasefile eq "" ) {
+ $leasefile = "/var/lib/dnsmasq/dnsmasq.leases";
+ }
+ diag "leasefile is ${leasefile}";
+ my $tmp = `grep $mac $leasefile`;
my @fields = split(/ /, $tmp);
my $ip = $fields[2];
return $ip;
}
+sub wait_for_vm_if_up {
+ my $mac = shift;
+ my $timeout = shift;
+ my $ipaddr = "";
+ my $tmp = "";
+
+ while ( $timeout > 0 ) {
+ $ipaddr = get_ip_from_leases($mac);
+ if ( $ipaddr != "" ) {
+ last;
+ }
+ sleep(1);
+ $timeout -= 1;
+ diag "... waiting for the VM's DHCP lease to show up..."
+ }
+
+ if ( $ipaddr != "" ) {
+ while ( $timeout > 0 ) {
+ $tmp = `ping $ipaddr -c 1 -W 2`;
+ if ( $tmp =~ "100% packet loss" ) {
+ $timeout -= 2;
+ } else {
+ sleep(5);
+ return $ipaddr;
+ }
+ diag "... waiting for the VM to become pingable..."
+ }
+ }
+ return 0;
+}
+
+sub wait_for_vm_if_down {
+ my $mac = shift;
+ my $timeout = shift;
+ my $ipaddr = "";
+ my $tmp = "";
+
+ $ipaddr = get_ip_from_leases($mac);
+ if ( $ipaddr == "" ) {
+ diag "Could not get the IP address of the VM.";
+ return 0;
+ }
+
+ while ( $timeout > 0 ) {
+ $tmp = `ping $ipaddr -c 1 -W 2`;
+ if ( $tmp =~ "100% packet loss" ) {
+ diag "VM is off the network now.";
+ sleep(5);
+ return 1;
+ }
+ $timeout -= 2;
+ sleep(2);
+ diag "... waiting for the VM to be off the network ($timeout) ... "
+ }
+ return 0;
+}
+
+
+
sub build_cdrom_ks_image {
my $tck = shift;
@@ -139,11 +203,19 @@ sub prepare_test_disk_and_vm{
my $dom = $conn->define_domain($guest->as_xml);
diag "Starting installation domain";
$dom->create;
- diag "wait for installation to finish .. ";
- while($dom->is_active()) {
- sleep(10);
- diag ".. to view progress connect to virtual machine ${domain_name} .. ";
- }
+ # Wait for the interface to come up; this may take a good while
+ my $guestip = wait_for_vm_if_up(get_first_macaddress($dom), 600);
+ if ( $guestip eq "" ) {
+ diag "Installation domain did not show an IP address. Destroying VM.";
+ $dom->destroy();
+ } else {
+ diag "IP address of installating VM is $guestip";
+ # wait until the installation is done -- may take a long time
+ if (!wait_for_vm_if_down(get_first_macaddress($dom), 7200)) {
+ diag "Installation did not complete in time. Destroying VM.";
+ $dom->destroy();
+ }
+ }
# cleanup install domain
$dom->undefine;
$dom = undef;
Index: libvirt-tck/conf/default.cfg
===================================================================
--- libvirt-tck.orig/conf/default.cfg
+++ libvirt-tck/conf/default.cfg
@@ -52,25 +52,25 @@ ks = /etc/libvirt-tck/ks.cfg
# empty sparse root FS will be created
#
kernels = (
- # Fedora 11 i686 PAE has pv_ops, so one kernel can do both Xen and KVM guests here
+ # Fedora 14 i686 PAE has pv_ops, so one kernel can do both Xen and KVM guests here
{
arch = i686
ostype = (
hvm
xen
)
- kernel = http://download.fedora.redhat.com/pub/fedora/linux/releases/11/Fedora/i38...
- initrd = http://download.fedora.redhat.com/pub/fedora/linux/releases/11/Fedora/i38...
+ kernel = http://download.fedora.redhat.com/pub/fedora/linux/releases/14/Fedora/i38...
+ initrd = http://download.fedora.redhat.com/pub/fedora/linux/releases/14/Fedora/i38...
}
- # Fedora 11 x86_64 has pv_ops, so one kernel can do both Xen and KVM guests here
+ # Fedora 14 x86_64 has pv_ops, so one kernel can do both Xen and KVM guests here
{
arch = x86_64
ostype = (
hvm
xen
)
- kernel = http://download.fedora.redhat.com/pub/fedora/linux/releases/11/Fedora/x86...
- initrd = http://download.fedora.redhat.com/pub/fedora/linux/releases/11/Fedora/x86...
+ kernel = http://download.fedora.redhat.com/pub/fedora/linux/releases/14/Fedora/x86...
+ initrd = http://download.fedora.redhat.com/pub/fedora/linux/releases/14/Fedora/x86...
}
# User mode linux i686 needs custom kernel + root filesystem
{
Index: libvirt-tck/conf/ks.cfg
===================================================================
--- libvirt-tck.orig/conf/ks.cfg
+++ libvirt-tck/conf/ks.cfg
@@ -1,6 +1,6 @@
install
text
-url --url=http://ftp-stud.hs-esslingen.de/Mirrors/fedora.redhat.com/linux/releases/12/Fedora/i386/os/
+url --url=http://download.fedora.redhat.com/pub/fedora/linux/releases/14/Fedora/i386/os/
lang en_US.UTF-8
keyboard de-latin1-nodeadkeys
network --device eth0 --bootproto dhcp
@@ -27,3 +27,4 @@ poweroff
@base
@core
@hardware-support
+%end
Index: libvirt-tck/scripts/nwfilter/100-ping-still-working.t
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/100-ping-still-working.t
+++ libvirt-tck/scripts/nwfilter/100-ping-still-working.t
@@ -46,7 +46,7 @@ END {
# create first domain and start it
diag "Trying domain lookup by name";
my $dom1;
-my $dom_name ="tckf12nwtest";
+my $dom_name ="tck-fedora-nwtest";
$dom1 = prepare_test_disk_and_vm($tck, $conn, $dom_name);
$dom1->create();
@@ -63,8 +63,7 @@ ok($dom1->get_id() > 0, "running domain
my $mac1 = get_first_macaddress($dom1);
diag "mac is $mac1";
-sleep(30);
-my $guestip1 = get_ip_from_leases($mac1);
+my $guestip1 = wait_for_vm_if_up($mac1, 60);
diag "ip is $guestip1";
# check ebtables entry
Index: libvirt-tck/scripts/nwfilter/210-no-mac-spoofing.t
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/210-no-mac-spoofing.t
+++ libvirt-tck/scripts/nwfilter/210-no-mac-spoofing.t
@@ -44,7 +44,7 @@ END {
# create first domain and start it
-my $dom_name ="tckf12nwtest";
+my $dom_name ="tck-fedora-nwtest";
my $dom1;
$dom1 = prepare_test_disk_and_vm($tck, $conn, $dom_name);
@@ -58,8 +58,7 @@ diag $xml;
my $mac1 = get_first_macaddress($dom1);
diag "mac is $mac1";
-sleep(30);
-my $guestip1 = get_ip_from_leases($mac1);
+my $guestip1 = wait_for_vm_if_up($mac1, 60);
diag "ip is $guestip1";
# check ebtables entry
Index: libvirt-tck/scripts/nwfilter/220-no-ip-spoofing.t
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/220-no-ip-spoofing.t
+++ libvirt-tck/scripts/nwfilter/220-no-ip-spoofing.t
@@ -44,7 +44,7 @@ END {
# looking up domain
my $dom1;
-my $dom_name ="tckf12nwtest";
+my $dom_name ="tck-fedora-nwtest";
$dom1 = prepare_test_disk_and_vm($tck, $conn, $dom_name);
$dom1->create();
@@ -55,8 +55,7 @@ diag $xml;
my $mac1 = get_first_macaddress($dom1);
diag "mac is $mac1";
-sleep(30);
-my $guestip1 = get_ip_from_leases($mac1);
+my $guestip1 = wait_for_vm_if_up($mac1, 60);
diag "ip is $guestip1";
# check ebtables entry
Index: libvirt-tck/scripts/nwfilter/230-no-mac-broadcast.t
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/230-no-mac-broadcast.t
+++ libvirt-tck/scripts/nwfilter/230-no-mac-broadcast.t
@@ -43,7 +43,7 @@ END {
# create first domain and start it
my $dom1;
-my $dom_name ="tckf12nwtest";
+my $dom_name ="tck-fedora-nwtest";
$dom1 = prepare_test_disk_and_vm($tck, $conn, $dom_name);
$dom1->create();
@@ -54,8 +54,7 @@ diag $xml;
my $mac1 = get_first_macaddress($dom1);
diag "mac is $mac1";
-sleep(30);
-my $guestip1 = get_ip_from_leases($mac1);
+my $guestip1 = wait_for_vm_if_up($mac1, 60);
diag "ip is $guestip1";
# check ebtables entry
Index: libvirt-tck/scripts/nwfilter/240-no-arp-spoofing.t
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/240-no-arp-spoofing.t
+++ libvirt-tck/scripts/nwfilter/240-no-arp-spoofing.t
@@ -45,7 +45,7 @@ END {
# creating domain
my $dom1;
-my $dom_name ="tckf12nwtest";
+my $dom_name ="tck-fedora-nwtest";
$dom1 = prepare_test_disk_and_vm($tck, $conn, $dom_name);
$dom1->create();
@@ -56,8 +56,7 @@ diag $xml;
my $mac1 = get_first_macaddress($dom1);
diag "mac is $mac1";
-sleep(30);
-my $guestip1 = get_ip_from_leases($mac1);
+my $guestip1 = wait_for_vm_if_up($mac1, 60);
diag "ip is $guestip1";
# check ebtables entry
Index: libvirt-tck/scripts/nwfilter/090-install-image.t
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/090-install-image.t
+++ libvirt-tck/scripts/nwfilter/090-install-image.t
@@ -19,7 +19,7 @@ network/000-install-image.t - install ne
=head1 DESCRIPTION
-The test case creates and install a 2GB fedora virtual
+The test case creates and install a 2GB fedora virtual
disk via kickstart file from the network.
=cut
@@ -41,15 +41,16 @@ END { $tck->cleanup if $tck; }
use File::Spec::Functions qw(catfile catdir rootdir);
# variables which may need to be adapted
-my $dom_name ="tckf12nwtest";
+my $dom_name ="tck-fedora-nwtest";
my $testdom = prepare_test_disk_and_vm($tck, $conn, $dom_name);
$testdom->create();
ok($testdom->get_id() > 0, "running domain has an ID > 0");
-sleep(20);
+
+my $mac1 = get_first_macaddress($testdom);
+diag "mac is $mac1";
+my $guestip1 = wait_for_vm_if_up($mac1, 60);
shutdown_vm_gracefully($testdom);
exit 0;
-
-
Index: libvirt-tck/scripts/nwfilter/300-vsitype.t
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/300-vsitype.t
+++ libvirt-tck/scripts/nwfilter/300-vsitype.t
@@ -43,6 +43,7 @@ END {
SKIP: {
skip "lldptool not present", 3 unless -e "/usr/sbin/lldptool";
+ skip "eth2 not available", 3 unless `ifconfig eth2` =~ "Link encap:";
# creating domain
my $dom1;
@@ -58,7 +59,7 @@ SKIP: {
my $mac1 = get_first_macaddress($dom1);
diag "mac is $mac1";
- sleep(30);
+ wait_for_vm_if_up($mac1, 60);
# check vsi information
diag "Verifying VSI information using lldptool";
13 years, 6 months
[libvirt] [PATCH v3 0/4] vcpupin: configure inactive domains' CPU affinity setting
by Taku Izumi
Hi all,
This patchset enables us to configure inactive domains' CPU affinity setting.
v2 -> v3:
- rebase
*[PATCH 1/4] vcpupin: inroduce a new libvir API (virDomainPinVcpuFlags)
*[PATCH 2/4] vcpupin: implement the code to address the new API in the qemu driver
*[PATCH 3/4] vcpupin: implement the remote protocol to address the new API
*[PATCH 4/4] vcpupin: add the new options to "virsh vcpupin" command
Best regards,
Taku Izumi
13 years, 6 months
[libvirt] [PATCH] apparmor: Fix uninitalized variable warning in virt-aa-helper
by Matthias Bolte
---
src/security/virt-aa-helper.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index a4e8549..e481095 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -245,7 +245,7 @@ update_include_file(const char *include_file, const char *included_files,
bool append)
{
int rc = -1;
- int plen, flen;
+ int plen, flen = 0;
int fd;
char *pcontent = NULL;
char *existing = NULL;
--
1.7.0.4
13 years, 6 months
[libvirt] [PATCH] Allow bootstrap to build gnulib from local git source if $GNULIB_SRCDIR is non-empty.
by Prerna Saxena
'bootstrap' script clones the .gnulib submodule from upstream git
sources only (provided in .gitmodules), irrespective of whether
$GNULIB_SRCDIR is provided.
This patch allows gnulib git sources provided by $GNULIB_SRCDIR to be
used for adding the gnulib submodule.
>From c5428697c4a1c34daaefaa38708bd59d3b9eefed Mon Sep 17 00:00:00 2001
From: Prerna Saxena <prerna(a)linux.vnet.ibm.com>
Date: Mon, 9 May 2011 13:30:59 +0530
Subject: [PATCH] [Fix] Do not pull from upstream git repo if local copy
of git sources is provided.
Presently, gnulib gets cloned from git://git.sv.gnu.org/gnulib.git
irrespective of local sources in $GNULIB_SRCDIR.
---
bootstrap | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/bootstrap b/bootstrap
index 7cbb5dc..145e4cf 100755
--- a/bootstrap
+++ b/bootstrap
@@ -528,7 +528,7 @@ case ${GNULIB_SRCDIR--} in
echo "$0: getting gnulib files..."
if git submodule -h|grep -- --reference > /dev/null; then
# Prefer the one-liner available in git 1.6.4 or newer.
- git submodule update --init --reference "$GNULIB_SRCDIR" \
+ git submodule update --reference "$GNULIB_SRCDIR" \
"$gnulib_path" || exit $?
else
# This fallback allows at least git 1.5.5.
--
1.7.2.5
--
Prerna Saxena
Linux Technology Centre,
IBM Systems and Technology Lab,
Bangalore, India
13 years, 6 months