[Libvir] python/libvir.c returning wrong value on error?
by Cole Robinson
Hi all,
Looking at python/libvir.c, all the custom functions return VIR_PY_NONE
on error. This unfortunately doesn't map well to some of the
generated python bindings which expect an error val of -1. So if these
commands fail, no exception will be thrown at the python level.
(Ex. virDomainGetAutostart, virDomainGetVcpus and their python equiv.)
I'm wondering where the fix should be: in python/libvir.c, changing
these error return values, or in the generator somewhere?
Thanks,
Cole
16 years, 9 months
[Libvir] bug in xen_unified.c
by Marcus Meissner
Hi,
spotted by gcc 4.3, in libvirt 0.4.0, xen_unified.c:xenUnifiedDomainSuspend()
if (priv->opened[i] &&
which should probably be:
if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET] &&
because it is outside of the loop, and the other indices in that
if ().
--- src/xen_unified.c 2008/01/28 22:20:22 1.1
+++ src/xen_unified.c 2008/01/28 22:20:26
@@ -699,7 +699,7 @@
drivers[i]->domainDestroy (dom) == 0)
return 0;
- if (priv->opened[i] &&
+ if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET] &&
drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->domainDestroy &&
drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->domainDestroy (dom) == 0)
return 0;
Ciao, Marcus
--
Working, but not speaking, for the following german company:
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)
16 years, 9 months
[Libvir] Pthreads error in windows compilation
by Gabriel Kaufmann
Hi,
I received the error
In file included from libvirt.c:32:
internal.h: At top level:
internal.h:177: error: expected specifier-qualifier-list before 'pthread_mutex_t'
In order to fix this problem, I installed the 'pthreads' package on my MinGW.
Then added include pthread.h in src/internal.h
Is this the right action?
Best Regards,
Gabriel Kaufmann
Software Engineer
Gabriel.Kaufmann(a)ericom.com<mailto:Gabriel.Kaufmann@ericom.com>
Ericom Software
Tel (Dir): +972 2 591 1700 Ext 754
Tel (Main): +972 2 591 1700
http://www.ericom.com
Access Done Right
Empower Enterprise-Wide Access to Microsoft(r) Terminal Server, Virtual Desktops and Legacy Applications
16 years, 9 months
Re: [Libvir] [patch 0/3] Fix some gcc 4.3.0 warnings
by Jim Meyering
Mark McLoughlin <markmc(a)redhat.com> wrote:
> With gcc-4.3.0 (from Fedora rawhide), some new warnings are
> thrown up.
>
> The following three patches fixes them. The first two are
> straightforward, I think, but perhaps people might prefer to remove
> -Winline from our warning flags rather than apply the last patch.
I have a slight preference to remove -Winline,
but either way is ok.
16 years, 9 months
Re: [Libvir] [patch 2/2] Dont crash if theres no /sys/hypervisor/capabilities
by Jim Meyering
Mark McLoughlin <markmc(a)redhat.com> wrote:
> xenHypervisorMakeCapabilitiesXML() can be called with either
> of it's FILE* paramaters NULL; don't crash when the capabilities
> pointer is NULL.
>
> Signed-off-by: Mark McLoughlin <markmc(a)redhat.com>
> Index: libvirt/src/xen_internal.c
> ===================================================================
> --- libvirt.orig/src/xen_internal.c 2008-02-06 22:38:06.000000000 +0000
> +++ libvirt/src/xen_internal.c 2008-02-06 23:38:54.000000000 +0000
> @@ -2233,7 +2233,7 @@
> */
>
> /* Expecting one line in this file - ignore any more. */
> - if (fgets (line, sizeof line, capabilities)) {
> + if (capabilities && fgets (line, sizeof line, capabilities)) {
> /* Split the line into tokens. strtok_r is OK here because we "own"
> * this buffer. Parse out the features from each token.
> */
+1
16 years, 9 months
[Libvir] [patch 2/2] Dont crash if theres no /sys/hypervisor/capabilities
by Mark McLoughlin
xenHypervisorMakeCapabilitiesXML() can be called with either
of it's FILE* paramaters NULL; don't crash when the capabilities
pointer is NULL.
Signed-off-by: Mark McLoughlin <markmc(a)redhat.com>
Index: libvirt/src/xen_internal.c
===================================================================
--- libvirt.orig/src/xen_internal.c 2008-02-06 22:38:06.000000000 +0000
+++ libvirt/src/xen_internal.c 2008-02-06 23:38:54.000000000 +0000
@@ -2233,7 +2233,7 @@
*/
/* Expecting one line in this file - ignore any more. */
- if (fgets (line, sizeof line, capabilities)) {
+ if (capabilities && fgets (line, sizeof line, capabilities)) {
/* Split the line into tokens. strtok_r is OK here because we "own"
* this buffer. Parse out the features from each token.
*/
--
16 years, 9 months
[Libvir] [patch 1/2] Create directory for saving iptables rules
by Mark McLoughlin
The patch which reworked the iptables rules saving
accidently dropped the call to virFileMakePath()
resulting in:
Failed to saves iptables rules to /var/lib/libvirt/iptables/filter/INPUT.chain : No such file or directory
Re-instate the virFileMakePath() call.
Signed-off-by: Mark McLoughlin <markmc(a)redhat.com>
Index: libvirt/src/iptables.c
===================================================================
--- libvirt.orig/src/iptables.c 2008-02-06 23:14:28.000000000 +0000
+++ libvirt/src/iptables.c 2008-02-06 23:15:33.000000000 +0000
@@ -238,6 +238,12 @@
#ifdef ENABLE_IPTABLES_LOKKIT
int err;
+ if ((err = virFileMakePath(rules->dir))) {
+ qemudLog(QEMUD_WARN "Failed to create directory %s : %s",
+ rules->dir, strerror(err));
+ return;
+ }
+
if ((err = writeRules(rules->path, rules->rules, rules->nrules))) {
qemudLog(QEMUD_WARN, "Failed to saves iptables rules to %s : %s",
rules->path, strerror(err));
--
16 years, 9 months
[Libvir] [patch 0/2] Fix two misc patches
by Mark McLoughlin
Hi,
Ignore this mail and look at the two following ... I can't
figure out how to make "quilt mail" send one of these intro
mails, even when sending a single patch :-)
Cheers,
Mark.
--
16 years, 9 months