[libvirt][PATCH] running libvirt on the latest kvm snapshot
by Anton Protopopov
Hi.
Libvirt tryes to extract kvm version from the string
"QEMU PC emulator version <major>.<minor>.<micro> (kvm-<version>)..."
For examle,
# kvm -help | head -1
QEMU PC emulator version 0.10.0 (kvm-85), Copyright (c) 2003-2008 Fabrice
Bellard
The problem occures if you are trying to run it on the devel version of kvm:
# kvm -help | head -1
QEMU PC emulator version 0.10.0 (kvm-devel), Copyright (c) 2003-2008
Fabrice Bellard
The virParseNumber() obvioulsy fails on the "devel" string here. I
proposeto setup
`kvm_version' to 1000 (that's enough, I think) in that case, so all checks,
such as
if (kvm_version > 74) ...
will pass.
15 years, 4 months
[libvirt] Is it possible to use more then 2 CPUs in the guest?
by Mirko Raasch
Hi,
in my server i use an Intel Quad Core CPU and i want to use in one
WindowsXP guest all 4 cores.
The device manager shows four CPU (Qemu Virtual CPU version 0.10.5).
When i start prime95 or superpi, only 2 of them are in use. CPU-Z shows
also 2 Cores, instead of 4 like the device manager.
How can i use all four cores in the guest?
Greetings
15 years, 4 months
[libvirt] ABI compliance checker
by Андрей Пономаренко
Colleagues, I'm from Institute for System
Programing of Russian Academy of Sciences and we are developing a free
lightweight tool for checking backward/forward binary compatibility of
shared C/C++ libraries in OS Linux. It checks interface signatures and
data type definitions in two library versions (headers and shared
objects) and searches ABI changes that may lead to incompatibility.
We have released 1.2 version of this tool and we'd like you to consider
its usefulness for your project.
The wiki-page with the latest release of binary compatibility checker is
http://ispras.linux-foundation.org/index.php/ABI_compliance_checker
Andrey Ponomarenko
15 years, 4 months
[libvirt] [PATCH] Remove unsafe strncpy from esx_vmx.c
by Chris Lalancette
While trying to remove uses of unsafe strncpy in the tree, I came
across a couple of usage in the ESX driver. To my eyes, the snprintf
replacements do the same thing in less code, and are also safer.
This has been compile tested only. Mattias, is there any reason we
can't use these simpler (and safer) string routines?
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
Cc: Mattias Bolte <matthias.bolte(a)googlemail.com>
---
src/esx/esx_vmx.c | 22 +++++++---------------
1 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/src/esx/esx_vmx.c b/src/esx/esx_vmx.c
index af5234e..91a86e2 100644
--- a/src/esx/esx_vmx.c
+++ b/src/esx/esx_vmx.c
@@ -397,10 +397,7 @@ def->parallels[0]...
#define ESX_BUILD_VMX_NAME(_suffix) \
do { \
- strncpy(_suffix##_name, prefix, sizeof (_suffix##_name) - 1); \
- _suffix##_name[sizeof (_suffix##_name) - 1] = '\0'; \
- strncat(_suffix##_name, "."#_suffix, \
- sizeof (_suffix##_name) - 1 - strlen(_suffix##_name)); \
+ snprintf(_suffix##_name, sizeof(_suffix##_name), "%s."#_suffix, prefix); \
} while (0)
@@ -839,11 +836,9 @@ esxVMX_ParseSCSIController(virConnectPtr conn, virConfPtr conf, int controller,
goto failure;
}
- strncpy(present_name, "scsiX.present", sizeof (virtualDev_name));
- strncpy(virtualDev_name, "scsiX.virtualDev", sizeof (virtualDev_name));
-
- present_name[4] = '0' + controller;
- virtualDev_name[4] = '0' + controller;
+ snprintf(present_name, sizeof(present_name), "scsi%d.present", controller);
+ snprintf(virtualDev_name, sizeof(virtualDev_name), "scsi%d.virtualDev",
+ controller);
if (esxUtil_GetConfigBoolean(conn, conf, present_name, present, 0, 1) < 0) {
goto failure;
@@ -1333,8 +1328,7 @@ esxVMX_ParseEthernet(virConnectPtr conn, virConfPtr conf, int controller,
goto failure;
}
- strncpy(prefix, "ethernetX", sizeof (prefix));
- prefix[8] = '0' + controller;
+ snprintf(prefix, sizeof(prefix), "ethernet%d", controller);
ESX_BUILD_VMX_NAME(present);
ESX_BUILD_VMX_NAME(startConnected);
@@ -1514,8 +1508,7 @@ esxVMX_ParseSerial(virConnectPtr conn, virConfPtr conf, int port,
goto failure;
}
- strncpy(prefix, "serialX", sizeof (prefix));
- prefix[6] = '0' + port;
+ snprintf(prefix, sizeof(prefix), "serial%d", port);
ESX_BUILD_VMX_NAME(present);
ESX_BUILD_VMX_NAME(startConnected);
@@ -1627,8 +1620,7 @@ esxVMX_ParseParallel(virConnectPtr conn, virConfPtr conf, int port,
goto failure;
}
- strncpy(prefix, "parallelX", sizeof (prefix));
- prefix[8] = '0' + port;
+ snprintf(prefix, sizeof(prefix), "parallel%d", port);
ESX_BUILD_VMX_NAME(present);
ESX_BUILD_VMX_NAME(startConnected);
--
1.6.0.6
15 years, 4 months
[libvirt] compiling one driver
by Henrique Teófilo
Hello,
I'm having problems to compile libvirt with opennebula driver.
I executed: ./autogen.sh --with-one
and got the following message:
configure: error: You must install XMLRPC-C >= 1.14.0 to compile libvirt ONE
driver
but I already have installed libxmlrpc version 1.16.07-1
Where to configure this? I've tried to set the environment variables
XMLRPC_CFLAGS and XMLRPC_LIBS, but nothing has changed.
So I've tried to change these variables directly on configure script, that
was empty, then errors started to appear on make execution:
../src/.libs/libvirt_driver_one.a(libvirt_driver_one_la-one_client.o): In
function `c_oneFree':
/home/objectweb/git/libvirt/src/./opennebula/one_client.c:207: undefined
reference to `xmlrpc_env_clean'
/home/objectweb/git/libvirt/src/./opennebula/one_client.c:208: undefined
reference to `xmlrpc_client_cleanup'
../src/.libs/libvirt_driver_one.a(libvirt_driver_one_la-one_client.o): In
function `c_oneReturnCode':
/home/objectweb/git/libvirt/src/./opennebula/one_client.c:49: undefined
reference to `xmlrpc_decompose_value'
.....etc...
What am I doing wrong??
Thanks,
Henrique Teófilo
15 years, 4 months
[libvirt] [PATCH 0/5] Various logging cleanups
by Amy Griffis
The following patches fixup libvirt's logging code, to hopefully make it
a little more consistent and predictable.
---
Amy Griffis (5):
Tighten libvirt's parsing of logging environment variables
Several fixes to libvirtd's log setup
Cleanup VIR_LOG_DEBUG parsing in eventtest
Consolidate code for parsing the logging environment variables
Update logging documentation
docs/logging.html.in | 22 +++++++-
qemud/qemud.c | 90 +++++++++++++++++---------------
src/libvirt.c | 19 -------
src/libvirt_private.syms | 5 ++
src/logging.c | 129 +++++++++++++++++++++++++++++++++++++++-------
src/logging.h | 5 ++
tests/eventtest.c | 12 +---
7 files changed, 190 insertions(+), 92 deletions(-)
15 years, 4 months
[libvirt] [PATCH] chown kernel/initrd before spawning qemu
by Mark McLoughlin
If we're running qemu unprivileged, we need to chown any supplied kernel
or initrd before spawning it.
* src/qemu_driver.c: rename qemuDomainSetDiskOwnership() to
qemuDomainSetFileOwnership(), pass it a path string instead of a disk
definition and use it for chowning the kernel/initrd in
qemuDomainSetAllDeviceOwnership()
---
src/qemu_driver.c | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index 412b68d..bd58435 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -1684,18 +1684,18 @@ static int qemuDomainSetHostdevOwnership(virConnectPtr conn,
}
-static int qemuDomainSetDiskOwnership(virConnectPtr conn,
- virDomainDiskDefPtr def,
+static int qemuDomainSetFileOwnership(virConnectPtr conn,
+ const char *path,
uid_t uid, gid_t gid)
{
- if (!def->src)
+ if (!path)
return 0;
- VIR_DEBUG("Setting ownership on %s to %d:%d", def->src, uid, gid);
- if (chown(def->src, uid, gid) < 0) {
+ VIR_DEBUG("Setting ownership on %s to %d:%d", path, uid, gid);
+ if (chown(path, uid, gid) < 0) {
virReportSystemError(conn, errno, _("cannot set ownership on %s"),
- def->src);
+ path);
return -1;
}
return 0;
@@ -1725,7 +1725,7 @@ static int qemuDomainSetDeviceOwnership(virConnectPtr conn,
(def->data.disk->readonly || def->data.disk->shared))
return 0;
- return qemuDomainSetDiskOwnership(conn, def->data.disk, uid, gid);
+ return qemuDomainSetFileOwnership(conn, def->data.disk->src, uid, gid);
case VIR_DOMAIN_DEVICE_HOSTDEV:
return qemuDomainSetHostdevOwnership(conn, def->data.hostdev, uid, gid);
@@ -1753,12 +1753,16 @@ static int qemuDomainSetAllDeviceOwnership(virConnectPtr conn,
uid = restore ? 0 : driver->user;
gid = restore ? 0 : driver->group;
+ if (qemuDomainSetFileOwnership(conn, def->os.kernel, uid, gid) < 0 ||
+ qemuDomainSetFileOwnership(conn, def->os.initrd, uid, gid) < 0)
+ return -1;
+
for (i = 0 ; i < def->ndisks ; i++) {
if (restore &&
(def->disks[i]->readonly || def->disks[i]->shared))
continue;
- if (qemuDomainSetDiskOwnership(conn, def->disks[i], uid, gid) < 0)
+ if (qemuDomainSetFileOwnership(conn, def->disks[i]->src, uid, gid) < 0)
return -1;
}
--
1.6.2.5
15 years, 4 months
[libvirt] virt-manager
by Michael Zeller
okay so using virt-manager it only lists my root partition as storage, or
atleast thats what it appears
So it says I can only make a vm the size of 9G when my home partition has
800+G
is there a way to change that?
15 years, 4 months