[libvirt] [PATCH] apparmor: allow unix stream for p2p migrations
by Christian Ehrhardt
On live migration with --p2p like:
$ virsh migrate --live --p2p kvmguest-bionic-normal \
qemu+ssh://10.6.221.80/system
We hit an apparmor deny like:
apparmor="DENIED" operation="file_inherit"
profile="/usr/sbin/libvirtd" pid=23477 comm="ssh" family="unix"
sock_type="stream" protocol=0 requested_mask="send receive"
denied_mask="send" addr=none peer_addr=none peer="unconfined"
The rule is not perfect, but can't be restricted further at the moment
(new upstream kernel features needed). For now the lack of a profile on the
peer as well as comm not being a conditional on rules do not allow to filter
further.
Signed-off-by: Christian Ehrhardt <christian.ehrhardt(a)canonical.com>
---
examples/apparmor/usr.sbin.libvirtd | 3 +++
1 file changed, 3 insertions(+)
diff --git a/examples/apparmor/usr.sbin.libvirtd b/examples/apparmor/usr.sbin.libvirtd
index 8d61d15..febe8a4 100644
--- a/examples/apparmor/usr.sbin.libvirtd
+++ b/examples/apparmor/usr.sbin.libvirtd
@@ -53,6 +53,9 @@
network packet dgram,
network packet raw,
+ # for --p2p migrations
+ unix (send, receive) type=stream addr=none peer=(label=unconfined addr=none),
+
ptrace (trace) peer=unconfined,
ptrace (trace) peer=/usr/sbin/libvirtd,
ptrace (trace) peer=/usr/sbin/dnsmasq,
--
2.7.4
6 years, 12 months
[libvirt] [PATCH 0/2] Set hostname in lxc containers
by Cédric Bosdonnat
Hey there,
Here are two commits to set a transient hostname on lxc containers based
on the guest name.
Cédric Bosdonnat (2):
Add virStringFilterChars() string utility
lxc: set a hostname based on the container name
src/libvirt_private.syms | 1 +
src/lxc/lxc_container.c | 35 +++++++++++++++++++++++++++++++++++
src/util/virstring.c | 24 ++++++++++++++++++++++++
src/util/virstring.h | 1 +
tests/virstringtest.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 107 insertions(+)
--
2.15.1
6 years, 12 months
[libvirt] virt-install ERROR Host does not support any virtualization options
by Mihamina RAKOTOMANDIMBY
Hello,
I face this problem and I am willing to provide a patch in order to have
a more informative message.
This, of course with our help. I am not quite certain.
First of all: What is the problem?
On a fresh Install (ArchLinux for me), if ever forget to install Qemu
and launch "virt-install" with "--type kvm", I get the message:
"Host does not support any virtualization options"
According to me, this message should be improved: if Qemu is not found,
this should be "Did not find Qemu, please install it".
As I searched, the message is generated by this piece of code:
https://github.com/virt-manager/virt-manager/blob/c92aade081687b19f5a60cd...
As I write now, I cant find the pice of code actually calling the
"quemu" binary. I think I should add a try/catch block there and Raise
the right Exception.
Would someone help me a bit?
Thank you.
6 years, 12 months
[libvirt] [PATCH] blockjob: Fix error checking of blockjob status
by Jie Wang
when the blockjob return status:"BLOCK_JOB_COMPLETED" with error:
"File descriptor in bad state", "offset" and "len" are equal to zero,
but the blockjob event should be "VIR_DOMAIN_BLOCK_JOB_FAILED"
---
src/qemu/qemu_monitor_json.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index e45868b..943360a 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -886,7 +886,7 @@ qemuMonitorJSONHandleBlockJobImpl(qemuMonitorPtr mon,
case VIR_DOMAIN_BLOCK_JOB_COMPLETED:
error = virJSONValueObjectGetString(data, "error");
/* Make sure the whole device has been processed */
- if (offset != len)
+ if (offset != len || offset == 0)
event = VIR_DOMAIN_BLOCK_JOB_FAILED;
break;
case VIR_DOMAIN_BLOCK_JOB_CANCELED:
--
1.8.3.1
6 years, 12 months
[libvirt] [PATCH] docs: Fix serial console configuration examples
by Andrea Bolognani
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
Pushed as trivial.
docs/formatdomain.html.in | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 01db83e60..d272cc1ba 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -6603,6 +6603,7 @@ qemu-kvm -net nic,model=? /dev/null
<pre>
...
+<devices>
<!-- KVM virtio console -->
<console type='pty'>
<source path='/dev/pts/5'/>
@@ -6694,7 +6695,7 @@ qemu-kvm -net nic,model=? /dev/null
<pre>
...
-</devices>
+<devices>
<console type='pty'>
<target type='serial'/>
</console>
@@ -6719,21 +6720,21 @@ qemu-kvm -net nic,model=? /dev/null
<pre>
...
-</devices>
+<devices>
<serial type='pty'/>
</devices>
...</pre>
<pre>
...
-</devices>
+<devices>
<console type='pty'/>
</devices>
...</pre>
<pre>
...
-</devices>
+<devices>
<serial type='pty'/>
<console type='pty'/>
</devices>
--
2.14.3
6 years, 12 months
[libvirt] [PATCH] conf: honor maxnames in nodeListDevices API
by Pavel Hrdina
Introduced by commit <4ae9dbea99c>.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1528572
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/conf/virnodedeviceobj.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c
index 872ec1fd4b..c4e3a40d3a 100644
--- a/src/conf/virnodedeviceobj.c
+++ b/src/conf/virnodedeviceobj.c
@@ -798,6 +798,9 @@ virNodeDeviceObjListGetNamesCallback(void *payload,
if (data->error)
return 0;
+ if (data->nnames >= data->maxnames)
+ return 0;
+
virObjectLock(obj);
def = obj->def;
--
2.14.3
6 years, 12 months
[libvirt] error: operation failed: domain save job: unexpectedly failed
by Oscar Segarra
Hi,
For any unkown reason the virsh save raises an error in my environment
Centos 7.2:
[root@vdicnode02 ~]# virsh list
Id Name State
----------------------------------------------------
2 vdicsunstone01 running
3 one-27 running
[root@vdicnode02 ~]# export LIBVIRT_DEBUG=0
[root@vdicnode02 ~]# export LIBVIRT_LOG_OUTPUTS="1:file:virsh.log"
[root@vdicnode02 ~]# virsh --debug 0 --connect qemu:///system save one-27
/var/lib/one//datastores/100/27/checkpoint
save: domain(optdata): one-27
save: file(optdata): /var/lib/one//datastores/100/27/checkpoint
save: found option <domain>: one-27
save: <domain> trying as domain NAME
save: found option <domain>: one-27
save: <domain> trying as domain NAME
error: Failed to save domain one-27 to
/var/lib/one//datastores/100/27/checkpoint
error: operation failed: domain save job: unexpectedly failed
[root@vdicnode02 ~]# cat virsh.log
2017-12-27 21:56:26.676+0000: 86761: info : libvirt version: 3.2.0,
package: 14.el7_4.5 (CentOS BuildSystem <http://bugs.centos.org>,
2017-12-07-15:37:23, c1bm.rdu2.centos.org)
2017-12-27 21:56:26.676+0000: 86761: info : hostname: vdicnode02
2017-12-27 21:56:26.676+0000: 86761: error :
virNetClientProgramDispatchError:177 : operation failed: domain save job:
unexpectedly failed
[root@vdicnode02 ~]#
Versions:
[root@vdicnode02 ~]# /usr/libexec/qemu-kvm --version
QEMU emulator version 1.5.3 (qemu-kvm-1.5.3-141.el7_4.4), Copyright (c)
2003-2008 Fabrice Bellard
[root@vdicnode02 ~]# libvirtd --version
libvirtd (libvirt) 3.2.0
The process:
[root@vdicnode02 ~]# ps -defa | grep one-27
oneadmin 59956 1 56 20:36 ? 01:20:27 /usr/libexec/qemu-kvm
-name one-27 -S -machine
pc-i440fx-rhel7.0.0,accel=kvm,usb=off,dump-guest-core=off -cpu SandyBridge
-m 1024 -realtime mlock=off -smp 2,sockets=2,cores=1,threads=1 -uuid
f3d850ce-25cb-446f-a017-0564751514a1 -no-user-config -nodefaults -chardev
socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain-3-one-27/monitor.sock,server,nowait
-mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown
-boot strict=on -device nec-usb-xhci,id=usb,bus=pci.0,addr=0x5 -device
virtio-scsi-pci,id=scsi0,num_queues=4,bus=pci.0,addr=0x6 -device
virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x7 -device
usb-hub,id=hub0,bus=usb.0,port=1 -drive
file=rbd:vdicvmpool-ssd/one-2-27-0:id=libvirt:key=AQDE5KVZeuJlIBAAiRDxHOGcbtioGTnBVECyrQ==:auth_supported=cephx\;none:mon_host=vdicnode01\:6789\;vdicnode02\:6789,format=raw,if=none,id=drive-virtio-disk0,cache=writeback
-device
virtio-blk-pci,scsi=off,bus=pci.0,addr=0x8,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1
-drive
file=/var/lib/one//datastores/100/27/disk.1,format=raw,if=none,id=drive-ide0-0-0,readonly=on
-device ide-cd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -netdev
tap,fd=27,id=hostnet0,vhost=on,vhostfd=30 -device
virtio-net-pci,netdev=hostnet0,id=net0,mac=02:00:2f:4e:9c:3e,bus=pci.0,addr=0x3
-chardev spicevmc,id=charchannel0,name=vdagent -device
virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0
-chardev
socket,id=charchannel1,path=/var/lib/libvirt/qemu/channel/target/domain-3-one-27/org.qemu.guest_agent.0,server,nowait
-device
virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=org.qemu.guest_agent.0
-device usb-tablet,id=input0,bus=usb.0,port=2 -spice
port=5927,addr=0.0.0.0,disable-ticketing,seamless-migration=on -k es -vga
qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=67108864
-global qxl-vga.vgamem_mb=64 -global qxl-vga.max_outputs=1 -device
intel-hda,id=sound0,bus=pci.0,addr=0x4 -device
hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -chardev
spicevmc,id=charredir0,name=usbredir -device
usb-redir,chardev=charredir0,id=redir0,bus=usb.0,port=3 -chardev
spicevmc,id=charredir1,name=usbredir -device
usb-redir,chardev=charredir1,id=redir1,bus=usb.0,port=4 -chardev
spicevmc,id=charredir2,name=usbredir -device
usb-redir,chardev=charredir2,id=redir2,bus=usb.0,port=1.1 -chardev
spicevmc,id=charredir3,name=usbredir -device
usb-redir,chardev=charredir3,id=redir3,bus=usb.0,port=1.2 -device
virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x9 -msg timestamp=on
Any help will be welcome!
Thanks a lot.
6 years, 12 months
[libvirt] [PATCH] blockjob: Fix error checking of blockjob status
by Jie Wang
when the blockjob return status:"BLOCK_JOB_COMPLETED" with error:
"File descriptor in bad state", "offset" and "len" are equal to zero,
but the blockjob event should be "VIR_DOMAIN_BLOCK_JOB_FAILED"
---
src/qemu/qemu_monitor_json.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index e45868b..943360a 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -886,7 +886,7 @@ qemuMonitorJSONHandleBlockJobImpl(qemuMonitorPtr mon,
case VIR_DOMAIN_BLOCK_JOB_COMPLETED:
error = virJSONValueObjectGetString(data, "error");
/* Make sure the whole device has been processed */
- if (offset != len)
+ if (offset != len || offset == 0)
event = VIR_DOMAIN_BLOCK_JOB_FAILED;
break;
case VIR_DOMAIN_BLOCK_JOB_CANCELED:
--
1.8.3.1
6 years, 12 months