[libvirt] [PATCH libvirt-gconfig] Remove bogus check against -1 of gvir_config_genum_get_value return value
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
The gvir_config_domain_disk class was checking the return value
of gvir_config_genum_get_value against -1. This is impossible,
since this method will return the default enum value
---
libvirt-gconfig/libvirt-gconfig-domain-disk.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-disk.c b/libvirt-gconfig/libvirt-gconfig-domain-disk.c
index a29ea47..5041393 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-disk.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain-disk.c
@@ -85,8 +85,6 @@ gvir_config_domain_disk_new_from_tree(GVirConfigXmlDoc *doc,
type = gvir_config_genum_get_value(GVIR_CONFIG_TYPE_DOMAIN_DISK_TYPE,
type_str,
GVIR_CONFIG_DOMAIN_DISK_FILE);
- if (type == -1)
- return NULL;
object = gvir_config_object_new_from_tree(GVIR_CONFIG_TYPE_DOMAIN_DISK,
doc, NULL, tree);
--
1.7.10.2
12 years, 5 months
[libvirt] [sandbox] random hang in g_poll
by Radu Caragea
Hello,
I am building a tool on top of libvirt-sandbox and I've noticed that
there are random hangs in the g_main_loop_run call. Normally, only
very rarely does it actually hang, the problem appears let's say 4 out
of 5 times when I run the program under valgrind or when I am using an
LD_PRELOAD for checking gobject ref counts (gobject-list). I ran these
directly on virt-sandbox to ensure that it's not from my code and it
still happens.
Attached is the output of a run that hangs followed by the backtrace.
As I'm new to the gmainloop mechanisms I don't really know where to
start debugging. Any ideas would be appreciated.
Thanks,
Radu Caragea.
12 years, 5 months
[libvirt] [PATCH] add handling EINTR to test example of event loop
by Royce Lv
some system calls and signal will interrupt
poll,
making event loop stops and fails to react events and keepalive
message
from
libvirt.
adding handling EINTR to poll to make it more
robust
Signed-off-by: lvroyce <lvroyce(a)linux.vnet.ibm.com>
---
examples/domain-events/events-python/event-test.py | 8
+++++++-
1 files changed, 7 insertions(+), 1
deletions(-)
diff --git a/examples/domain-events/events-python/event-test.py
b/examples/domain-events/events-python/event-test.py
index 96dc268..b446c21
100644
---
a/examples/domain-events/events-python/event-test.py
+++
b/examples/domain-events/events-python/event-test.py
@@ -188,7 +188,13 @@ class
virEventLoopPure:
sleep = (next - now) /
1000.0
debug("Poll with a sleep of %d" %
sleep)
- events =
self.poll.poll(sleep)
+
try:
+ events =
self.poll.poll(sleep)
+ except select.error,
e:
+ self.runningPoll =
False
+ if not e.errno in (errno.EINTR,
errno.EAGAIN):
+
raise
+
return
# Dispatch any file handle events that
occurred
for (fd, revents) in
events:
--
1.7.7.6
12 years, 5 months
[libvirt] [libvirt-glib] Add getter for GVirConfigDomainOs.os_type
by Zeeshan Ali (Khattak)
From: "Zeeshan Ali (Khattak)" <zeeshanak(a)gnome.org>
---
libvirt-gconfig/libvirt-gconfig-domain-os.c | 12 ++++++++++++
libvirt-gconfig/libvirt-gconfig-domain-os.h | 1 +
libvirt-gconfig/libvirt-gconfig.sym | 1 +
3 files changed, 14 insertions(+)
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-os.c b/libvirt-gconfig/libvirt-gconfig-domain-os.c
index 2e4a69a..c91936f 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-os.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain-os.c
@@ -81,6 +81,18 @@ void gvir_config_domain_os_set_os_type(GVirConfigDomainOs *os,
"type", type_str);
}
+GVirConfigDomainOsType gvir_config_domain_os_get_os_type(GVirConfigDomainOs *os)
+{
+ g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN_OS(os),
+ GVIR_CONFIG_DOMAIN_OS_TYPE_HVM);
+
+ return gvir_config_object_get_node_content_genum
+ (GVIR_CONFIG_OBJECT(os),
+ "type",
+ GVIR_CONFIG_TYPE_DOMAIN_OS_TYPE,
+ GVIR_CONFIG_DOMAIN_OS_TYPE_HVM);
+}
+
/**
* gvir_config_domain_os_set_kernel:
* @os: a #GVirConfigDomainOs
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-os.h b/libvirt-gconfig/libvirt-gconfig-domain-os.h
index 62c1fbe..6a8a8d3 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-os.h
+++ b/libvirt-gconfig/libvirt-gconfig-domain-os.h
@@ -83,6 +83,7 @@ GVirConfigDomainOs *gvir_config_domain_os_new(void);
GVirConfigDomainOs *gvir_config_domain_os_new_from_xml(const gchar *xml, GError **error);
void gvir_config_domain_os_set_os_type(GVirConfigDomainOs *os, GVirConfigDomainOsType type);
+GVirConfigDomainOsType gvir_config_domain_os_get_os_type(GVirConfigDomainOs *os);
const char *gvir_config_domain_os_get_arch(GVirConfigDomainOs *os);
void gvir_config_domain_os_set_arch(GVirConfigDomainOs *os, const char *arch);
GList *gvir_config_domain_os_get_boot_devices(GVirConfigDomainOs *os);
diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
index 761a96b..5473148 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -383,6 +383,7 @@ LIBVIRT_GCONFIG_0.0.9 {
gvir_config_domain_os_get_arch;
gvir_config_domain_os_get_boot_devices;
+ gvir_config_domain_os_get_os_type;
gvir_config_capabilities_get_host;
gvir_config_capabilities_get_guests;
--
1.7.10.2
12 years, 5 months
[libvirt] Autogenerate AUTHORS?
by Cole Robinson
Hi,
The AUTHORS file causes a lot of pain doing backports to -maint branches. It
almost always causes conflicts, and the changes can't just be dropped
otherwise 'make syntax-check' breaks.
Is there anything preventing us from just auto generating this at dist time?
Besides, of course, needing someone to actually implement it.
Thanks,
Cole
12 years, 5 months
[libvirt] ANNOUNCE: libvirt 0.9.6.1 maintenance release
by Cole Robinson
libvirt 0.9.6.1 maintenance release is now available. This is
libvirt 0.9.6 with additional bugfixes that have accumulated
upstream since the initial release.
This release can be downloaded at:
http://libvirt.org/sources/stable_updates/libvirt-0.9.6.1.tar.gz
I tried to be fairly conservative here, only pulling in patches we either
already carried in Fedora 16, or fixed bugs filed against Fedora 16. If anyone
else is planning on using this release, and knows of useful and safe backport
candidates for future releases, please let me know.
Changes in this version:
* Stable release 0.9.6.1
* Pull in GNULIB regex module for benefit of test suite on Win32 (cherry
picked from commit f94d9c5793cc57b5228c7f1915bdc76c84f0a923)
* Fix typos in API XML file paths
* qemu: avoid closing fd more than once
* command: check for fork error before closing fd
* fdstream: avoid double close bug
* command: avoid double close bugs
* avoid fd leak
* avoid closing uninitialized fd
* Set a sensible default master start port for ehci companion
controllers
* Fix logic for assigning PCI addresses to USB2 companion controllers
* Fix virDomainDeviceInfoIsSet() to check all struct fields
* lxc: use hand-rolled code in place of unlockpt and grantpt
* xen: do not use ioemu type for any emulated NIC
* xend_internal: Use domain/status for shutdown check
* xen-xm: SIGSEGV in xenXMDomainDefineXML: filename
* xen_xm: Fix SIGSEGV in xenXMDomainDefineXML
* xen: Don't add <console> to xml for dom0
* xen_xs: Guard against set but empty kernel argument
* xen: add error handling to UUID parsing
* xenParseXM: don't dereference NULL pointer when script is empty
(cherry picked from commit 6dd8532d96b0512ddb3b10cae8f51e16389d9cc7)
* Fix sync issue in virNetClientStreamEventRemoveCallback
* fdstream: Add internal callback on stream close
* fdstream: Emit stream abort callback even if poll() doesnt.
* Don't return a fatal error if receiving unexpected stream data
* Fix handling of stream EOF
* If receiving a stream error, mark EOF on the stream
* Set to NULL members that have been freed to prevent crashes
* Fix synchronous reading of stream data
* build: fix stamp file name
* Install API XML desc to a standard location
* tests: work around pdwtags 1.9 failure
* xenapi: remove unused variable
* build: fix 'make distcheck'
* build: fix 'make distcheck' with pdwtags installed
* python: Fix doc directory name for stable releases
* docs: Serialize running apibuild.py
* configure: Use ustar format for dist tarball
* Fix parallel build in docs/ directory
* tests: avoid test failure on rawhide gnutls
* storage: Fix any VolLookupByPath if we have an empty logical pool
* daemon: Remove deprecated HAL from init script dependencies
* virCommand: Properly handle POLLHUP
* qemu: Check for domain being active on successful job acquire
* Avoid crash in shunloadtest
* spec: make it easier to autoreconf when building rpm
* test: replace deprecated "fedora-13" machine with "pc-0.13"
* network: don't add iptables rules for externally managed networks
* spec: fix logic bug in deciding to turn on cgconfig
* spec: don't use chkconfig --list
* spec: add dmidecode as prereq
* Fix incorrect symbols for virtime.h module breaking Mingw32
* spec: mark directories in /var/run as ghosts
* Remove time APIs from src/util/util.h
* Make logging async signal safe wrt time stamp generation
* Add internal APIs for dealing with time
* logging: Add date to log timestamp (cherry picked from commit
11c6e094e4e8789174502bd52c1441caa5865276)
* logging: Do not log timestamp through syslog
* qemu: make PCI multifunction support more manual
* conf: remove unused VIR_ENUM_DECL
* spec: F15 still uses cgconfig, RHEL lacks hyperv
For info about past maintenance releases, see:
http://wiki.libvirt.org/page/Maintenance_Releases
Thanks,
Cole
12 years, 5 months
[libvirt] ask for help to explain the network about tap
by Yong Sheng Gong
Hi,
I don't know who helps qemu-kvm to create and open the tap file and when if I define an interface of a kvm vm like:
<interface type='bridge'>
<mac address='52:54:00:e4:2e:c1'/>
<source bridge='br200'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
The qemu-kvm process's command line will be:
/usr/libexec/qemu-kvm -S -M pc-0.14 -enable-kvm -m 1024 -smp 1,sockets=1,cores=1,threads=1 -name test -uuid 4b39bb5e-3994-9529-b554-2610f905945d -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/test.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -drive file=/var/lib/libvirt/images/test.img,if=none,id=drive-virtio-disk0,format=raw,cache=none,aio=threads -device virtio-blk-pci,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,fd=24,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:e4:2e:c1,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -usb -device usb-tablet,id=input0 -vnc 127.0.0.1:0 -vga cirrus -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6
Note the -netdev tap,fd=24
If I use predefined tap dev name to define:
<interface type='ethernet'>
<mac address='f6:19:e0:6c:84:c3'/>
<script path=''/>
<target dev='tap10'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
The process will be run as:
/usr/libexec/qemu-kvm -S -M pc-0.14 -enable-kvm -m 1024 -smp 1,sockets=1,cores=1,threads=1 -name test-clone -uuid c188ef83-82a4-23bb-dd81-b364e0b4d055 -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/test-clone.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -drive file=/var/lib/libvirt/images/test-clone.img,if=none,id=drive-virtio-disk0,format=raw,cache=none,aio=threads -device virtio-blk-pci,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,ifname=tap10,script=,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=f6:19:e0:6c:84:c3,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -usb -device usb-tablet,id=input0 -vnc 127.0.0.1:1 -vga cirrus -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6
please note the -netdev tap,ifname=tap10
Thanks
Yong Sheng Gong
12 years, 5 months
[libvirt] [PATCH 0/2] qemu_agent: Switch to event driven impl
by Michal Privoznik
Qemu fixed some qemu-ga commands reporting bogus success:
http://www.mail-archive.com/qemu-devel@nongnu.org/msg110261.html
Therefore we need an implementation which won't wait for qemu-ga to reply and
hence block indefinitely. Fortunately, we can take events on qemu monitor as
indication of success.
Michal Privoznik (2):
qemu_agent: Add some more debug prints
qemu_agent: Wait for events instead of agent response
src/qemu/qemu_agent.c | 52 +++++++++++++++++++++++++++++++++++++++++-----
src/qemu/qemu_agent.h | 9 ++++++++
src/qemu/qemu_process.c | 9 ++++++++
3 files changed, 64 insertions(+), 6 deletions(-)
--
1.7.8.5
12 years, 5 months
[libvirt] [PATCH] build: hoist qemu dependence on yajl to configure
by Eric Blake
Commit 6e769eba made it a runtime error if libvirt was compiled
without yajl support but targets a new enough qemu. But enough
users are hitting this on self-compiled libvirt that it is worth
erroring out at compilation time, rather than an obscure failure
when trying to use the built executable.
* configure.ac: If qemu is requested and -version works, require
yajl if qemu version is new enough.
* src/qemu/qemu_capabilities.c (qemuCapsComputeCmdFlags): Add
comment.
---
configure.ac | 19 ++++++++++++++++++-
src/qemu/qemu_capabilities.c | 3 ++-
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index dda764d..0ba0598 100644
--- a/configure.ac
+++ b/configure.ac
@@ -991,6 +990,24 @@ AC_ARG_WITH([yajl],
[],
[with_yajl=check])
+if test "$with_qemu:$with_yajl" = yes:check; then
+ dnl Some versions of qemu require the use of yajl; try to detect them
+ dnl here, although we do not require qemu to exist in order to compile.
+ dnl This check mirrors src/qemu/qemu_capabilities.c
+ AC_PATH_PROGS([QEMU], [qemu-kvm qemu kvm qemu-system-x86_64],
+ [], [$PATH:/usr/bin:/usr/libexec])
+ if test -x "$QEMU"; then
+ if `$QEMU -help | grep libvirt` >/dev/null; then
+ with_yajl=yes
+ else
+ [qemu_version_sed='s/.*ersion \([0-9.,]*\).*/\1/']
+ qemu_version=`$QEMU -version | sed "$qemu_version_sed"`
+ AS_VERSION_COMPARE([$qemu_version], [0.15],
+ [], [with_yajl=yes], [with_yajl=yes])
+ fi
+ fi
+fi
+
YAJL_CFLAGS=
YAJL_LIBS=
with_yajl2=no
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index b410648..f263375 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1206,7 +1206,8 @@ qemuCapsComputeCmdFlags(const char *help,
* forgot to include YAJL libraries when building their own
* libvirt but is targetting a newer qemu, we are better off
* telling them to recompile (the spec file includes the
- * dependency, so distros won't hit this). */
+ * dependency, so distros won't hit this). This check is
+ * also in configure.ac (see $with_yajl). */
if (version >= 15000 ||
(version >= 12000 && strstr(help, "libvirt"))) {
if (check_yajl) {
--
1.7.10.2
12 years, 5 months
[libvirt] [PATCH] autogen: Always abide --system
by Cole Robinson
If we do ./autogen.sh && ./configure, then later try ./autogen.sh --system,
configure isn't invoked with the requested params. Instead
config.status --recheck is run.
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
autogen.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/autogen.sh b/autogen.sh
index f1591d8..53db06f 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -77,7 +77,7 @@ if test "x$OBJ_DIR" != x; then
cd "$OBJ_DIR"
fi
-if test -z "$*" && test -f config.status; then
+if test -z "$*" && test -z "$EXTRA_ARGS" && test -f config.status; then
./config.status --recheck
else
$srcdir/configure $EXTRA_ARGS "$@"
--
1.7.7.6
12 years, 5 months