From 0bff60fb7ea5debc26fce47d6dcdd2f78512e6c3 Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Mon, 19 Nov 2018 16:10:26 -0500 Subject: [PATCH] Use system libvirt session instead of user By default virsh use qemu:///session instead of qemu:///system. Signed-off-by: Jonathan Rajotte --- lava/devices/kvm1.jinja2 | 8 ++++---- lava/devices/kvm2.jinja2 | 8 ++++---- lava/kvm/generate_kvm_virsh.sh | 2 ++ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lava/devices/kvm1.jinja2 b/lava/devices/kvm1.jinja2 index d78a57f..a0c57f4 100644 --- a/lava/devices/kvm1.jinja2 +++ b/lava/devices/kvm1.jinja2 @@ -1,8 +1,8 @@ {% extends 'x86.jinja2' %} -{% set connection_command = 'virsh console --force kvm1' %} -{% set hard_reset_command = 'virsh reset kvm1' %} -{% set power_off_command = 'virsh destroy kvm1' %} -{% set power_on_command = 'virsh start kvm1'' %} +{% set connection_command = 'virsh --connect qemu:///system console --force kvm1' %} +{% set hard_reset_command = 'virsh --connect qemu:///system reset kvm1' %} +{% set power_off_command = 'virsh --connect qemu:///system destroy kvm1' %} +{% set power_on_command = 'virsh --connect qemu:///system start kvm1' %} {% set soft_reset_command = 'reboot'} {% set boot_interface = 'net0'} {% set kernel_extra_args = 'cpuidle.off=1'} diff --git a/lava/devices/kvm2.jinja2 b/lava/devices/kvm2.jinja2 index 3f57c3d..6bda083 100644 --- a/lava/devices/kvm2.jinja2 +++ b/lava/devices/kvm2.jinja2 @@ -1,8 +1,8 @@ {% extends 'x86.jinja2' %} -{% set connection_command = 'virsh console --force kvm2' %} -{% set hard_reset_command = 'virsh reset kvm2' %} -{% set power_off_command = 'virsh destroy kvm2' %} -{% set power_on_command = 'virsh start kvm2'' %} +{% set connection_command = 'virsh --connect qemu:///system console --force kvm2' %} +{% set hard_reset_command = 'virsh --connect qemu:///system reset kvm2' %} +{% set power_off_command = 'virsh --connect qemu:///system destroy kvm2' %} +{% set power_on_command = 'virsh --connect qemu:///system start kvm2' %} {% set soft_reset_command = 'reboot'} {% set boot_interface = 'net0'} {% set kernel_extra_args = 'cpuidle.off=1'} diff --git a/lava/kvm/generate_kvm_virsh.sh b/lava/kvm/generate_kvm_virsh.sh index ab5511b..9becc91 100755 --- a/lava/kvm/generate_kvm_virsh.sh +++ b/lava/kvm/generate_kvm_virsh.sh @@ -15,6 +15,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +export LIBVIRT_DEFAULT_URI="qemu:///system" + tmp=$(mktemp) virt-install --print-xml \ --name "$1" \ -- 2.34.1