Skip to content

Commit

Permalink
Merge pull request #3970 from kylazhang/sound_fix
Browse files Browse the repository at this point in the history
Fix qemu-cmd-line issue for sound device
  • Loading branch information
dzhengfy authored Jan 4, 2022
2 parents db8ca17 + ac206c5 commit ea8934b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libvirt/tests/src/virtual_device/sound_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,23 @@ def check_qemu_cmd_line():
cmdline = cmdline_file.read()
# Check sound model
if sound_model == "ac97":
pattern = r"-device.AC97"
pattern = r"-device.*AC97"
elif sound_model == "ich6":
pattern = r"-device.intel-hda"
pattern = r"-device.*intel-hda"
else:
pattern = r"-device.ich9-intel-hda"
pattern = r"-device.*ich9-intel-hda"
if not re.search(pattern, cmdline):
test.fail("Can not find the %s sound device "
"in qemu cmd line." % sound_model)
# Check codec type
if sound_model in ["ich6", "ich9"]:
if codec_type == "micro":
pattern = r"-device.hda-micro"
pattern = r"-device.*hda-micro"
else:
# Duplex is default in qemu cli even codec not set
# But before 0.9.13, no codec_type so no default
if libvirt_version.version_compare(0, 9, 13):
pattern = r"-device.hda-duplex"
pattern = r"-device.*hda-duplex"
if not re.search(pattern, cmdline):
test.fail("Can not find the %s codec for sound dev "
"in qemu cmd line." % codec_type)
Expand Down

0 comments on commit ea8934b

Please sign in to comment.