]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/i386/vmmouse: Fix crash when using the vmmouse on a machine without vmport
authorThomas Huth <thuth@redhat.com>
Wed, 29 Jan 2020 11:29:54 +0000 (12:29 +0100)
committerLaurent Vivier <laurent@vivier.eu>
Thu, 6 Feb 2020 10:02:48 +0000 (11:02 +0100)
commitbb38df846dc73ebca7d28585c1773f612e335274
tree65af30251a75b65b239b8da45acec48bdf3f6093
parent34959c24b0ef0d64316d96dc7d4c2566016696ea
hw/i386/vmmouse: Fix crash when using the vmmouse on a machine without vmport

QEMU currently crashes when the user tries to use the "vmmouse" on a
machine without vmport, e.g.:

 $ x86_64-softmmu/qemu-system-x86_64 -machine microvm -device vmmouse
 Segmentation fault (core dumped)

or:

 $ x86_64-softmmu/qemu-system-x86_64 -device vmmouse -M pc,vmport=off
 Segmentation fault (core dumped)

Let's avoid the crash by checking for the vmport device first.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Message-Id: <20200129112954.4282-1-thuth@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
hw/i386/vmmouse.c