Skip to content

Commit

Permalink
Merge pull request autotest#5756 from meinaLi/sg_persist
Browse files Browse the repository at this point in the history
Virtual_disk: fix persistent reservation failed issue
  • Loading branch information
chunfuwen authored Jul 8, 2024
2 parents 79cacc1 + 81251a2 commit 78c57f8
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import logging as log
import time
import shutil
import os

from avocado.utils import service
from avocado.utils import process

from virttest import virt_vm
from virttest import virsh
Expand Down Expand Up @@ -143,6 +145,11 @@ def ppc_controller_update():
vmxml_backup = vm_xml.VMXML.new_from_inactive_dumpxml(vm_name)

try:
# Prepare a /etc/target/pr directory based on BZ1652220
target_pr = "/etc/target/pr"
if not os.path.exists(target_pr):
process.run("mkdir -p %s" % target_pr, shell=True, ignore_status=False)

# Setup iscsi target
blk_dev = libvirt.setup_or_cleanup_iscsi(is_setup=True,
is_login=True,
Expand Down Expand Up @@ -206,3 +213,5 @@ def ppc_controller_update():
libvirt.setup_or_cleanup_iscsi(is_setup=False)
# Stop qemu-pr-helper daemon
start_or_stop_qemu_pr_helper(is_start=False)
if os.path.exists(target_pr):
shutil.rmtree(target_pr)

0 comments on commit 78c57f8

Please sign in to comment.