[libvirt] [PATCH] Fix error in nwfilter test driver
by Stefan Berger
Trivial fix for the c&p error in the nwfilter test driver.
Signed-off-by: Stefan Berger <stefanb(a)us.ibm.com>
Index: libvirt-acl/src/test/test_driver.c
===================================================================
--- libvirt-acl.orig/src/test/test_driver.c
+++ libvirt-acl/src/test/test_driver.c
@@ -5212,7 +5212,7 @@ static virDrvOpenStatus testNWFilterOpen
if (STRNEQ(conn->driver->name, "Test"))
return VIR_DRV_OPEN_DECLINED;
- conn->secretPrivateData = conn->privateData;
+ conn->nwfilterPrivateData = conn->privateData;
return VIR_DRV_OPEN_SUCCESS;
}
14 years, 7 months
[libvirt] [RESEND][PATCH][QEMU driver] Catch cdrom change error
by Ryan Harper
Currently when we attempt to change the cdrom in a qemu VM the monitor
doesn't generate an error if the target filename doesn't exist. I've
submitted a patch[1] for this. This patch is the libvirt qemu-driver
side which catches the error message from the monitor and reportes the
error to libvirt. This means that virsh attach-disk cdrom commands
won't appear to succeed when qemu change command actually failed.
I've tested this patch on an older libvirt (rebuild libvirt-0.7.0 on my
ubuntu host) but haven't rebuilt against git head since I can't
quite compile that on my host.
1. http://lists.gnu.org/archive/html/qemu-devel/2010-03/msg01935.html
Signed-off-by: Ryan Harper <ryanh(a)us.ibm.com>
diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index 1596e59..f868907 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -905,7 +905,14 @@ int qemuMonitorTextChangeMedia(qemuMonitorPtr mon,
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("could not eject media on %s: %s"), devname, reply);
goto cleanup;
- }
+ }
+
+ /* Could not open message indicates bad filename */
+ if (strstr(reply, "\nCould not open ")) {
+ qemuReportError(VIR_ERR_OPERATION_FAILED,
+ _("could not change media on %s: %s"), devname, reply);
+ goto cleanup;
+ }
ret = 0;
--
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
ryanh(a)us.ibm.com
14 years, 7 months
[libvirt] [PATCH 0/15] Various MinGW/Windows fixes
by Matthias Bolte
This series fixes several MinGW compile problem on Windows.
Most patches are about exported symbols or missing function bodies.
There is also a gnulib issue with MinGW on Windows pending.
Eric and I are working on a patch for it.
Patches:
01/15 gnulib: Add usleep for MinGW builds
02/15 Make sure uid_t and gid_t are available
03/15 Export conditional state driver symbols only when they are defined
04/15 Remove interfaceRegister from libvirt_private.syms
05/15 Fix export of virConnectAuthPtrDefault for MinGW builds
06/15 Generate libvirt.def from libvirt.syms
07/15 virsh: Handle absence of SA_SIGINFO
08/15 Make sure virtTestCaptureProgramOutput has a body on Windows
09/15 util: Make some conditional symbols unconditional
10/15 bootstrap: Remove rsync from buildreq list
11/15 util: Handle lack of (f)chmod and (f)chown on Windows
12/15 bootstrap: Enable copy-mode for MinGW builds
13/15 util: Replace pciWaitForDeviceCleanup with a stub on Windows
14/15 Add HAVE_PTHREAD_H guard for pthread_sigmask
15/15 util: Add stubs for some functions on Windows
Overall diffstat:
bootstrap.conf | 8 ++-
configure.ac | 17 +++++
docs/apibuild.py | 1 +
include/libvirt/libvirt.h.in | 16 +++++-
src/.gitignore | 1 +
src/Makefile.am | 26 ++++++--
src/libvirt_daemon.syms | 10 +++
src/libvirt_private.syms | 9 ---
src/remote/remote_driver.c | 6 ++
src/util/pci.c | 14 ++++
src/util/util.c | 135 ++++++++++++++++++++++++++++++++++++------
src/util/util.h | 4 -
tests/testutils.c | 6 ++
tools/virsh.c | 4 +
14 files changed, 218 insertions(+), 39 deletions(-)
Matthias
14 years, 7 months
[libvirt] [PATCH] Avoid searching for windres when not building for cygwin or mingw.
by Diego Elio Pettenò
Just checking for a windres tool might hit even on Linux systems when
building for Linux (e.g.: when using Gentoo and having built binutils with
multitarget support), and will then fail to link properly at the end of the
build.
Check the host string before deciding whether to look for windres or not.
---
configure.ac | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 29c6396..e6122b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1676,8 +1676,13 @@ AC_SUBST([CYGWIN_EXTRA_PYTHON_LIBADD])
AC_SUBST([MINGW_EXTRA_LDFLAGS])
dnl Look for windres to build a Windows icon resource.
-AC_CHECK_TOOL([WINDRES], [windres], [no])
-AM_CONDITIONAL([WITH_WIN_ICON], [test "$WINDRES" != "no"])
+case "$host" in
+ *cygwin* | *mingw* )
+ AC_CHECK_TOOL([WINDRES], [windres], [])
+ ;;
+esac
+
+AM_CONDITIONAL([WITH_WIN_ICON], [test "$WINDRES" != ""])
--
1.6.6.1
14 years, 7 months
[libvirt] [PATCH] domain_event.c: don't deref NULL on an OOM error path
by Jim Meyering
This fixes a pair of potential segfault-inducing bugs:
>From 7ca7e9cd366b17e41da9207b68de7e9166a88da2 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Mon, 29 Mar 2010 17:43:01 +0200
Subject: [PATCH] domain_event.c: don't deref NULL on an OOM error path
* src/conf/domain_event.c (virDomainEventGraphicsNewFromDom):
Return NULL when handling out-of-memory error, rather than
falling through with ev=NULL and then assigning to ev->member.
(virDomainEventGraphicsNewFromObj): Likewise.
---
src/conf/domain_event.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c
index 41c70fc..1cf03e3 100644
--- a/src/conf/domain_event.c
+++ b/src/conf/domain_event.c
@@ -681,19 +681,19 @@ virDomainEventPtr virDomainEventGraphicsNewFromDom(virDomainPtr dom,
{
virDomainEventPtr ev =
virDomainEventNewInternal(VIR_DOMAIN_EVENT_ID_GRAPHICS,
dom->id, dom->name, dom->uuid);
if (ev) {
ev->data.graphics.phase = phase;
if (!(ev->data.graphics.authScheme = strdup(authScheme))) {
virDomainEventFree(ev);
- ev = NULL;
+ return NULL;
}
ev->data.graphics.local = local;
ev->data.graphics.remote = remote;
ev->data.graphics.subject = subject;
}
return ev;
}
@@ -706,19 +706,19 @@ virDomainEventPtr virDomainEventGraphicsNewFromObj(virDomainObjPtr obj,
{
virDomainEventPtr ev =
virDomainEventNewInternal(VIR_DOMAIN_EVENT_ID_GRAPHICS,
obj->def->id, obj->def->name, obj->def->uuid);
if (ev) {
ev->data.graphics.phase = phase;
if (!(ev->data.graphics.authScheme = strdup(authScheme))) {
virDomainEventFree(ev);
- ev = NULL;
+ return NULL;
}
ev->data.graphics.local = local;
ev->data.graphics.remote = remote;
ev->data.graphics.subject = subject;
}
return ev;
}
--
1.7.0.3.448.g82eeb
14 years, 7 months
[libvirt] [TCK PATCH] maint: use correct Red Hat copyright
by Eric Blake
* scripts/domain/050-transient-lifecycle.t: Correct the copyright
line.
* scripts/domain/051-transient-autostart.t: Likewise.
* scripts/domain/060-persistent-lifecycle.t: Likewise.
* scripts/domain/061-persistent-autostart.t: Likewise.
* scripts/domain/065-persistent-redefine.t: Likewise.
* scripts/domain/070-transient-to-persistent.t: Likewise.
* scripts/domain/080-unique-id-define.t: Likewise.
* scripts/domain/081-unique-id-create.t: Likewise.
* scripts/domain/090-invalid-ops-when-inactive.t: Likewise.
* scripts/domain/100-transient-save-restore.t: Likewise.
* scripts/domain/101-persistent-save-restore.t: Likewise.
* scripts/domain/102-broken-save-restore.t: Likewise.
* scripts/domain/120-disks-stats.t: Likewise.
* scripts/domain/200-disk-hotplug.t: Likewise.
* scripts/domain/205-disk-hotplug-ordering.t: Likewise.
* scripts/domain/210-nic-hotplug.t: Likewise.
* scripts/domain/215-nic-hotplug-many.t: Likewise.
* scripts/domain/240-usb-host-hotplug.t: Likewise.
* scripts/domain/250-pci-host-hotplug.t: Likewise.
* scripts/qemu/100-disk-encryption.t: Likewise.
* scripts/storage/100-create-vol-dir.t: Likewise.
* scripts/storage/200-clone-vol-dir.t: Likewise.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
This probably counts as trivial, but since this is my first
libvirt-tck patch, I thought I'd ask first.
scripts/domain/050-transient-lifecycle.t | 2 +-
scripts/domain/051-transient-autostart.t | 2 +-
scripts/domain/060-persistent-lifecycle.t | 2 +-
scripts/domain/061-persistent-autostart.t | 2 +-
scripts/domain/065-persistent-redefine.t | 2 +-
scripts/domain/070-transient-to-persistent.t | 2 +-
scripts/domain/080-unique-id-define.t | 2 +-
scripts/domain/081-unique-id-create.t | 2 +-
scripts/domain/090-invalid-ops-when-inactive.t | 2 +-
scripts/domain/100-transient-save-restore.t | 2 +-
scripts/domain/101-persistent-save-restore.t | 2 +-
scripts/domain/102-broken-save-restore.t | 2 +-
scripts/domain/120-disks-stats.t | 2 +-
scripts/domain/200-disk-hotplug.t | 2 +-
scripts/domain/205-disk-hotplug-ordering.t | 2 +-
scripts/domain/210-nic-hotplug.t | 2 +-
scripts/domain/215-nic-hotplug-many.t | 2 +-
scripts/domain/240-usb-host-hotplug.t | 2 +-
scripts/domain/250-pci-host-hotplug.t | 2 +-
scripts/qemu/100-disk-encryption.t | 2 +-
scripts/storage/100-create-vol-dir.t | 2 +-
scripts/storage/200-clone-vol-dir.t | 2 +-
22 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/scripts/domain/050-transient-lifecycle.t b/scripts/domain/050-transient-lifecycle.t
index 22e5c70..89c9d1a 100644
--- a/scripts/domain/050-transient-lifecycle.t
+++ b/scripts/domain/050-transient-lifecycle.t
@@ -1,6 +1,6 @@
# -*- perl -*-
#
-# Copyright (C) 2009 Red Hat
+# Copyright (C) 2009-2010 Red Hat, Inc.
# Copyright (C) 2009 Daniel P. Berrange
#
# This program is free software; You can redistribute it and/or modify
diff --git a/scripts/domain/051-transient-autostart.t b/scripts/domain/051-transient-autostart.t
index 9114a28..d43caa1 100644
--- a/scripts/domain/051-transient-autostart.t
+++ b/scripts/domain/051-transient-autostart.t
@@ -1,6 +1,6 @@
# -*- perl -*-
#
-# Copyright (C) 2009 Red Hat
+# Copyright (C) 2009-2010 Red Hat, Inc.
# Copyright (C) 2009 Daniel P. Berrange
#
# This program is free software; You can redistribute it and/or modify
diff --git a/scripts/domain/060-persistent-lifecycle.t b/scripts/domain/060-persistent-lifecycle.t
index 55bdc6c..ddffa02 100644
--- a/scripts/domain/060-persistent-lifecycle.t
+++ b/scripts/domain/060-persistent-lifecycle.t
@@ -1,6 +1,6 @@
# -*- perl -*-
#
-# Copyright (C) 2009 Red Hat
+# Copyright (C) 2009-2010 Red Hat, Inc.
# Copyright (C) 2009 Daniel P. Berrange
#
# This program is free software; You can redistribute it and/or modify
diff --git a/scripts/domain/061-persistent-autostart.t b/scripts/domain/061-persistent-autostart.t
index c39ec72..5200454 100644
--- a/scripts/domain/061-persistent-autostart.t
+++ b/scripts/domain/061-persistent-autostart.t
@@ -1,6 +1,6 @@
# -*- perl -*-
#
-# Copyright (C) 2009 Red Hat
+# Copyright (C) 2009-2010 Red Hat, Inc.
# Copyright (C) 2009 Daniel P. Berrange
#
# This program is free software; You can redistribute it and/or modify
diff --git a/scripts/domain/065-persistent-redefine.t b/scripts/domain/065-persistent-redefine.t
index 712803c..c19b292 100644
--- a/scripts/domain/065-persistent-redefine.t
+++ b/scripts/domain/065-persistent-redefine.t
@@ -1,6 +1,6 @@
# -*- perl -*-
#
-# Copyright (C) 2009 Red Hat
+# Copyright (C) 2009-2010 Red Hat, Inc.
# Copyright (C) 2009 Daniel P. Berrange
#
# This program is free software; You can redistribute it and/or modify
diff --git a/scripts/domain/070-transient-to-persistent.t b/scripts/domain/070-transient-to-persistent.t
index 346b329..7d85ef6 100644
--- a/scripts/domain/070-transient-to-persistent.t
+++ b/scripts/domain/070-transient-to-persistent.t
@@ -1,6 +1,6 @@
# -*- perl -*-
#
-# Copyright (C) 2009 Red Hat
+# Copyright (C) 2009-2010 Red Hat, Inc.
# Copyright (C) 2009 Daniel P. Berrange
#
# This program is free software; You can redistribute it and/or modify
diff --git a/scripts/domain/080-unique-id-define.t b/scripts/domain/080-unique-id-define.t
index 066c2e8..ed4a8fc 100644
--- a/scripts/domain/080-unique-id-define.t
+++ b/scripts/domain/080-unique-id-define.t
@@ -1,6 +1,6 @@
# -*- perl -*-
#
-# Copyright (C) 2009 Red Hat
+# Copyright (C) 2009-2010 Red Hat, Inc.
# Copyright (C) 2009 Daniel P. Berrange
#
# This program is free software; You can redistribute it and/or modify
diff --git a/scripts/domain/081-unique-id-create.t b/scripts/domain/081-unique-id-create.t
index c081674..425116f 100644
--- a/scripts/domain/081-unique-id-create.t
+++ b/scripts/domain/081-unique-id-create.t
@@ -1,6 +1,6 @@
# -*- perl -*-
#
-# Copyright (C) 2009 Red Hat
+# Copyright (C) 2009-2010 Red Hat, Inc.
# Copyright (C) 2009 Daniel P. Berrange
#
# This program is free software; You can redistribute it and/or modify
diff --git a/scripts/domain/090-invalid-ops-when-inactive.t b/scripts/domain/090-invalid-ops-when-inactive.t
index 28f4936..86f332b 100644
--- a/scripts/domain/090-invalid-ops-when-inactive.t
+++ b/scripts/domain/090-invalid-ops-when-inactive.t
@@ -1,6 +1,6 @@
# -*- perl -*-
#
-# Copyright (C) 2009 Red Hat
+# Copyright (C) 2009-2010 Red Hat, Inc.
# Copyright (C) 2009 Daniel P. Berrange
#
# This program is free software; You can redistribute it and/or modify
diff --git a/scripts/domain/100-transient-save-restore.t b/scripts/domain/100-transient-save-restore.t
index 314493c..bab42da 100644
--- a/scripts/domain/100-transient-save-restore.t
+++ b/scripts/domain/100-transient-save-restore.t
@@ -1,6 +1,6 @@
# -*- perl -*-
#
-# Copyright (C) 2009 Red Hat
+# Copyright (C) 2009-2010 Red Hat, Inc.
# Copyright (C) 2009 Daniel P. Berrange
#
# This program is free software; You can redistribute it and/or modify
diff --git a/scripts/domain/101-persistent-save-restore.t b/scripts/domain/101-persistent-save-restore.t
index 251aacd..f1c8d4b 100644
--- a/scripts/domain/101-persistent-save-restore.t
+++ b/scripts/domain/101-persistent-save-restore.t
@@ -1,6 +1,6 @@
# -*- perl -*-
#
-# Copyright (C) 2009 Red Hat
+# Copyright (C) 2009-2010 Red Hat, Inc.
# Copyright (C) 2009 Daniel P. Berrange
#
# This program is free software; You can redistribute it and/or modify
diff --git a/scripts/domain/102-broken-save-restore.t b/scripts/domain/102-broken-save-restore.t
index 2981d64..b93e274 100644
--- a/scripts/domain/102-broken-save-restore.t
+++ b/scripts/domain/102-broken-save-restore.t
@@ -1,6 +1,6 @@
# -*- perl -*-
#
-# Copyright (C) 2009 Red Hat
+# Copyright (C) 2009-2010 Red Hat, Inc.
# Copyright (C) 2009 Daniel P. Berrange
#
# This program is free software; You can redistribute it and/or modify
diff --git a/scripts/domain/120-disks-stats.t b/scripts/domain/120-disks-stats.t
index c8b3420..5cbaf8c 100644
--- a/scripts/domain/120-disks-stats.t
+++ b/scripts/domain/120-disks-stats.t
@@ -1,6 +1,6 @@
# -*- perl -*-
#
-# Copyright (C) 2009 Red Hat
+# Copyright (C) 2009-2010 Red Hat, Inc.
# Copyright (C) 2009 Daniel P. Berrange
#
# This program is free software; You can redistribute it and/or modify
diff --git a/scripts/domain/200-disk-hotplug.t b/scripts/domain/200-disk-hotplug.t
index 1272448..0f10dbf 100644
--- a/scripts/domain/200-disk-hotplug.t
+++ b/scripts/domain/200-disk-hotplug.t
@@ -1,6 +1,6 @@
# -*- perl -*-
#
-# Copyright (C) 2009 Red Hat
+# Copyright (C) 2009-2010 Red Hat, Inc.
# Copyright (C) 2009 Daniel P. Berrange
#
# This program is free software; You can redistribute it and/or modify
diff --git a/scripts/domain/205-disk-hotplug-ordering.t b/scripts/domain/205-disk-hotplug-ordering.t
index f41d45c..a2e3088 100644
--- a/scripts/domain/205-disk-hotplug-ordering.t
+++ b/scripts/domain/205-disk-hotplug-ordering.t
@@ -1,6 +1,6 @@
# -*- perl -*-
#
-# Copyright (C) 2009 Red Hat
+# Copyright (C) 2009-2010 Red Hat, Inc.
# Copyright (C) 2009 Daniel P. Berrange
#
# This program is free software; You can redistribute it and/or modify
diff --git a/scripts/domain/210-nic-hotplug.t b/scripts/domain/210-nic-hotplug.t
index 6451fd2..7521978 100644
--- a/scripts/domain/210-nic-hotplug.t
+++ b/scripts/domain/210-nic-hotplug.t
@@ -1,6 +1,6 @@
# -*- perl -*-
#
-# Copyright (C) 2009 Red Hat
+# Copyright (C) 2009-2010 Red Hat, Inc.
# Copyright (C) 2009 Daniel P. Berrange
#
# This program is free software; You can redistribute it and/or modify
diff --git a/scripts/domain/215-nic-hotplug-many.t b/scripts/domain/215-nic-hotplug-many.t
index 48fdfcf..7465f2c 100644
--- a/scripts/domain/215-nic-hotplug-many.t
+++ b/scripts/domain/215-nic-hotplug-many.t
@@ -1,6 +1,6 @@
# -*- perl -*-
#
-# Copyright (C) 2009 Red Hat
+# Copyright (C) 2009-2010 Red Hat, Inc.
# Copyright (C) 2009 Daniel P. Berrange
#
# This program is free software; You can redistribute it and/or modify
diff --git a/scripts/domain/240-usb-host-hotplug.t b/scripts/domain/240-usb-host-hotplug.t
index ac71e7b..6e74434 100644
--- a/scripts/domain/240-usb-host-hotplug.t
+++ b/scripts/domain/240-usb-host-hotplug.t
@@ -1,6 +1,6 @@
# -*- perl -*-
#
-# Copyright (C) 2009-2010 Red Hat
+# Copyright (C) 2009-2010 Red Hat, Inc.
# Copyright (C) 2009-2010 Daniel P. Berrange
#
# This program is free software; You can redistribute it and/or modify
diff --git a/scripts/domain/250-pci-host-hotplug.t b/scripts/domain/250-pci-host-hotplug.t
index 5bb4fd9..a9fe422 100644
--- a/scripts/domain/250-pci-host-hotplug.t
+++ b/scripts/domain/250-pci-host-hotplug.t
@@ -1,6 +1,6 @@
# -*- perl -*-
#
-# Copyright (C) 2009-2010 Red Hat
+# Copyright (C) 2009-2010 Red Hat, Inc.
# Copyright (C) 2009-2010 Daniel P. Berrange
#
# This program is free software; You can redistribute it and/or modify
diff --git a/scripts/qemu/100-disk-encryption.t b/scripts/qemu/100-disk-encryption.t
index 5964aa5..d594607 100644
--- a/scripts/qemu/100-disk-encryption.t
+++ b/scripts/qemu/100-disk-encryption.t
@@ -1,6 +1,6 @@
# -*- perl -*-
#
-# Copyright (C) 2009 Red Hat
+# Copyright (C) 2009-2010 Red Hat, Inc.
# Copyright (C) 2009 Daniel P. Berrange
#
# This program is free software; You can redistribute it and/or modify
diff --git a/scripts/storage/100-create-vol-dir.t b/scripts/storage/100-create-vol-dir.t
index 2a09036..3a12596 100644
--- a/scripts/storage/100-create-vol-dir.t
+++ b/scripts/storage/100-create-vol-dir.t
@@ -1,6 +1,6 @@
# -*- perl -*-
#
-# Copyright (C) 2009 Red Hat
+# Copyright (C) 2009-2010 Red Hat, Inc.
# Copyright (C) 2009 Daniel P. Berrange
#
# This program is free software; You can redistribute it and/or modify
diff --git a/scripts/storage/200-clone-vol-dir.t b/scripts/storage/200-clone-vol-dir.t
index dbc17c5..3b4d864 100644
--- a/scripts/storage/200-clone-vol-dir.t
+++ b/scripts/storage/200-clone-vol-dir.t
@@ -1,6 +1,6 @@
# -*- perl -*-
#
-# Copyright (C) 2009 Red Hat
+# Copyright (C) 2009-2010 Red Hat, Inc.
# Copyright (C) 2009 Daniel P. Berrange
#
# This program is free software; You can redistribute it and/or modify
--
1.6.6.1
14 years, 7 months
[libvirt] [PATCH Java] Add finalize to automatically free libvirt objects
by Matthias Bolte
The Connect and Network classes already had finalize, add it to all
other classes that wrap libvirt objects to unify the behavior.
---
src/main/java/org/libvirt/Device.java | 5 +++++
src/main/java/org/libvirt/Domain.java | 5 +++++
src/main/java/org/libvirt/Interface.java | 5 +++++
src/main/java/org/libvirt/Network.java | 1 +
src/main/java/org/libvirt/StoragePool.java | 5 +++++
src/main/java/org/libvirt/StorageVol.java | 5 +++++
6 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/src/main/java/org/libvirt/Device.java b/src/main/java/org/libvirt/Device.java
index b4f9a0c..5329be5 100644
--- a/src/main/java/org/libvirt/Device.java
+++ b/src/main/java/org/libvirt/Device.java
@@ -132,6 +132,11 @@ public class Device {
return desc;
}
+ @Override
+ public void finalize() throws LibvirtException {
+ free();
+ }
+
/**
* Frees this device object. The running instance is kept alive. The data
* structure is freed and should not be used thereafter.
diff --git a/src/main/java/org/libvirt/Domain.java b/src/main/java/org/libvirt/Domain.java
index e7b24ef..a80800c 100644
--- a/src/main/java/org/libvirt/Domain.java
+++ b/src/main/java/org/libvirt/Domain.java
@@ -162,6 +162,11 @@ public class Domain {
processError();
}
+ @Override
+ public void finalize() throws LibvirtException {
+ free();
+ }
+
/**
* Frees this domain object. The running instance is kept alive. The data
* structure is freed and should not be used thereafter.
diff --git a/src/main/java/org/libvirt/Interface.java b/src/main/java/org/libvirt/Interface.java
index 44bcad5..8b97925 100644
--- a/src/main/java/org/libvirt/Interface.java
+++ b/src/main/java/org/libvirt/Interface.java
@@ -112,6 +112,11 @@ public class Interface {
return returnValue;
}
+ @Override
+ public void finalize() throws LibvirtException {
+ free();
+ }
+
/**
* Frees this interface object. The running instance is kept alive. The data
* structure is freed and should not be used thereafter.
diff --git a/src/main/java/org/libvirt/Network.java b/src/main/java/org/libvirt/Network.java
index 3c6f313..63b1f12 100644
--- a/src/main/java/org/libvirt/Network.java
+++ b/src/main/java/org/libvirt/Network.java
@@ -64,6 +64,7 @@ public class Network {
processError();
}
+ @Override
public void finalize() throws LibvirtException {
free();
}
diff --git a/src/main/java/org/libvirt/StoragePool.java b/src/main/java/org/libvirt/StoragePool.java
index 7de7d50..54468bd 100644
--- a/src/main/java/org/libvirt/StoragePool.java
+++ b/src/main/java/org/libvirt/StoragePool.java
@@ -115,6 +115,11 @@ public class StoragePool {
processError();
}
+ @Override
+ public void finalize() throws LibvirtException {
+ free();
+ }
+
/**
* Free a storage pool object, releasing all memory associated with it. Does
* not change the state of the pool on the host.
diff --git a/src/main/java/org/libvirt/StorageVol.java b/src/main/java/org/libvirt/StorageVol.java
index 5ae5f5c..c5a3717 100644
--- a/src/main/java/org/libvirt/StorageVol.java
+++ b/src/main/java/org/libvirt/StorageVol.java
@@ -75,6 +75,11 @@ public class StorageVol {
processError();
}
+ @Override
+ public void finalize() throws LibvirtException {
+ free();
+ }
+
/**
* Release the storage volume handle. The underlying storage volume contains
* to exist
--
1.6.3.3
14 years, 7 months
[libvirt] [PATCH] build: import latest gnulib
by Eric Blake
* .gnulib: Update to latest.
* cfg.mk (sc_prohibit_test_minus_ao): Delete, it was moved into
gnulib's maint.mk.
---
Here's the full list of gnulib changes:
* .gnulib 4f01268...e01b458 (44):
> maint.mk: check for [ as well as test
> gnumakefile: don't squelch _version output
> sys_time: avoid compiler warnings
> maint.mk: split a long line
> maint.mk: s/_header_without_use/_sc_header_without_use/
> maint: improve module indicators
> fdopendir: work around FreeBSD bug
> Emit #pragma system_header after the inclusion guard, not before.
> Fix indentation.
> save-cwd: don't leak a file descriptor when the caller execs
> Remove vestiges of fts-lgpl module.
> Fix definition of tests witness macro.
> Fix definition of tests witness macro.
> Fix ioctl's protoype on glibc systems.
> Normalize copyright line formatting.
> exclude: fix the case of globs vs. EXCLUDE_INCLUDE
> maint.mk: prohibit use of test's -o and -a operators
> Remove unused GNULIB_XYZ macro definitions.
> Mark privileged tests modules.
> Split C++ tests into separate tests modules.
> gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
> gnulib-tool: Add support for special categories of tests.
> ansi-c++-opt: Allow turning off the C++ build by default.
> unistd: Avoid #define replacements in C++ mode.
> Fix link errors on mingw.
> lib-ignore: Determine different options for different compilers.
> Remove unused GNULIB_XYZ macro definitions.
> Add a remark about certain modules.
> Resolve conflict between the two kinds of module indicators.
> autoupdate
> Distinguish two kinds of module indicators.
> New module description field 'Comment'.
> Addendum to 2010-02-07 commit.
> Use GNULIB_POSIXCHECK instead of GNULIB_PORTCHECK.
> Avoid side effects from tests-related modules on the compilation of lib.
> Factorize common .m4 code.
> Fix a compilation error on Cygwin with g++ >= 4.3.
> Rename gl_GETLOGIN.
> Rename gl_GETLOGIN_R.
> Rename gl_INET_NTOP.
> Rename gl_INET_PTON.
> Rename gl_MBSLEN.
> Rename gl_FORKPTY and gl_OPENPTY.
> top/maint.mk (sc_texinfo_acronym): Don't infloop if there is no *.texi files.
.gnulib | 2 +-
cfg.mk | 8 --------
2 files changed, 1 insertions(+), 9 deletions(-)
diff --git a/.gnulib b/.gnulib
index 4f01268..e01b458 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit 4f01268d0c584c20704e42527f4fa125e7525aae
+Subproject commit e01b458f40440e64ce6f59beb0b446219bb6302d
diff --git a/cfg.mk b/cfg.mk
index 2e7b68a..07360b0 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -272,14 +272,6 @@ sc_preprocessor_indentation:
echo '$(ME): skipping test $@: cppi not installed' 1>&2; \
fi
-_m1 = use "test C1 && test C2", not "test C1 -''a C2"
-_m2 = use "test C1 || test C2", not "test C1 -''o C2"
-# Using test's -a and -o operators is not portable.
-sc_prohibit_test_minus_ao:
- @re='(\<test| \[+) .+ -[ao] ' \
- msg='$(_m1); $(_m2)' \
- $(_prohibit_regexp)
-
sc_copyright_format:
@$(VC_LIST_EXCEPT) | xargs grep -ni 'copyright .*Red 'Hat \
| grep -v Inc \
--
1.6.6.1
14 years, 7 months
[libvirt] [PATCH] Changes to clock timer XML to match final design.
by Laine Stump
The clock timer XML is being updated in the following ways (based on
further off-list discussion that was missed during the initial
implementation):
1) 'wallclock' is changed to 'track', and the possible values are 'boot'
(corresponds to old 'host'), 'guest', and 'wall'.
2) 'mode' has an additional value 'smpsafe'
3) when tickpolicy='catchup', there can be an optional sub-element of
timer called 'catchup':
<catchup threshold=123 slew=120 limit=10000/>
Those three values are all longs, always optional, and if they are present,
they are positive. Internally, 0 indicates "unspecified".
* docs/schemas/domain.rng: updated RNG definition to account for changes
* src/conf/domain_conf.h: change the C struct and enums to match changes.
* src/conf/domain_conf.c: timer parse and format functions changed to
handle the new selections and new element.
* src/libvirt_private.syms: *TimerWallclock* changes to *TimerTrack*
* src/qemu/qemu_conf.c: again, account for Wallclock --> Track change.
---
docs/schemas/domain.rng | 24 +++++++++++-
src/conf/domain_conf.c | 89 +++++++++++++++++++++++++++++++++++----------
src/conf/domain_conf.h | 26 ++++++++++----
src/libvirt_private.syms | 4 +-
src/qemu/qemu_conf.c | 17 +++++++--
5 files changed, 126 insertions(+), 34 deletions(-)
diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng
index d804301..228665c 100644
--- a/docs/schemas/domain.rng
+++ b/docs/schemas/domain.rng
@@ -344,10 +344,11 @@
</choice>
</attribute>
<optional>
- <attribute name="wallclock">
+ <attribute name="track">
<choice>
- <value>host</value>
+ <value>boot</value>
<value>guest</value>
+ <value>wall</value>
</choice>
</attribute>
</optional>
@@ -362,6 +363,9 @@
</attribute>
</optional>
<optional>
+ <ref name="catchup"/>
+ </optional>
+ <optional>
<attribute name="frequency">
<ref name="unsignedInt"/>
</attribute>
@@ -373,6 +377,7 @@
<value>native</value>
<value>emulate</value>
<value>paravirt</value>
+ <value>smpsafe</value>
</choice>
</attribute>
</optional>
@@ -387,6 +392,21 @@
<empty/>
</element>
</define>
+ <define name="catchup">
+ <element name="catchup">
+ <optional>
+ <attribute name="threshold">
+ <ref name="unsignedInt"/>
+ </attribute>
+ <attribute name="slew">
+ <ref name="unsignedInt"/>
+ </attribute>
+ <attribute name="limit">
+ <ref name="unsignedInt"/>
+ </attribute>
+ </optional>
+ </element>
+ </define>
<!--
A bootloader may be used to extract the OS information instead of
defining the OS parameter in the instance. It points just to the
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 66aa53e..b8acab9 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -252,9 +252,10 @@ VIR_ENUM_IMPL(virDomainTimerName, VIR_DOMAIN_TIMER_NAME_LAST,
"hpet",
"tsc");
-VIR_ENUM_IMPL(virDomainTimerWallclock, VIR_DOMAIN_TIMER_WALLCLOCK_LAST,
- "host",
- "guest");
+VIR_ENUM_IMPL(virDomainTimerTrack, VIR_DOMAIN_TIMER_TRACK_LAST,
+ "boot",
+ "guest",
+ "wall");
VIR_ENUM_IMPL(virDomainTimerTickpolicy, VIR_DOMAIN_TIMER_TICKPOLICY_LAST,
"delay",
@@ -266,7 +267,8 @@ VIR_ENUM_IMPL(virDomainTimerMode, VIR_DOMAIN_TIMER_MODE_LAST,
"auto",
"native",
"emulate",
- "paravirt");
+ "paravirt",
+ "smpsafe");
#define virDomainReportError(code, ...) \
virReportErrorHelper(NULL, VIR_FROM_DOMAIN, code, __FILE__, \
@@ -2555,7 +2557,7 @@ virDomainTimerDefParseXML(const xmlNodePtr node,
char *name = NULL;
char *present = NULL;
char *tickpolicy = NULL;
- char *wallclock = NULL;
+ char *track = NULL;
char *mode = NULL;
virDomainTimerDefPtr def;
@@ -2603,12 +2605,12 @@ virDomainTimerDefParseXML(const xmlNodePtr node,
}
}
- def->wallclock = -1;
- wallclock = virXMLPropString(node, "wallclock");
- if (wallclock != NULL) {
- if ((def->wallclock = virDomainTimerWallclockTypeFromString(wallclock)) < 0) {
+ def->track = -1;
+ track = virXMLPropString(node, "track");
+ if (track != NULL) {
+ if ((def->track = virDomainTimerTrackTypeFromString(track)) < 0) {
virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- _("unknown timer wallclock '%s'"), wallclock);
+ _("unknown timer track '%s'"), track);
goto error;
}
}
@@ -2616,7 +2618,7 @@ virDomainTimerDefParseXML(const xmlNodePtr node,
int ret = virXPathULong("string(./frequency)", ctxt, &def->frequency);
if (ret == -1) {
def->frequency = 0;
- } else if (ret <= 0) {
+ } else if (ret < 0) {
virDomainReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("invalid timer frequency"));
goto error;
@@ -2632,11 +2634,42 @@ virDomainTimerDefParseXML(const xmlNodePtr node,
}
}
+ xmlNodePtr catchup = virXPathNode("./catchup", ctxt);
+ if (catchup != NULL) {
+ ret = virXPathULong("string(./catchup/@threshold)", ctxt,
+ &def->catchup.threshold);
+ if (ret == -1) {
+ def->catchup.threshold = 0;
+ } else if (ret < 0) {
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("invalid catchup threshold"));
+ goto error;
+ }
+
+ ret = virXPathULong("string(./catchup/@slew)", ctxt, &def->catchup.slew);
+ if (ret == -1) {
+ def->catchup.slew = 0;
+ } else if (ret < 0) {
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("invalid catchup slew"));
+ goto error;
+ }
+
+ ret = virXPathULong("string(./catchup/@limit)", ctxt, &def->catchup.limit);
+ if (ret == -1) {
+ def->catchup.limit = 0;
+ } else if (ret < 0) {
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("invalid catchup limit"));
+ goto error;
+ }
+ }
+
cleanup:
VIR_FREE(name);
VIR_FREE(present);
VIR_FREE(tickpolicy);
- VIR_FREE(wallclock);
+ VIR_FREE(track);
VIR_FREE(mode);
ctxt->node = oldnode;
@@ -5456,16 +5489,16 @@ virDomainTimerDefFormat(virBufferPtr buf,
if ((def->name == VIR_DOMAIN_TIMER_NAME_PLATFORM)
|| (def->name == VIR_DOMAIN_TIMER_NAME_RTC)) {
- if (def->wallclock != -1) {
- const char *wallclock
- = virDomainTimerWallclockTypeToString(def->wallclock);
- if (!wallclock) {
+ if (def->track != -1) {
+ const char *track
+ = virDomainTimerTrackTypeToString(def->track);
+ if (!track) {
virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- _("unexpected timer wallclock %d"),
- def->wallclock);
+ _("unexpected timer track %d"),
+ def->track);
return -1;
}
- virBufferVSprintf(buf, " wallclock='%s'", wallclock);
+ virBufferVSprintf(buf, " track='%s'", track);
}
}
@@ -5487,7 +5520,23 @@ virDomainTimerDefFormat(virBufferPtr buf,
}
}
- virBufferAddLit(buf, "/>\n");
+ if ((def->catchup.threshold == 0)
+ && (def->catchup.slew == 0)
+ && (def->catchup.limit == 0)) {
+ virBufferAddLit(buf, "/>\n");
+ } else {
+ virBufferAddLit(buf, ">\n <catchup ");
+ if (def->catchup.threshold > 0) {
+ virBufferVSprintf(buf, " threshold='%lu'", def->catchup.threshold);
+ }
+ if (def->catchup.slew > 0) {
+ virBufferVSprintf(buf, " slew='%lu'", def->catchup.slew);
+ }
+ if (def->catchup.limit > 0) {
+ virBufferVSprintf(buf, " limit='%lu'", def->catchup.limit);
+ }
+ virBufferAddLit(buf, "/>\n </timer>\n");
+ }
return 0;
}
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index ed1a4ad..435d546 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -656,11 +656,12 @@ enum virDomainTimerNameType {
VIR_DOMAIN_TIMER_NAME_LAST,
};
-enum virDomainTimerWallclockType {
- VIR_DOMAIN_TIMER_WALLCLOCK_HOST = 0,
- VIR_DOMAIN_TIMER_WALLCLOCK_GUEST,
+enum virDomainTimerTrackType {
+ VIR_DOMAIN_TIMER_TRACK_BOOT = 0,
+ VIR_DOMAIN_TIMER_TRACK_GUEST,
+ VIR_DOMAIN_TIMER_TRACK_WALL,
- VIR_DOMAIN_TIMER_WALLCLOCK_LAST,
+ VIR_DOMAIN_TIMER_TRACK_LAST,
};
enum virDomainTimerTickpolicyType {
@@ -677,10 +678,19 @@ enum virDomainTimerModeType {
VIR_DOMAIN_TIMER_MODE_NATIVE,
VIR_DOMAIN_TIMER_MODE_EMULATE,
VIR_DOMAIN_TIMER_MODE_PARAVIRT,
+ VIR_DOMAIN_TIMER_MODE_SMPSAFE,
VIR_DOMAIN_TIMER_MODE_LAST,
};
+typedef struct _virDomainTimerCatchupDef virDomainTimerCatchupDef;
+typedef virDomainTimerCatchupDef *virDomainTimerCatchupDefPtr;
+struct _virDomainTimerCatchupDef {
+ unsigned long threshold;
+ unsigned long slew;
+ unsigned long limit;
+};
+
typedef struct _virDomainTimerDef virDomainTimerDef;
typedef virDomainTimerDef *virDomainTimerDefPtr;
struct _virDomainTimerDef {
@@ -688,8 +698,10 @@ struct _virDomainTimerDef {
int present; /* unspecified = -1, no = 0, yes = 1 */
int tickpolicy; /* none|catchup|merge|discard */
- /* wallclock is only valid for name='platform|rtc' */
- int wallclock; /* host|guest */
+ virDomainTimerCatchupDef catchup;
+
+ /* track is only valid for name='platform|rtc' */
+ int track; /* host|guest */
/* frequency & mode are only valid for name='tsc' */
unsigned long frequency; /* in Hz, unspecified = 0 */
@@ -1029,7 +1041,7 @@ VIR_ENUM_DECL(virDomainClockOffset)
VIR_ENUM_DECL(virDomainNetdevMacvtap)
VIR_ENUM_DECL(virDomainTimerName)
-VIR_ENUM_DECL(virDomainTimerWallclock)
+VIR_ENUM_DECL(virDomainTimerTrack)
VIR_ENUM_DECL(virDomainTimerTickpolicy)
VIR_ENUM_DECL(virDomainTimerMode)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index cc943f8..08a6b97 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -199,8 +199,8 @@ virDomainClockOffsetTypeFromString;
virDomainDiskErrorPolicyTypeToString;
virDomainTimerNameTypeToString;
virDomainTimerNameTypeFromString;
-virDomainTimerWallclockTypeToString;
-virDomainTimerWallclockTypeFromString;
+virDomainTimerTrackTypeToString;
+virDomainTimerTrackTypeFromString;
virDomainTimerTickpolicyTypeToString;
virDomainTimerTickpolicyTypeFromString;
virDomainTimerModeTypeToString;
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 8f6f7ec..4f279be 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -3183,11 +3183,22 @@ qemuBuildClockArgStr(virDomainClockDefPtr def)
int i;
for (i = 0; i < def->ntimers; i++) {
if (def->timers[i]->name == VIR_DOMAIN_TIMER_NAME_RTC) {
- if (def->timers[i]->wallclock == VIR_DOMAIN_TIMER_WALLCLOCK_HOST) {
- virBufferAddLit(&buf, ",clock=host");
- } else if (def->timers[i]->wallclock == VIR_DOMAIN_TIMER_WALLCLOCK_GUEST) {
+ switch (def->timers[i]->track) {
+ case -1: /* unspecified - use hypervisor default */
+ break;
+ case VIR_DOMAIN_TIMER_TRACK_BOOT:
+ qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("unsupported rtc timer track '%s'"),
+ virDomainTimerTrackTypeToString(def->timers[i]->track));
+ goto error;
+ case VIR_DOMAIN_TIMER_TRACK_GUEST:
virBufferAddLit(&buf, ",clock=vm");
+ break;
+ case VIR_DOMAIN_TIMER_TRACK_WALL:
+ virBufferAddLit(&buf, ",clock=host");
+ break;
}
+
switch (def->timers[i]->tickpolicy) {
case -1:
case VIR_DOMAIN_TIMER_TICKPOLICY_DELAY:
--
1.6.6.1
14 years, 7 months