Skip to content

Commit

Permalink
Fix qemu-cmd-line issue for sound device
Browse files Browse the repository at this point in the history
Signed-off-by: Kyla Zhang <[email protected]>
  • Loading branch information
kylazhang committed Dec 30, 2021
1 parent 849ad3a commit ac206c5
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 ac206c5

Please sign in to comment.