[libvirt] About the vfio error when using SR-IOV
by Xiao Ma (xima2)
Hi, All
I want to use the SR-IOV of intel 82576 NIC.
I enabled IOMMU and VT-d and SR-IOV in BIOS.
And enabled VT-d in kernel.
The OS information is bellow:
[root@host3 nova]# cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)
[root@host3 nova]# uname -an
Linux host3.localdomain 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[root@host3 nova]# rpm -qa|grep qemu
libvirt-daemon-driver-qemu-1.2.8-16.el7.x86_64
qemu-kvm-1.5.3-86.el7.x86_64
qemu-…
[View More]kvm-common-1.5.3-86.el7.x86_64
ipxe-roms-qemu-20130517-6.gitc4bce43.el7.noarch
qemu-img-1.5.3-86.el7.x86_64
[root@host3 nova]# rpm -qa|grep libvirt
libvirt-daemon-1.2.8-16.el7.x86_64
libvirt-daemon-driver-nwfilter-1.2.8-16.el7.x86_64
libvirt-python-1.2.8-7.el7.x86_64
libvirt-daemon-driver-storage-1.2.8-16.el7.x86_64
libvirt-daemon-driver-qemu-1.2.8-16.el7.x86_64
libvirt-daemon-config-nwfilter-1.2.8-16.el7.x86_64
libvirt-daemon-driver-secret-1.2.8-16.el7.x86_64
libvirt-daemon-driver-interface-1.2.8-16.el7.x86_64
libvirt-client-1.2.8-16.el7.x86_64
libvirt-glib-0.1.7-3.el7.x86_64
libvirt-daemon-driver-network-1.2.8-16.el7.x86_64
libvirt-daemon-driver-nodedev-1.2.8-16.el7.x86_64
libvirt-daemon-kvm-1.2.8-16.el7.x86_64
And I can see the vf of the NIC after ‘ echo '7' > /sys/class/net/ens1f1/device/sriov_numvfs '
[root@host3 VTS2.1-demo]# lspci |grep -i ethernet
08:00.0 Ethernet controller: QLogic Corp. 10GbE Converged Network Adapter (TCP/IP Networking) (rev 02)
08:00.1 Ethernet controller: QLogic Corp. 10GbE Converged Network Adapter (TCP/IP Networking) (rev 02)
0f:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)
0f:00.1 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)
10:10.1 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
10:10.3 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
10:10.5 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
10:10.7 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
10:11.1 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
10:11.3 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
10:11.5 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
I configured the interface as bellow in XML:
<interface type="hostdev" managed="yes">
<mac address="fa:16:3e:f7:57:5f"/>
<source>
<address type="pci" domain="0x0000" bus="0x10" slot="0x10" function="0x3"/>
</source>
<vlan>
<tag id="1000"/>
</vlan>
</interface>
But the error output when I boot one vm:
[root@host3 VTS2.1-demo]# virsh create vtc.demo.xml
error: Failed to create domain from vtc.demo.xml
error: internal error: early end of file from monitor: possible problem:
2016-02-22T07:38:42.169035Z qemu-kvm: -device vfio-pci,host=10:10.3,id=hostdev0,bus=pci.0,addr=0x3: vfio: error, group 17 is not viable, please ensure all devices within the iommu_group are bound to their vfio bus driver.
2016-02-22T07:38:42.169215Z qemu-kvm: -device vfio-pci,host=10:10.3,id=hostdev0,bus=pci.0,addr=0x3: vfio: failed to get group 17
2016-02-22T07:38:42.169233Z qemu-kvm: -device vfio-pci,host=10:10.3,id=hostdev0,bus=pci.0,addr=0x3: Device initialization failed.
2016-02-22T07:38:42.169248Z qemu-kvm: -device vfio-pci,host=10:10.3,id=hostdev0,bus=pci.0,addr=0x3: Device 'vfio-pci' could not be initialized
Could you please help to solve it?
Looking forward for your reply.
Thanks.
[View Less]
9 years, 1 month
[libvirt] [PATCH] cmdNetworkUpdate: Prefer VSH_EXCLUSIVE_OPTIONS over if-else tree
by Michal Privoznik
We have macros that check and reject mutually exclusive
parameters to our commands. Use those instead of if-else tree.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
tools/virsh-network.c | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/tools/virsh-network.c b/tools/virsh-network.c
index 1ae206a..d0bd7a3 100644
--- a/tools/virsh-network.c
+++ b/tools/virsh-network.c
@@ -907,9 +907,12 @@ cmdNetworkUpdate(vshControl *ctl, const vshCmd …
[View More]*cmd)
bool current = vshCommandOptBool(cmd, "current");
bool config = vshCommandOptBool(cmd, "config");
bool live = vshCommandOptBool(cmd, "live");
- unsigned int flags = 0;
+ unsigned int flags = VIR_NETWORK_UPDATE_AFFECT_CURRENT;
const char *affected;
+ VSH_EXCLUSIVE_OPTIONS_VAR(current, live);
+ VSH_EXCLUSIVE_OPTIONS_VAR(current, config);
+
if (!(network = virshCommandOptNetwork(ctl, cmd, NULL)))
return false;
@@ -962,18 +965,10 @@ cmdNetworkUpdate(vshControl *ctl, const vshCmd *cmd)
xml = xmlFromFile;
}
- if (current) {
- if (live || config) {
- vshError(ctl, "%s", _("--current must be specified exclusively"));
- goto cleanup;
- }
- flags |= VIR_NETWORK_UPDATE_AFFECT_CURRENT;
- } else {
- if (config)
- flags |= VIR_NETWORK_UPDATE_AFFECT_CONFIG;
- if (live)
- flags |= VIR_NETWORK_UPDATE_AFFECT_LIVE;
- }
+ if (config)
+ flags |= VIR_NETWORK_UPDATE_AFFECT_CONFIG;
+ if (live)
+ flags |= VIR_NETWORK_UPDATE_AFFECT_LIVE;
if (virNetworkUpdate(network, command,
section, parentIndex, xml, flags) < 0) {
--
2.4.10
[View Less]
9 years, 1 month
[libvirt] [PATCH v2] Migration with --live --offline option performs offline migration without warning/error.
by Nitesh Konkar
This patch gives an error when migration is attempted with both
--live and --offline options.
Signed-off-by: Nitesh Konkar <nitkon12(a)linux.vnet.ibm.com>
---
tools/virsh-domain.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 43c8436..7b4a08e 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -9837,6 +9837,10 @@ cmdMigrate(vshControl *ctl, const vshCmd *cmd)
int timeout = 0;
bool live_flag = false;
…
[View More]virshCtrlData data = { .dconn = NULL };
+ bool live = vshCommandOptBool(cmd, "live");
+ bool offline = vshCommandOptBool(cmd, "offline");
+
+ VSH_EXCLUSIVE_OPTIONS_VAR(live, offline);
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
--
1.8.3.1
[View Less]
9 years, 1 month
[libvirt] [PATCH] qemu_process: mark auto-generated spice ports as reserved
by Pavel Hrdina
In case you will specify graphics like this:
<graphics type='spice' port='-1'/>
or
<graphics type='spice' port='-1' tlsPort='6000'/>
libvirt will automatically add autoport='no'. This leads to an issue
that in qemuProcessStop() we don't release that port because we are
releasing both port if autoport=yes or only port marked as reserved.
If autoport=no but we request to generate port via '-1' we need to mark
that port as reserved in order to release it.
Resolves: https://…
[View More]bugzilla.redhat.com/show_bug.cgi?id=1299696
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/qemu/qemu_process.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index eaf9fea..e7f19a6 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3694,6 +3694,9 @@ qemuProcessSPICEAllocatePorts(virQEMUDriverPtr driver,
goto error;
graphics->data.spice.port = port;
+
+ if (!graphics->data.spice.autoport)
+ graphics->data.spice.portReserved = true;
}
if (needTLSPort || graphics->data.spice.tlsPort == -1) {
@@ -3708,6 +3711,9 @@ qemuProcessSPICEAllocatePorts(virQEMUDriverPtr driver,
goto error;
graphics->data.spice.tlsPort = tlsPort;
+
+ if (!graphics->data.spice.autoport)
+ graphics->data.spice.tlsPortReserved = true;
}
return 0;
--
2.7.1
[View Less]
9 years, 1 month
[libvirt] [PATCH rfc v4 0/6] storage:dir: ploop volumes support
by Olga Krishtal
v4:
- fixed identation issues.
- in case of .uploadVol, DiskDescriptor.xml is restored.
- added check of ploops'accessibility
v3:
- no VIR_STORAGE_VOL_PLOOP type any more
- adapted all patches according to previous change
- fixed comments
v2:
- fixed memory leak
- chenged the return value of all helper functions to 0/-1.
Now check for success is smth like that: vir****Ploop() < 0
- fixed some identation issues.
9 years, 1 month
[libvirt] Plans for next release
by Daniel Veillard
So we are getting close to the end of the month and it's time to push
a new release. I think that if we want to push it by March 1st we should
start the freeze Wednesday at the latest, maybe RC1 on Wed, RC2 friday
and release next Mon if everything looks okay.
If there is an issue with this plan, please tell :)
Daniel
--
Daniel Veillard | Open Source and Standards, Red Hat
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | …
[View More]virtualization library http://libvirt.org/
[View Less]
9 years, 1 month
[libvirt] [PATCH] Migration with --live --offline option performs offline migration without warning/error.
by Nitesh Konkar
This patch gives an error when migration is attempted with both
--live and --offline options.
Signed-off-by: Nitesh Konkar <nitkon12(a)linux.vnet.ibm.com>
---
tools/virsh-domain.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 62acecb..527db38 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -9795,6 +9795,12 @@ doMigrate(void *opaque)
} else {
/* For traditional live migration, connect to the …
[View More]destination host directly. */
virDomainPtr ddom = NULL;
+
+ if ((flags & VIR_MIGRATE_OFFLINE) && (flags & VIR_MIGRATE_LIVE)){
+ vshError(ctl, "%s", _("migrate: Using both --live and --offline option together is not permitted."));
+ goto out;
+ }
if ((ddom = virDomainMigrate3(dom, dconn, params, nparams, flags))) {
virDomainFree(ddom);
--
1.8.3.1
[View Less]
9 years, 1 month
[libvirt] [PATCH] virDomainDefFormatInternal: Drop useless check
by Michal Privoznik
There's a check if a domain definition has any graphics card and
if so, we iterate over each one of them. This makes no sense,
because even if it has none we can still iterate over.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/conf/domain_conf.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index e47d613..56bd1aa 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -22363,11 +…
[View More]22363,9 @@ virDomainDefFormatInternal(virDomainDefPtr def,
goto error;
}
- if (def->ngraphics > 0) {
- for (n = 0; n < def->ngraphics; n++)
- if (virDomainGraphicsDefFormat(buf, def->graphics[n], flags) < 0)
- goto error;
- }
+ for (n = 0; n < def->ngraphics; n++)
+ if (virDomainGraphicsDefFormat(buf, def->graphics[n], flags) < 0)
+ goto error;
for (n = 0; n < def->nsounds; n++)
if (virDomainSoundDefFormat(buf, def->sounds[n], flags) < 0)
--
2.4.10
[View Less]
9 years, 1 month
[libvirt] [PATCH] adminDaemonListServers: Don't leak @srv_names array
by Michal Privoznik
When getting a list of servers registered for a daemon, it's
returned as a dynamically allocated array filled in with pointers
to constant strings. Because the array is dynamic, it should be
freed when no longer needed (but not the strings!). Even the
function that creates the array suggests that.
==19446== 48 bytes in 3 blocks are definitely lost in loss record 821 of 1,034
==19446== at 0x4C2C28E: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==19446== by 0x54BAFC8: …
[View More]virReallocN (viralloc.c:245)
==19446== by 0x54BB0BE: virExpandN (viralloc.c:294)
==19446== by 0x54BB391: virInsertElementsN (viralloc.c:436)
==19446== by 0x164E3D: virNetDaemonGetServerNames (virnetdaemon.c:217)
==19446== by 0x15616F: adminDaemonListServers (admin_server.c:52)
==19446== by 0x155B8C: adminDispatchConnectListServers (admin.c:151)
==19446== by 0x155FD8: adminDispatchConnectListServersHelper (admin_dispatch.h:101)
==19446== by 0x568E862: virNetServerProgramDispatchCall (virnetserverprogram.c:437)
==19446== by 0x568E3C3: virNetServerProgramDispatch (virnetserverprogram.c:307)
==19446== by 0x5687B5B: virNetServerProcessMsg (virnetserver.c:135)
==19446== by 0x5687C1B: virNetServerHandleJob (virnetserver.c:156)
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
daemon/admin_server.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/daemon/admin_server.c b/daemon/admin_server.c
index 7521e82..0196bfe 100644
--- a/daemon/admin_server.c
+++ b/daemon/admin_server.c
@@ -68,6 +68,7 @@ adminDaemonListServers(virNetDaemonPtr dmn,
ret = nsrvs;
cleanup:
+ VIR_FREE(srv_names);
virObjectListFree(srvs);
return ret;
}
--
2.4.10
[View Less]
9 years, 1 month
[libvirt] [PATCH 0/3] make virDomainObjGetPersistentDef return only persistent definition
by Nikolay Shirokovskiy
I want to make virDomainObjGetPersistentDef return only persistent definition
as one can infer from its name. Patches 1 and 2 clean things up to make
reasoning that this operation is possible more clear.
Nikolay Shirokovskiy (3):
domain: reuse update flags checking functions
libxl: remove check duplicates
common-impl: make virDomainObjGetPersistentDef return only persistent config
src/conf/domain_conf.c | 19 ++++-----
src/libxl/libxl_driver.c | 103 ++++-----------------------------…
[View More]--------------
src/lxc/lxc_driver.c | 75 +++-------------------------------
3 files changed, 24 insertions(+), 173 deletions(-)
--
1.8.3.1
[View Less]
9 years, 1 month