Skip to contentSkip to conversation

Questions about chardev (and ps/2 mouse)

Qemu-devel Brian Wheeler 3 participants 4 messages Apr 5, 2011

lore
Share & tools
lore
#0 lore raw

I'm trying to disable the ps/2 mouse in favor of the serial mouse provided by -chardev msmouse since the ps/2 mouse has had lots of problems with older OSes (OpenStep, OS/2, Win 3.1, etc). I've got a couple of questions:

1) If I change a VMState something by appending a field (i.e. "unplugged"), do I have to update version_id? How do the minimum_version_id{,_old} fields fit in?

2) I've had to hardcode the unplugged value in ps2_mouse_reset since the call is pretty deep in the call stack, 8042->pckbd->ps2. Ideally, I'd like to set (*PS2MouseState)->unplugged from qemu_chr_open_msmouse() so that if the serial mouse is set up the ps/2 mouse would be disabled.

3) When I enable the msmouse (via -chardev msmouse,id=mouse) qemu segfaults. I've traced it back to the CharDriverSTate for msmouse not having a valid handler_opaque (it is null). How would I connect that to the serial port (any of them, but ideally the 2nd one)

Thanks for any hints!
Brian

#1 lore raw
Quoted 14 lines · Brian Wheeler

I'm trying to disable the ps/2 mouse in favor of the serial mouse provided by -chardev msmouse since the ps/2 mouse has had lots of problems with older OSes (OpenStep, OS/2, Win 3.1, etc). I've got a couple of questions:

1) If I change a VMState something by appending a field (i.e. "unplugged"), do I have to update version_id? How do the minimum_version_id{,_old} fields fit in?

2) I've had to hardcode the unplugged value in ps2_mouse_reset since the call is pretty deep in the call stack, 8042->pckbd->ps2. Ideally, I'd like to set (*PS2MouseState)->unplugged from qemu_chr_open_msmouse() so that if the serial mouse is set up the ps/2 mouse would be disabled.

Quoted 5 lines

3) When I enable the msmouse (via -chardev msmouse,id=mouse) qemu segfaults. I've traced it back to the CharDriverSTate for msmouse not having a valid handler_opaque (it is null). How would I connect that to the serial port (any of them, but ideally the 2nd one)

Ignore the last question. I realized I had to use:

-chardev msmouse,id=msmouse -device isa-serial,chardev=msmouse

to connect them :)

Quoted 4 lines

Thanks for any hints!
Brian

#2 lore raw
In reply to Brian Wheeler
Quoted 7 lines · Brian Wheeler

I'm trying to disable the ps/2 mouse in favor of the serial mouse provided by -chardev msmouse since the ps/2 mouse has had lots of problems with older OSes (OpenStep, OS/2, Win 3.1, etc). I've got a couple of questions:

1) If I change a VMState something by appending a field (i.e. "unplugged"), do I have to update version_id?

Yes. You can use a subsection though to avoid bumping the version_id.

Quoted 2 lines

How do the
minimum_version_id{,_old} fields fit in?

This is for load, not save. It's used to basically deprecate loading from very old versions.

Quoted 4 lines

2) I've had to hardcode the unplugged value in ps2_mouse_reset since the call is pretty deep in the call stack, 8042->pckbd->ps2. Ideally, I'd like to set (*PS2MouseState)->unplugged from qemu_chr_open_msmouse() so that if the serial mouse is set up the ps/2 mouse would be disabled.

Wouldn't it be better to just not make the PS2Mouse present in the first place?

Quoted 4 lines

3) When I enable the msmouse (via -chardev msmouse,id=mouse) qemu segfaults. I've traced it back to the CharDriverSTate for msmouse not having a valid handler_opaque (it is null). How would I connect that to the serial port (any of them, but ideally the 2nd one)

I haven't looked at the chardev but I suspect it's not tested often.

Regards,

Anthony Liguori

Quoted 4 lines

Thanks for any hints!
Brian

#3 lore raw
Quoted 10 lines · Anthony Liguori
Quoted 8 lines · Brian Wheeler

I'm trying to disable the ps/2 mouse in favor of the serial mouse provided by -chardev msmouse since the ps/2 mouse has had lots of problems with older OSes (OpenStep, OS/2, Win 3.1, etc).  I've got a couple of questions:

1) If I change a VMState something by appending a field (i.e. "unplugged"), do I have to update version_id?

Quoted 7 lines

Yes.  You can use a subsection though to avoid bumping the version_id.

Quoted 2 lines

  How do the
minimum_version_id{,_old} fields fit in?

This is for load, not save.  It's used to basically deprecate loading from very old versions.

There was an email thread about this recently:
http://web.archiveorange.com/archive/v/1XS1vynR1fW0cG5xll6r

I need to go back and reread it and propose a docs patch for people to shoot down; I think having a clear description of "what do I have to do if I've added a new field to a device model" is important, because that will often be the only interaction a developer has with the migration/vmstate stuff.

-- PMM