[libvirt] [PATCH] esx: Fix a potential crash
by Osier Yang
Initialize ptr data.datastorePathWithoutFileName as NULL, otherwise
it might cause crash when trying to free it in cleanup.
---
src/esx/esx_driver.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index ddb8c23..ae614a6 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -2698,6 +2698,7 @@ esxDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
char *vmx = NULL;
virVMXContext ctx;
esxVMX_Data data;
+ data.datastorePathWithoutFileName = NULL;
virDomainDefPtr def = NULL;
char *xml = NULL;
--
1.7.6
13 years, 5 months
[libvirt] [PATCH] rpc: Fix compile error due to potentially unused parameter
by Matthias Bolte
connectDBus is only used if HAVE_DBUS is set. Therefore mark
it as potentially unused.
---
Pushed under the build-break rule.
src/rpc/virnetserver.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c
index 94d46f6..66edd11 100644
--- a/src/rpc/virnetserver.c
+++ b/src/rpc/virnetserver.c
@@ -277,7 +277,7 @@ virNetServerPtr virNetServerNew(size_t min_workers,
size_t max_workers,
size_t max_clients,
const char *mdnsGroupName,
- bool connectDBus,
+ bool connectDBus ATTRIBUTE_UNUSED,
virNetServerClientInitHook clientInitHook)
{
virNetServerPtr srv;
--
1.7.4.1
13 years, 5 months
[libvirt] [PATCH] Fix build when using polkit0
by Jim Fehlig
Here's a hacked attempt at fixing the build on older distros using
polkit0. It works and user is authorized or denied depending on
settings in PolicyKit.conf.
I'm not too happy with it but haven't yet digested all the changes in
rpc and daemon code. In the meantime, hopefully someone can suggest
improvements.
Regards,
Jim
13 years, 5 months
[libvirt] [PATCH] qemu: update configuration file
by ajia@redhat.com
From: Alex Jia <ajia(a)redhat.com>
* src/qemu/qemu.conf: Add blkio controller into qemu.conf.
---
src/qemu/qemu.conf | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf
index 2c50d9d..934f99b 100644
--- a/src/qemu/qemu.conf
+++ b/src/qemu/qemu.conf
@@ -156,18 +156,19 @@
# - 'cpu' - use for schedular tunables
# - 'devices' - use for device whitelisting
# - 'memory' - use for memory tunables
+# - 'blkio' - use for block devices I/O tunables
#
# NB, even if configured here, they won't be used unless
# the administrator has mounted cgroups, e.g.:
#
# mkdir /dev/cgroup
-# mount -t cgroup -o devices,cpu,memory none /dev/cgroup
+# mount -t cgroup -o devices,cpu,memory,blkio none /dev/cgroup
#
# They can be mounted anywhere, and different controllers
# can be mounted in different locations. libvirt will detect
# where they are located.
#
-# cgroup_controllers = [ "cpu", "devices", "memory" ]
+# cgroup_controllers = [ "cpu", "devices", "memory", "blkio" ]
# This is the basic set of devices allowed / required by
# all virtual machines.
--
1.7.1
13 years, 5 months
[libvirt] [PATCH 1/2] maint: rename virtaudit to match file contents
by Eric Blake
* src/util/virtaudit.[ch]: Rename...
* src/util/viraudit.[ch]: ...to match virAudit* API.
* src/Makefile.am (UTIL_SOURCES): Reflect rename.
* daemon/libvirtd.c: Likewise.
* po/POTFILES.in: Likewise.
* src/libvirt_private.syms: Likewise.
* src/qemu/qemu_audit.c: Likewise.
---
First suggested here:
https://www.redhat.com/archives/libvir-list/2011-April/msg00368.html
although we still don't have viratomic.h or virobject.h implemented yet.
daemon/libvirtd.c | 2 +-
po/POTFILES.in | 2 +-
src/Makefile.am | 2 +-
src/libvirt_private.syms | 2 +-
src/qemu/qemu_audit.c | 2 +-
src/util/{virtaudit.c => viraudit.c} | 4 ++--
src/util/{virtaudit.h => viraudit.h} | 4 ++--
7 files changed, 9 insertions(+), 9 deletions(-)
rename src/util/{virtaudit.c => viraudit.c} (98%)
rename src/util/{virtaudit.h => viraudit.h} (96%)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index a4198d9..97db696 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -52,7 +52,7 @@
#include "remote_driver.h"
#include "hooks.h"
#include "uuid.h"
-#include "virtaudit.h"
+#include "viraudit.h"
#ifdef WITH_DRIVER_MODULES
# include "driver.h"
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 32eaa2d..1b63378 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -120,7 +120,7 @@ src/util/stats_linux.c
src/util/storage_file.c
src/util/sysinfo.c
src/util/util.c
-src/util/virtaudit.c
+src/util/viraudit.c
src/util/virterror.c
src/util/xml.c
src/vbox/vbox_MSCOMGlue.c
diff --git a/src/Makefile.am b/src/Makefile.am
index cd8a7e9..ff85db3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -79,8 +79,8 @@ UTIL_SOURCES = \
util/threadpool.c util/threadpool.h \
util/uuid.c util/uuid.h \
util/util.c util/util.h \
+ util/viraudit.c util/viraudit.h \
util/xml.c util/xml.h \
- util/virtaudit.c util/virtaudit.h \
util/virterror.c util/virterror_internal.h
EXTRA_DIST += util/threads-pthread.c util/threads-win32.c
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 1112398..4d78fcf 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1058,7 +1058,7 @@ virUUIDGenerate;
virUUIDParse;
-# virtaudit.h
+# viraudit.h
virAuditClose;
virAuditEncode;
virAuditLog;
diff --git a/src/qemu/qemu_audit.c b/src/qemu/qemu_audit.c
index 1baef40..1d88fb5 100644
--- a/src/qemu/qemu_audit.c
+++ b/src/qemu/qemu_audit.c
@@ -27,7 +27,7 @@
#include <sys/types.h>
#include "qemu_audit.h"
-#include "virtaudit.h"
+#include "viraudit.h"
#include "uuid.h"
#include "logging.h"
#include "memory.h"
diff --git a/src/util/virtaudit.c b/src/util/viraudit.c
similarity index 98%
rename from src/util/virtaudit.c
rename to src/util/viraudit.c
index 560f7b7..ebf3119 100644
--- a/src/util/virtaudit.c
+++ b/src/util/viraudit.c
@@ -1,5 +1,5 @@
/*
- * virtaudit.c: auditing support
+ * viraudit.c: auditing support
*
* Copyright (C) 2010-2011 Red Hat, Inc.
*
@@ -29,7 +29,7 @@
#include "virterror_internal.h"
#include "logging.h"
-#include "virtaudit.h"
+#include "viraudit.h"
#include "util.h"
#include "files.h"
#include "memory.h"
diff --git a/src/util/virtaudit.h b/src/util/viraudit.h
similarity index 96%
rename from src/util/virtaudit.h
rename to src/util/viraudit.h
index a558a17..9d8c359 100644
--- a/src/util/virtaudit.h
+++ b/src/util/viraudit.h
@@ -1,7 +1,7 @@
/*
- * virtaudit.h: auditing support
+ * viraudit.h: auditing support
*
- * Copyright (C) 2010 Red Hat, Inc.
+ * Copyright (C) 2010-2011 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
--
1.7.4.4
13 years, 5 months
[libvirt] [PATCH] remote/ssh: support for no_verify.
by Oskari Saarenmaa
Set StrictHostKeyChecking=no to auto-accept new ssh host keys if the
no_verify extra parameter was specified. This won't disable host key
checking for already known hosts.
---
src/remote/remote_driver.c | 1 +
src/rpc/virnetclient.c | 3 ++-
src/rpc/virnetclient.h | 1 +
src/rpc/virnetsocket.c | 3 +++
src/rpc/virnetsocket.h | 1 +
tests/virnetsockettest.c | 2 ++
6 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index f318740..a2f54c8 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -571,6 +571,7 @@ doRemoteOpen (virConnectPtr conn,
command,
username,
no_tty,
+ no_verify,
netcat ? netcat : "nc",
sockname)))
goto failed;
diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
index b551b99..fc0fef8 100644
--- a/src/rpc/virnetclient.c
+++ b/src/rpc/virnetclient.c
@@ -187,12 +187,13 @@ virNetClientPtr virNetClientNewSSH(const char *nodename,
const char *binary,
const char *username,
bool noTTY,
+ bool noVerify,
const char *netcat,
const char *path)
{
virNetSocketPtr sock;
- if (virNetSocketNewConnectSSH(nodename, service, binary, username, noTTY, netcat, path, &sock) < 0)
+ if (virNetSocketNewConnectSSH(nodename, service, binary, username, noTTY, noVerify, netcat, path, &sock) < 0)
return NULL;
return virNetClientNew(sock, NULL);
diff --git a/src/rpc/virnetclient.h b/src/rpc/virnetclient.h
index de0782c..6acdf50 100644
--- a/src/rpc/virnetclient.h
+++ b/src/rpc/virnetclient.h
@@ -44,6 +44,7 @@ virNetClientPtr virNetClientNewSSH(const char *nodename,
const char *binary,
const char *username,
bool noTTY,
+ bool noVerify,
const char *netcat,
const char *path);
diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index 4b0c2ee..e827b4f 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -576,6 +576,7 @@ int virNetSocketNewConnectSSH(const char *nodename,
const char *binary,
const char *username,
bool noTTY,
+ bool noVerify,
const char *netcat,
const char *path,
virNetSocketPtr *retsock)
@@ -596,6 +597,8 @@ int virNetSocketNewConnectSSH(const char *nodename,
if (noTTY)
virCommandAddArgList(cmd, "-T", "-o", "BatchMode=yes",
"-e", "none", NULL);
+ if (noVerify)
+ virCommandAddArgList(cmd, "-oStrictHostKeyChecking=no", NULL);
virCommandAddArgList(cmd, nodename,
netcat ? netcat : "nc",
"-U", path, NULL);
diff --git a/src/rpc/virnetsocket.h b/src/rpc/virnetsocket.h
index 356d6c6..5f882ac 100644
--- a/src/rpc/virnetsocket.h
+++ b/src/rpc/virnetsocket.h
@@ -67,6 +67,7 @@ int virNetSocketNewConnectSSH(const char *nodename,
const char *binary,
const char *username,
bool noTTY,
+ bool noVerify,
const char *netcat,
const char *path,
virNetSocketPtr *addr);
diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c
index f6c7274..87f3dfa 100644
--- a/tests/virnetsockettest.c
+++ b/tests/virnetsockettest.c
@@ -377,6 +377,7 @@ struct testSSHData {
const char *binary;
const char *username;
bool noTTY;
+ bool noVerify;
const char *netcat;
const char *path;
@@ -397,6 +398,7 @@ static int testSocketSSH(const void *opaque)
data->binary,
data->username,
data->noTTY,
+ data->noVerify,
data->netcat,
data->path,
&csock) < 0)
--
1.7.5.4
13 years, 5 months
[libvirt] [PATCH] qemu: Free previous error
by Michal Privoznik
virCopyLastError simply overwrites destination, which may lead to leak
if there already was error. Therefore we need first to free destination.
---
src/qemu/qemu_migration.c | 1 +
src/qemu/qemu_monitor.c | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 3e4f4fe..56dd26b 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1586,6 +1586,7 @@ static void qemuMigrationIOFunc(void *arg)
return;
error:
+ virResetError(&data->err);
virCopyLastError(&data->err);
virResetLastError();
}
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 8573262..66a4e48 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -603,6 +603,7 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) {
if (!err)
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Error while processing monitor IO"));
+ virResetError(&mon->lastError);
virCopyLastError(&mon->lastError);
virResetLastError();
}
--
1.7.5.rc3
13 years, 5 months
[libvirt] [PATCH] Fix virsh inject-nmi man page
by KAMEZAWA Hiroyuki
>From e61aba3ed00b0d84233f75cc892ac13f06f9021e Mon Sep 17 00:00:00 2001
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu(a)jp.fujitsu.com>
Date: Tue, 12 Jul 2011 14:22:45 +0900
Subject: [PATCH] Fix inject-nmi virsh man page
fix the placement.
---
tools/virsh.pod | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 8b820d2..d1c285f 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -261,6 +261,10 @@ description see:
L<http://libvirt.org/formatcaps.html>
The XML also show the NUMA topology information if available.
+=item B<inject-nmi> I<domain-id>
+
+Inject NMI to the guest.
+
=item B<list> optional I<--inactive> I<--all>
Prints information about one or more domains. If no domains are
@@ -304,10 +308,6 @@ running B<virsh suspend>. When in a paused state the domain will still
consume allocated resources like memory, but will not be eligible for
scheduling by the hypervisor.
-=item B<inject-nmi> I<domain-id>
-
-Inject NMI to the guest
-
=item B<shutdown>
The domain is in the process of shutting down, i.e. the guest operating system
--
1.7.4.1
13 years, 5 months
[libvirt] Questions on libvirt storage internals
by Shehjar Tikoo
Hi All
I am working on integrating GlusterFS with OpenStack so that VM volumes can
be placed on shared GlusterFS volumes. I would highly appreciate if you
please help me find the answers to some questions:
1. Whats the difference between a storage driver and a storage backend driver?
2. Why does virDomainAttachDevice code path call the corresponding
domainAttach function in the hypervisor driver and not the volume or pool
creation method if a disk is being attached? Does it assume that the volume
has already been created before this call?
3. Which part of libvirtd source handles receiving messages from the
libvirt client?
Thanks
-Shehjar
13 years, 5 months