[libvirt] libvirt error while start vm with VGA passthrough
by mzawdx wang
http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtual...
I have followed the instructions in the RedHat reference
above to the best of my ability to understand them. I add
the pci multi-port serial io card through virt-manager and
it was indeed entered into the virtual machine's
configuration file inside the <devices> tag:
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
</source>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x07' function='0x0'/>
</hostdev>
However, when I try and start the virtual machine I get
this error:
Error starting domain: internal error Unable to reset PCI
device 0000:00:03.0: no FLR, PM reset or bus reset
available
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/asyncjob.py",
line 44, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/asyncjob.py",
line 65, in tmpcb
callback(*args, **kwargs)
File "/usr/share/virt-manager/virtManager/domain.py",
line 1050, in startup
self._backend.create()
File "/usr/lib64/python2.6/site-packages/libvirt.py",
line 511, in create
if ret == -1: raise libvirtError ('virDomainCreate()
failed', dom=self)
libvirtError: internal error Unable to reset PCI device
0000:00:03.0: no FLR, PM reset or bus reset available
The steps I followed were:
1. Check VT-D extensions available and enabled in BIOS - yes
2. Restart virtual host - yes
3. Identify device - yes
<address domain='0x000' bus='0x00' slot='0x03'
function='0x0'/>
4. Add device to virtual machine configuration - yes
. . .
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
</source>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x07' function='0x0'/>
</hostdev>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x06' function='0x0'/>
</memballoon>
</devices>
</domain>
5. Start virtual machine - fails
Am I making any obvious errors?
11 years, 9 months
[libvirt] [libvirt-php PATCH 0/2] *** Add libvirt_domain_migrate_to_uri2() for virDomainMigrateToURI2() ***
by stefan.kuhn@foss-group.ch
*** Please add new function libvirt_domain_migrate_to_uri2 for libirts virDomainMigrateToURI2(). ***
Stefan Kuhn (2):
Implement libvirt_domain_migrate_to_uri2 for virDomainMigrateToURI2
Document new funct. libvirt_domain_migrate_to_uri2
.../functions/libvirt-domain-get-job-info.xml | 1 +
.../functions/libvirt-domain-migrate-to-uri.xml | 5 +-
.../functions/libvirt-domain-migrate-to-uri2.xml | 134 +++++++++++++++++++++
.../libvirt/functions/libvirt-domain-migrate.xml | 3 +-
doc/source/libvirt/versions.xml | 1 +
src/libvirt-php.c | 53 ++++++++
src/libvirt-php.h | 1 +
7 files changed, 195 insertions(+), 3 deletions(-)
create mode 100644 doc/source/libvirt/functions/libvirt-domain-migrate-to-uri2.xml
--
1.7.12.4
11 years, 9 months
[libvirt] [PATCH] apibuild.py: fix TypeError raised in except clause
by Claudio Bley
When an exception happened inside the try clause in serialize_function,
a new exception was raised in the except clause subsequently:
Traceback (most recent call last):
File "./apibuild.py", line 2529, in <module>
rebuild("libvirt")
File "./apibuild.py", line 2513, in rebuild
builder.serialize()
File "./apibuild.py", line 2467, in serialize
self.serialize_function(output, function)
File "./apibuild.py", line 2208, in serialize_function
self.warning("Failed to save function %s info: " % name, `id.info`)
TypeError: warning() takes exactly 2 arguments (3 given)
Use the correct number of arguments for self.warning and print the
original exception to stderr.
Signed-off-by: Claudio Bley <cbley(a)av-test.de>
---
docs/apibuild.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docs/apibuild.py b/docs/apibuild.py
index 91dabf8..2d72936 100755
--- a/docs/apibuild.py
+++ b/docs/apibuild.py
@@ -2198,7 +2198,8 @@ class docBuilder:
output.write(" <arg name='%s' type='%s' info='%s'/>\n" % (param[1], param[0], escape(param[2])))
self.indexString(name, param[2])
except:
- self.warning("Failed to save function %s info: " % name, `id.info`)
+ print >>sys.stderr, "Exception:", sys.exc_info()[1]
+ self.warning("Failed to save function %s info: %s" % (name, `id.info`))
output.write(" </%s>\n" % (id.type))
def serialize_exports(self, output, file):
--
1.7.9.5
11 years, 9 months
[libvirt] [PATCH v2 0/7] documentation improvements
by Claudio Bley
Hi.
Version 2 of this series incorporates the following changes:
- patch #1 fail if documentation is missing
- reword subject line of patch #3 as suggessted by Eric
Incidently, patch #1 truthfully makes the build fail because
of missing documentation. Go figure :)
I'll submit a single patch with a fix shortly.
Claudio Bley (7):
docs: abort when missing return or argument documention
docs: only generate function argument info for args with a
description
docs: use div, not table, for notices on opaque types
docs: process code blocks similar to markdown
docs: add class "description" to div's containing descriptions
docs: define style of code blocks inside descriptions
docs: syntax highlight code blocks using SHJS
docs/apibuild.py | 15 +++-
docs/libvirt.css | 8 ++
docs/newapi.xsl | 209 +++++++++++++++++++++++++++++--------------------
docs/page.xsl | 5 +-
docs/sh_c.min.js | 1 +
docs/sh_emacs.min.css | 1 +
docs/sh_main.min.js | 4 +
7 files changed, 157 insertions(+), 86 deletions(-)
create mode 100644 docs/sh_c.min.js
create mode 100644 docs/sh_emacs.min.css
create mode 100644 docs/sh_main.min.js
--
1.7.9.5
11 years, 9 months
[libvirt] [PATCH] Enforce return check on virAsprintf() calls
by John Ferlan
Way back when I started making changes for Coverity messages my first set
were to a bunch of CHECKED_RETURN errors. In particular virAsprintf() had
a few callers that Coverity noted didn't check their return (although some
did check if the buffer being printed to was NULL or not).
It was suggested at the time as a further patch an ATTRIBUTE_RETURN_CHECK
should be added to virAsprintf(), see:
https://www.redhat.com/archives/libvir-list/2013-January/msg00120.html
This patch does that and fixes two more instances not found by Coverity
that failed the check.
---
src/util/virutil.h | 3 ++-
src/xen/xend_internal.c | 6 ++----
tests/networkxml2conftest.c | 5 +++--
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/util/virutil.h b/src/util/virutil.h
index 5a08c81..c386d24 100644
--- a/src/util/virutil.h
+++ b/src/util/virutil.h
@@ -200,7 +200,8 @@ int virParseNumber(const char **str);
int virParseVersionString(const char *str, unsigned long *version,
bool allowMissing);
int virAsprintf(char **strp, const char *fmt, ...)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_FMT_PRINTF(2, 3);
+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_FMT_PRINTF(2, 3)
+ ATTRIBUTE_RETURN_CHECK;
int virVasprintf(char **strp, const char *fmt, va_list list)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_FMT_PRINTF(2, 0);
char *virStrncpy(char *dest, const char *src, size_t n, size_t destbytes)
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index b03b7bc..3036cbb 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -2738,10 +2738,8 @@ xenDaemonAttachDeviceFlags(virDomainPtr domain, const char *xml,
virDevicePCIAddress PCIAddr;
PCIAddr = dev->data.hostdev->source.subsys.u.pci;
- virAsprintf(&target, "PCI device: %.4x:%.2x:%.2x", PCIAddr.domain,
- PCIAddr.bus, PCIAddr.slot);
-
- if (target == NULL) {
+ if (virAsprintf(&target, "PCI device: %.4x:%.2x:%.2x",
+ PCIAddr.domain, PCIAddr.bus, PCIAddr.slot) < 0) {
virReportOOMError();
goto cleanup;
}
diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c
index 3979540..fd24f74 100644
--- a/tests/networkxml2conftest.c
+++ b/tests/networkxml2conftest.c
@@ -102,8 +102,9 @@ testDnsmasqLeaseFileName(const char *netname)
{
char *leasefile;
- virAsprintf(&leasefile, "/var/lib/libvirt/dnsmasq/%s.leases",
- netname);
+ if (virAsprintf(&leasefile, "/var/lib/libvirt/dnsmasq/%s.leases",
+ netname) < 0)
+ return NULL;
return leasefile;
}
--
1.7.11.7
11 years, 9 months
[libvirt] Libvirt support for windows
by varun bhatnagar
Hi,
I want to use libvirt for windows but when i try to launch virsh it gives
an error message saying "*error: invalid argument in transport methods
unix, ssh and ext are not supported under Windows"*
The version which I downloaded is libvirt-0.8.8.exe. I want to connect to
two virtualization techniques --- *Virtualbox* and *VMWare* If libvirt is
not supported on windows then is there any other tool or API which supports
multiple virtualization technology?
Thanks in advance..!!!!
11 years, 9 months
[libvirt] [PATCH] tests: Don't build securityselinuxlabeltest without qemu
by Jiri Denemark
Sources for securityselinuxlabeltest are only defined if qemu driver is
enabled so we should not try to build the test if qemu driver is
disabled.
---
tests/Makefile.am | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9da0b4a..0194db2 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -108,10 +108,12 @@ endif
if WITH_SECDRIVER_SELINUX
test_programs += securityselinuxtest
+if WITH_QEMU
if WITH_ATTR
test_programs += securityselinuxlabeltest
endif
endif
+endif
if WITH_DRIVER_MODULES
test_programs += virdrivermoduletest
--
1.8.1.2
11 years, 9 months
[libvirt] [PATCH] util: Fix mask for 172.16.0.0 private address range
by Jiri Denemark
https://bugzilla.redhat.com/show_bug.cgi?id=905708
Only the first 12 bits should be set in the mask for this range. All
addresses between 172.16.0.0 and 172.31.255.255 are private.
---
src/util/virsocketaddr.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/util/virsocketaddr.c b/src/util/virsocketaddr.c
index 7bc43a9..3dfa3fb 100644
--- a/src/util/virsocketaddr.c
+++ b/src/util/virsocketaddr.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009-2012 Red Hat, Inc.
+ * Copyright (C) 2009-2013 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
@@ -199,7 +199,7 @@ virSocketAddrEqual(const virSocketAddrPtr s1, const virSocketAddrPtr s2)
*
* Return true if this address is in its family's defined
* "private/local" address space. For IPv4, private addresses are in
- * the range of 192.168.0.0/16, 172.16.0.0/16, or 10.0.0.0/8. For
+ * the range of 192.168.0.0/16, 172.16.0.0/12, or 10.0.0.0/8. For
* IPv6, local addresses are in the range of FC00::/7 or FEC0::/10
* (that last one is deprecated, but still in use).
*
@@ -215,7 +215,7 @@ virSocketAddrIsPrivate(const virSocketAddrPtr addr)
val = ntohl(addr->data.inet4.sin_addr.s_addr);
return ((val & 0xFFFF0000) == ((192L << 24) + (168 << 16)) ||
- (val & 0xFFFF0000) == ((172L << 24) + (16 << 16)) ||
+ (val & 0xFFF00000) == ((172L << 24) + (16 << 16)) ||
(val & 0xFF000000) == ((10L << 24)));
case AF_INET6:
--
1.8.1.2
11 years, 9 months