[libvirt] [PATCH] node_device: udev: Use base 16 for product/vendor
by Cole Robinson
udev doesn't prefix USB product/vendor info with '0x', so the
strtol conversions were wrong for the product field (vendor already
set the correct base). Make the change for PCI product/vendor as
well to be safe.
This fixes USB device assignment via virt-manager.
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
src/node_device/node_device_udev.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 7a9c1e5..55cfee2 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -457,14 +457,14 @@ static int udevProcessPCI(struct udev_device *device,
if (udevGetUintSysfsAttr(device,
"vendor",
&data->pci_dev.vendor,
- 0) == PROPERTY_ERROR) {
+ 16) == PROPERTY_ERROR) {
goto out;
}
if (udevGetUintSysfsAttr(device,
"device",
&data->pci_dev.product,
- 0) == PROPERTY_ERROR) {
+ 16) == PROPERTY_ERROR) {
goto out;
}
@@ -522,7 +522,7 @@ static int udevProcessUSBDevice(struct udev_device *device,
if (udevGetUintProperty(device,
"ID_MODEL_ID",
&data->usb_dev.product,
- 0) == PROPERTY_ERROR) {
+ 16) == PROPERTY_ERROR) {
goto out;
}
--
1.6.5.2
14 years, 11 months
[libvirt] VMware vCenter support
by Fulop, Balazs
Dear List,
I find the ESX driver in libvirt quite useful to perform powercycle operations on a VM. However, I need to connect to an ESX server even when the VM is managed on the VMware 4.0 platform.
Reading this mail:
http://www.mail-archive.com/libvir-list@redhat.com/msg18259.html
makes me think that support to connect directly to a vCenter using the scheme vpx:// is not far from becoming a reality. Could you please provide an estimated timeline for this and notes on possible further enhancements in the ESX driver code?
Thank you very much in advance.
Regards,
Balazs Fulop
--------------------------------------------------------------------------
NOTICE: If received in error, please destroy, and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error. We may monitor and store emails to the extent permitted by applicable law.
14 years, 11 months
[libvirt] Problem with libvirt-0.7.5 windows port
by anuj rampal
Hi,
I'm trying to cross compile the libvirt-0.7.5 for windows.
This is the error I'm getting:
# make
make all-recursive
make[1]: Entering directory `/root/libvirt-0.7.5'
Making all in gnulib/lib
make[2]: Entering directory `/root/libvirt-0.7.5/gnulib/lib'
[...]
Making all in tools
make[2]: Entering directory `/root/libvirt-0.7.5/tools'
make all-am
make[3]: Entering directory `/root/libvirt-0.7.5/tools'
CC virsh-console.o
CC virsh-virsh.o
CCLD virsh.exe
../src/.libs/libvirt.a: could not read symbols: Archive has no index; run
ranlib to add one
collect2: ld returned 1 exit status
make[3]: *** [virsh.exe] Error 1
make[3]: Leaving directory `/root/libvirt-0.7.5/tools'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/root/libvirt-0.7.5/tools'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/libvirt-0.7.5'
make: *** [all] Error 2
Does any1 has any idea.
Thanks in advance.
Regards
Anuj
14 years, 11 months
[libvirt] [PATCH] Implement path lookup for USB by vendor:product
by Cole Robinson
Based off how QEMU does it, look through /sys/bus/usb/devices/* for
matching vendor:product info, and if found, use info from the surrounding
files to build the device's /dev/bus/usb path.
This fixes USB device assignment by vendor:product when running qemu
as non-root (well, it should, but for some reason I couldn't reproduce
the failure people are seeing in [1], but it appears to work properly)
[1] https://bugzilla.redhat.com/show_bug.cgi?id=542450
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
po/POTFILES.in | 1 +
src/qemu/qemu_driver.c | 9 +--
src/security/security_selinux.c | 8 ++-
src/security/virt-aa-helper.c | 7 ++-
src/util/hostusb.c | 97 +++++++++++++++++++++++++++++++++++++-
src/util/hostusb.h | 4 +-
6 files changed, 112 insertions(+), 14 deletions(-)
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 1ab0859..22e9c3c 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -54,6 +54,7 @@ src/uml/uml_conf.c
src/uml/uml_driver.c
src/util/bridge.c
src/util/conf.c
+src/util/hostusb.c
src/util/json.c
src/util/logging.c
src/util/pci.c
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index deb8adc..f03ce91 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -2105,14 +2105,11 @@ static int qemuDomainSetHostdevUSBOwnership(virConnectPtr conn,
struct qemuFileOwner owner = { uid, gid };
int ret = -1;
- /* XXX what todo for USB devs assigned based on product/vendor ? Doom :-( */
- if (!def->source.subsys.u.usb.bus ||
- !def->source.subsys.u.usb.device)
- return 0;
-
usbDevice *dev = usbGetDevice(conn,
def->source.subsys.u.usb.bus,
- def->source.subsys.u.usb.device);
+ def->source.subsys.u.usb.device,
+ def->source.subsys.u.usb.vendor,
+ def->source.subsys.u.usb.product);
if (!dev)
goto cleanup;
diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
index 000bc8a..e015c06 100644
--- a/src/security/security_selinux.c
+++ b/src/security/security_selinux.c
@@ -484,7 +484,9 @@ SELinuxSetSecurityHostdevLabel(virConnectPtr conn,
if (dev->source.subsys.u.usb.bus && dev->source.subsys.u.usb.device) {
usbDevice *usb = usbGetDevice(conn,
dev->source.subsys.u.usb.bus,
- dev->source.subsys.u.usb.device);
+ dev->source.subsys.u.usb.device,
+ dev->source.subsys.u.usb.vendor,
+ dev->source.subsys.u.usb.product);
if (!usb)
goto done;
@@ -556,7 +558,9 @@ SELinuxRestoreSecurityHostdevLabel(virConnectPtr conn,
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: {
usbDevice *usb = usbGetDevice(conn,
dev->source.subsys.u.usb.bus,
- dev->source.subsys.u.usb.device);
+ dev->source.subsys.u.usb.device,
+ dev->source.subsys.u.usb.vendor,
+ dev->source.subsys.u.usb.product);
if (!usb)
goto done;
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 35b29ad..6a52d4c 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -839,8 +839,11 @@ get_files(vahControl * ctl)
if (dev->source.subsys.u.usb.bus &&
dev->source.subsys.u.usb.device) {
usbDevice *usb = usbGetDevice(NULL,
- dev->source.subsys.u.usb.bus,
- dev->source.subsys.u.usb.device);
+ dev->source.subsys.u.usb.bus,
+ dev->source.subsys.u.usb.device,
+ dev->source.subsys.u.usb.vendor,
+ dev->source.subsys.u.usb.product);
+
if (usb == NULL)
continue;
rc = usbDeviceFileIterate(NULL, usb,
diff --git a/src/util/hostusb.c b/src/util/hostusb.c
index 07e10b1..3e9ac83 100644
--- a/src/util/hostusb.c
+++ b/src/util/hostusb.c
@@ -37,9 +37,10 @@
#include "util.h"
#include "virterror_internal.h"
+#define USB_SYSFS "/sys/bus/usb"
#define USB_DEVFS "/dev/bus/usb/"
-#define USB_ID_LEN 10 /* "XXXX XXXX" */
-#define USB_ADDR_LEN 8 /* "XXX:XXX" */
+#define USB_ID_LEN 10 /* "1234 5678" */
+#define USB_ADDR_LEN 8 /* "123:456" */
struct _usbDevice {
unsigned bus;
@@ -57,11 +58,95 @@ struct _usbDevice {
virReportErrorHelper(conn, VIR_FROM_NONE, code, __FILE__, \
__FUNCTION__, __LINE__, fmt)
+static int usbSysReadFile(virConnectPtr conn,
+ const char *f_name, const char *d_name,
+ const char *fmt, unsigned *value)
+{
+ int ret = -1;
+ char *buf = NULL;
+ char filename[PATH_MAX];
+
+ snprintf(filename, PATH_MAX, USB_SYSFS "/devices/%s/%s", d_name, f_name);
+
+ if (virFileReadAll(filename, 1024, &buf) < 0)
+ goto error;
+
+ if (sscanf(buf, fmt, value) != 1) {
+ virReportSystemError(conn, errno,
+ _("Could not parse usb file %s"), filename);
+ goto error;
+ }
+
+ ret = 0;
+error:
+ VIR_FREE(buf);
+ return ret;
+}
+
+static int usbFindBusByVendor(virConnectPtr conn,
+ unsigned vendor, unsigned product,
+ unsigned *bus, unsigned *devno)
+{
+ DIR *dir = NULL;
+ int ret = -1, found = 0;
+ struct dirent *de;
+
+ dir = opendir(USB_SYSFS "/devices");
+ if (!dir) {
+ virReportSystemError(conn, errno,
+ _("Could not open directory %s"),
+ USB_SYSFS "/devices");
+ goto error;
+ }
+
+ while ((de = readdir(dir))) {
+ unsigned found_prod, found_vend;
+ if (de->d_name[0] == '.' || strchr(de->d_name, ':'))
+ continue;
+
+ if (usbSysReadFile(conn, "idVendor", de->d_name,
+ "%x", &found_vend) < 0)
+ goto error;
+ if (usbSysReadFile(conn, "idProduct", de->d_name,
+ "%x", &found_prod) < 0)
+ goto error;
+
+ if (found_prod == product && found_vend == vendor) {
+ /* Lookup bus.addr info */
+ char *tmpstr = de->d_name;
+ unsigned found_bus, found_addr;
+
+ if (STREQ(de->d_name, "usb"))
+ tmpstr += 3;
+ found_bus = atoi(tmpstr);
+
+ if (usbSysReadFile(conn, "devnum", de->d_name,
+ "%d", &found_addr) < 0)
+ goto error;
+
+ *bus = found_bus;
+ *devno = found_addr;
+ found = 1;
+ break;
+ }
+ }
+
+ if (!found)
+ usbReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("Did not find USB device %x:%x"), vendor, product);
+ else
+ ret = 0;
+
+error:
+ return ret;
+}
usbDevice *
usbGetDevice(virConnectPtr conn,
unsigned bus,
- unsigned devno)
+ unsigned devno,
+ unsigned vendor,
+ unsigned product)
{
usbDevice *dev;
@@ -70,6 +155,12 @@ usbGetDevice(virConnectPtr conn,
return NULL;
}
+ if (vendor) {
+ /* Look up bus.dev by vendor:product */
+ if (usbFindBusByVendor(conn, vendor, product, &bus, &devno) < 0)
+ return NULL;
+ }
+
dev->bus = bus;
dev->dev = devno;
diff --git a/src/util/hostusb.h b/src/util/hostusb.h
index 7f75c8b..739a4aa 100644
--- a/src/util/hostusb.h
+++ b/src/util/hostusb.h
@@ -28,7 +28,9 @@ typedef struct _usbDevice usbDevice;
usbDevice *usbGetDevice (virConnectPtr conn,
unsigned bus,
- unsigned devno);
+ unsigned devno,
+ unsigned vendor,
+ unsigned product);
void usbFreeDevice (virConnectPtr conn,
usbDevice *dev);
--
1.6.5.2
14 years, 11 months
[libvirt] [PATCH] Implement CPU topology support for QEMU driver
by Jiri Denemark
QEMU's command line equivalent for the following domain XML fragment
<vcpus>2</vcpus>
<cpu ...>
...
<topology sockets='1' cores='2', threads='1'/>
</cpu>
is
-smp 2,sockets=1,cores=2,threads=1
This syntax was introduced in QEMU-0.12.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_conf.c | 137 ++++++++++++++++++++++++++++++++++++++++++++------
src/qemu/qemu_conf.h | 3 +-
2 files changed, 123 insertions(+), 17 deletions(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index d3da776..bc4736a 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1,7 +1,7 @@
/*
* qemu_conf.c: QEMU configuration management
*
- * Copyright (C) 2006, 2007, 2008, 2009 Red Hat, Inc.
+ * Copyright (C) 2006, 2007, 2008, 2009, 2010 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -1115,6 +1115,10 @@ static unsigned int qemudComputeCmdFlags(const char *help,
flags |= QEMUD_CMD_FLAG_CHARDEV;
if (strstr(help, "-balloon"))
flags |= QEMUD_CMD_FLAG_BALLOON;
+ if (strstr(help, "cores=") &&
+ strstr(help, "threads=") &&
+ strstr(help, "sockets="))
+ flags |= QEMUD_CMD_FLAG_SMP_TOPOLOGY;
if (version >= 9000)
flags |= QEMUD_CMD_FLAG_VNC_COLON;
@@ -1900,7 +1904,6 @@ int qemudBuildCommandLine(virConnectPtr conn,
const char *migrateFrom) {
int i;
char memory[50];
- char vcpus[50];
char boot[VIR_DOMAIN_BOOT_LAST];
struct utsname ut;
int disableKQEMU = 0;
@@ -2049,7 +2052,6 @@ int qemudBuildCommandLine(virConnectPtr conn,
* is not supported, then they're out of luck anyway
*/
snprintf(memory, sizeof(memory), "%lu", def->maxmem/1024);
- snprintf(vcpus, sizeof(vcpus), "%lu", def->vcpus);
snprintf(domid, sizeof(domid), "%d", def->id);
ADD_ENV_LIT("LC_ALL=C");
@@ -2112,8 +2114,34 @@ int qemudBuildCommandLine(virConnectPtr conn,
ADD_ARG_LIT("-mem-path");
ADD_ARG_LIT(driver->hugepage_path);
}
+
ADD_ARG_LIT("-smp");
- ADD_ARG_LIT(vcpus);
+ if ((qemuCmdFlags & QEMUD_CMD_FLAG_SMP_TOPOLOGY) && def->cpu) {
+ virBuffer buf = VIR_BUFFER_INITIALIZER;
+
+ virBufferVSprintf(&buf, "%lu", def->vcpus);
+
+ if (def->cpu->sockets > 0)
+ virBufferVSprintf(&buf, ",sockets=%u", def->cpu->sockets);
+
+ if (def->cpu->cores > 0)
+ virBufferVSprintf(&buf, ",cores=%u", def->cpu->cores);
+
+ if (def->cpu->threads > 0)
+ virBufferVSprintf(&buf, ",threads=%u", def->cpu->threads);
+
+ if (virBufferError(&buf)) {
+ virBufferFreeAndReset(&buf);
+ goto no_memory;
+ }
+
+ ADD_ARG(virBufferContentAndReset(&buf));
+ }
+ else {
+ char vcpus[50];
+ snprintf(vcpus, sizeof(vcpus), "%lu", def->vcpus);
+ ADD_ARG_LIT(vcpus);
+ }
if (qemuCmdFlags & QEMUD_CMD_FLAG_NAME) {
ADD_ARG_LIT("-name");
@@ -3729,6 +3757,27 @@ error:
}
+static virCPUDefPtr
+qemuInitGuestCPU(virConnectPtr conn,
+ virDomainDefPtr dom)
+{
+ if (!dom->cpu) {
+ virCPUDefPtr cpu;
+
+ if (VIR_ALLOC(cpu) < 0) {
+ virReportOOMError(conn);
+ return NULL;
+ }
+
+ cpu->type = VIR_CPU_TYPE_GUEST;
+ cpu->match = VIR_CPU_MATCH_EXACT;
+ dom->cpu = cpu;
+ }
+
+ return dom->cpu;
+}
+
+
static int
qemuParseCommandLineCPU(virConnectPtr conn,
virDomainDefPtr dom,
@@ -3738,10 +3787,8 @@ qemuParseCommandLineCPU(virConnectPtr conn,
const char *p = val;
const char *next;
- if (VIR_ALLOC(cpu) < 0)
- goto no_memory;
-
- cpu->type = VIR_CPU_TYPE_GUEST;
+ if (!(cpu = qemuInitGuestCPU(conn, dom)))
+ goto error;
do {
if (*p == '\0' || *p == ',')
@@ -3785,7 +3832,6 @@ qemuParseCommandLineCPU(virConnectPtr conn,
}
} while ((p = next));
- dom->cpu = cpu;
return 0;
syntax:
@@ -3796,7 +3842,71 @@ syntax:
no_memory:
virReportOOMError(conn);
error:
- virCPUDefFree(cpu);
+ return -1;
+}
+
+
+static int
+qemuParseCommandLineSmp(virConnectPtr conn,
+ virDomainDefPtr dom,
+ const char *val)
+{
+ const char *p = val;
+ const char *next;
+ const char *const options[] = { "sockets=", "cores=", "threads=" };
+ unsigned int topology[] = { 0, 0, 0 };
+ char *end;
+
+ do {
+ if (*p == '\0' || *p == ',')
+ goto syntax;
+
+ if ((next = strchr(p, ',')))
+ next++;
+
+ if (c_isdigit(*p)) {
+ int n;
+ if (virStrToLong_i(p, &end, 10, &n) < 0 ||
+ !end || (*end != ',' && *end != '\0'))
+ goto syntax;
+ dom->vcpus = n;
+ } else {
+ int i;
+ int n = -1;
+ for (i = 0; i < ARRAY_CARDINALITY(options); i++) {
+ if (STRPREFIX(p, options[i])) {
+ p += strlen(options[i]);
+ if (virStrToLong_i(p, &end, 10, &n) < 0 ||
+ !end || (*end != ',' && *end != '\0'))
+ goto syntax;
+ topology[i] = n;
+ break;
+ }
+ }
+
+ if (n < 0)
+ goto syntax;
+ }
+ } while ((p = next));
+
+ if (topology[0] && topology[1] && topology[2]) {
+ virCPUDefPtr cpu;
+
+ if (!(cpu = qemuInitGuestCPU(conn, dom)))
+ goto error;
+
+ cpu->sockets = topology[0];
+ cpu->cores = topology[1];
+ cpu->threads = topology[2];
+ } else if (topology[0] || topology[1] || topology[2])
+ goto syntax;
+
+ return 0;
+
+syntax:
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("cannot parse CPU topology '%s'"), val);
+error:
return -1;
}
@@ -3948,14 +4058,9 @@ virDomainDefPtr qemuParseCommandLine(virConnectPtr conn,
}
def->memory = def->maxmem = mem * 1024;
} else if (STREQ(arg, "-smp")) {
- int vcpus;
WANT_VALUE();
- if (virStrToLong_i(val, NULL, 10, &vcpus) < 0) {
- qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, \
- _("cannot parse CPU count '%s'"), val);
+ if (qemuParseCommandLineSmp(conn, def, val) < 0)
goto error;
- }
- def->vcpus = vcpus;
} else if (STREQ(arg, "-uuid")) {
WANT_VALUE();
if (virUUIDParse(val, def->uuid) < 0) {
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index 82254ca..3f74cc9 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -1,7 +1,7 @@
/*
* qemu_conf.h: QEMU configuration management
*
- * Copyright (C) 2006, 2007, 2009 Red Hat, Inc.
+ * Copyright (C) 2006, 2007, 2009, 2010 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -78,6 +78,7 @@ enum qemud_cmd_flags {
QEMUD_CMD_FLAG_ENABLE_KVM = (1 << 23), /* Is the -enable-kvm flag available to "enable KVM full virtualization support" */
QEMUD_CMD_FLAG_MONITOR_JSON = (1 << 24), /* JSON mode for monitor */
QEMUD_CMD_FLAG_BALLOON = (1 << 25), /* -balloon available */
+ QEMUD_CMD_FLAG_SMP_TOPOLOGY = (1 << 26), /* Is sockets=s,cores=c,threads=t available for -smp? */
};
/* Main driver state */
--
1.6.6
14 years, 11 months
[libvirt] [PATCH] Fix migration in xend driver
by Jim Fehlig
Upstream xen has changed parameters to the migration operation
several times over the past 18 months. Changeset 17553 removed
the resouce parameter, Changesets 17709, 17753, and 20326 added
ssl, node, and change_home_server parameters respectively.
Fortunately, testing has revealed that xend will fail the
operation if a parameter is missing but happily honor it if
unknown parameters are provided. Thus all currently supported
parameters can be provided, satisfying current xend but not
regressing older versions.
---
src/xen/xend_internal.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index be033f5..d9bfa15 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -4553,15 +4553,21 @@ xenDaemonDomainMigratePerform (virDomainPtr domain,
DEBUG("hostname = %s, port = %s", hostname, port);
- /* Make the call. */
+ /* Make the call.
+ * NB: xend will fail the operation if any parameters are
+ * missing but happily accept unknown parameters. This works
+ * to our advantage since all parameters supported and required
+ * by current xend can be included without breaking older xend.
+ */
ret = xend_op (domain->conn, domain->name,
"op", "migrate",
"destination", hostname,
"live", live,
"port", port,
- "node", "-1",
- "ssl", "0",
- "resource", "0", /* required, xend ignores it */
+ "node", "-1", /* xen-unstable c/s 17753 */
+ "ssl", "0", /* xen-unstable c/s 17709 */
+ "change_home_server", "0", /* xen-unstable c/s 20326 */
+ "resource", "0", /* removed by xen-unstable c/s 17553 */
NULL);
VIR_FREE (hostname);
--
1.6.0.2
14 years, 11 months
[libvirt] Start external programm on network-setup
by Dominik Bruhn
Hy,
im using libvirt-bin on debian and configured the network of libvirt to
be a standalone bridge. Is there a possibility to run a program after
the bridge has successfully and completly set up by libvirtd? I would
like to restart shorewall (a firewall) when the bridge is set up to
activate MASQ and DNAT and other policies which I need. I would also
like to start my own configured dnsmasq when the interface is up (can't
start it realier because it has to bind to the interface).
I hope thats the right place to ask such a question, if not, please
direct me.
Thanks for the help
--
Dominik
mailto: dominik(a)dbruhn.de
14 years, 11 months
[libvirt] Problem: cannot make libvirtd listen to TCP sockets
by Motiejus Jakštys
Hello,
I don't know if I am writing to the proper place, but I've been
struggling quite a long time with connecting to libvirtd. Any
information would help.
My goal is to start remote tcp connection (afterwards - tls, but
later) and connect to the libvirtd.
http://libvirt.org/uri.html#URI_remote
There are some nitoces when starting libvirtd:
-~*~--~*~--~*~--~*~--~*~--~*~--~*~--~*~--~*~--~*~--~*~--~*~-
xen:/usr/local/etc# libvirtd
17:53:42.153: error : virRun:847 : internal error '/sbin/iptables
--table filter --insert FORWARD --destination
192.168.122.0/255.255.255.0 --out-interface virbr0 --match state
--state ESTABLISHED,RELATED --jump ACCEPT' exited with non-zero status
1 and signal 0: iptables: No chain/target/match by that name
17:53:42.153: error : networkAddMasqueradingIptablesRules:615 : failed
to add iptables rule to allow forwarding to 'virbr0': Invalid argument
17:53:42.354: warning : qemudStartup:1067 : Unable to create cgroup
for driver: No such device or address
17:53:42.372: warning : lxcStartup:1755 : Unable to create cgroup for
driver: No such device or address
17:53:43.259: warning : qemudDispatchSignalEvent:385 : Shutting down on signal 2
-~*~--~*~--~*~--~*~--~*~--~*~--~*~--~*~--~*~--~*~--~*~--~*~-
libvirtd keeps running, however it does not open ANY new ports to
listening state. Extract from /usr/local/etc/libvirt/libvirtd.conf :
(full conf here: http://pastebin.com/f6e0f572)
listen_tls = 1
listen_tcp = 1
/usr/local/var/log/libvirt has 3 empty directories: {lxc,qemu,uml}, so
nothing logged.
xen:/# virsh list
shows my current running domains, so looks like libvirt is fine.
I have compiled XEN and libvirt from source (0.7.4, then upgraded
0.7.5, got same errors on both versions).
Additional information:
I am running three guest domains, all bridged to eth0 (peth0 ethernet
card -> eth0 bridge -> vifs), from xend-config.sxp:
(network-script network-bridge)
Debian lenny
Linux xen 2.6.18.8-xen0 #1 SMP Fri Nov 27 18:17:01 EET 2009 x86_64 GNU/Linux
(here is kernel config: http://pastebin.com/f393c78f0)
Note: I compiled iptables as a module manually, however without IMQ
support, since it failed to compile.
I have installed Xen 3.4.2, however virsh thinks it's 3.4.0
-~*~--~*~--~*~--~*~--~*~--~*~--~*~--~*~--~*~--~*~--~*~--~*~-
virsh # version
Compiled against library: libvir 0.7.5
Using library: libvir 0.7.5
Using API: Xen 3.0.1
Running hypervisor: Xen 3.4.0
-~*~--~*~--~*~--~*~--~*~--~*~--~*~--~*~--~*~--~*~--~*~--~*~-
Any suggestions how to properly start libvirtd, pointers to other
related mailing-lists or forums are very welcome.
Thank you!
Motiejus Jakštys
14 years, 11 months
[libvirt] [PATCH 0/5] Fix various error squashing issues
by Cole Robinson
The following series adds internal APIs that help prevent
legitimate errors from being overwritten by other errors
(for example in cleanup routines).
The majority of this series is a patch from Dan[1] which makes
error callbacks explictly triggered when exiting an API call,
rather than when an error is raised (I've updated this to cover
the current codebase)
[1] http://gitorious.org/~berrange/libvirt/staging/commits/error-callbacks
Cole Robinson (4):
virterror: Add virSetError
qemu: migrate: Save MigratePerform error in MigrateFinish.
libvirt.c: Preserve MigratePerform failure
qemu: Disable errors in qemudShutdownVMDaemon
Daniel P. Berrange (1):
Ensure error handling callback functions are called from safe context
src/libvirt.c | 849 +++++++++++++++++++++++------------------
src/libvirt_private.syms | 1 +
src/qemu/qemu_driver.c | 18 +
src/util/virterror.c | 102 +++---
src/util/virterror_internal.h | 4 +-
5 files changed, 548 insertions(+), 426 deletions(-)
14 years, 11 months