Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outdated floppy device #3429

Closed
pevogam opened this issue Jun 20, 2022 · 4 comments
Closed

Outdated floppy device #3429

pevogam opened this issue Jun 20, 2022 · 4 comments

Comments

@pevogam
Copy link
Contributor

pevogam commented Jun 20, 2022

It seems that some of the newest Qemu versions (here tested 6.1.0) have problem installing Windows machines or in general running unattended install tests with floppy drives:

[stdlog] 2022-06-18 12:43:01,247 client           L0606 INFO | [qemu output] qemu-system-x86_64: can't apply global isa-fdc.driveA=drive_fl: Property 'isa-fdc.driveA' not found

Background might be the following deprecation:

https://www.mail-archive.com/[email protected]/msg68098.html

Looking at the Avocado VT source code, I can find these floppy bus classes (QFloppyBus and and even older QOldFloppyBus):

class QFloppyBus(QDenseBus):

    """
    Floppy bus (-global isa-fdc.drive?=$drive)
    """

So it might be that I am missing something but can we use the new -device floppy,unit=1,drive=... in some way instead of the old -global isa-fdc.driveA=...?

@PaulYuuu @chunfuwen @luckyh What do you think?

@pevogam pevogam changed the title Outdated foppy bug device Outdated floppy device Jun 20, 2022
@PaulYuuu
Copy link
Contributor

@pevogam, good point. Actually I never test floppy devices, but if it was introduced very early, I think we can re-design this part directly. Replace it to use QPCIBus should not a big task.

@pevogam
Copy link
Contributor Author

pevogam commented Jun 28, 2022

@pevogam, good point. Actually I never test floppy devices, but if it was introduced very early, I think we can re-design this part directly. Replace it to use QPCIBus should not a big task.

I guess what is a bit more elaborate is to keep backward compatibility with older Qemu versions too, not sure what is the current Qemu version that most Avocado VT members are using.

@luckyh
Copy link
Contributor

luckyh commented Jun 28, 2022

I guess what is a bit more elaborate is to keep backward compatibility with older Qemu versions too, not sure what is the current Qemu version that most Avocado VT members are using.

It seems to be easy to support both together with the capabilities utility. Let me take the command line expression of virtual block devices as an example, legacy qemu would use -drive to represent image files while modern qemu would use -blockdev instead, therefore we had the following code snippets to probe the capability and choose the most appropriate expression to format the command line. I think we can apply a similar flow for floppy devices as well.

def _probe_capabilities(self):
""" Probe capabilities. """
# -blockdev
if (self.has_option('blockdev') and
self.__qemu_ver in VersionInterval(self.BLOCKDEV_VERSION_SCOPE)):
self.caps.set_flag(Flags.BLOCKDEV)

if Flags.BLOCKDEV in self.caps:
protocol_cls = qdevices.QBlockdevProtocolFile
if not filename:
protocol_cls = qdevices.QBlockdevProtocolNullCo
elif filename.startswith('iscsi:'):
protocol_cls = qdevices.QBlockdevProtocolISCSI
elif filename.startswith('rbd:'):
protocol_cls = qdevices.QBlockdevProtocolRBD
elif filename.startswith('gluster'):
protocol_cls = qdevices.QBlockdevProtocolGluster
elif re.match(r'nbd(\+\w+)?://', filename):
protocol_cls = qdevices.QBlockdevProtocolNBD
elif filename.startswith('nvme:'):
protocol_cls = qdevices.QBlockdevProtocolNVMe
elif filename.startswith('ssh:'):
protocol_cls = qdevices.QBlockdevProtocolSSH
elif filename.startswith('https:'):
protocol_cls = qdevices.QBlockdevProtocolHTTPS
elif filename.startswith('http:'):
protocol_cls = qdevices.QBlockdevProtocolHTTP
elif filename.startswith('ftps:'):
protocol_cls = qdevices.QBlockdevProtocolFTPS
elif filename.startswith('ftp:'):
protocol_cls = qdevices.QBlockdevProtocolFTP
elif fmt in ('scsi-generic', 'scsi-block'):
protocol_cls = qdevices.QBlockdevProtocolHostDevice
elif blkdebug is not None:
protocol_cls = qdevices.QBlockdevProtocolBlkdebug
if imgfmt == 'qcow2':
format_cls = qdevices.QBlockdevFormatQcow2
elif imgfmt == 'raw' or media == 'cdrom':
format_cls = qdevices.QBlockdevFormatRaw
elif imgfmt == 'luks':
format_cls = qdevices.QBlockdevFormatLuks
elif imgfmt == 'nvme':
format_cls = qdevices.QBlockdevFormatRaw
elif imgfmt is None:
# use RAW type as the default
format_cls = qdevices.QBlockdevFormatRaw
format_node = format_cls(name)
protocol_node = protocol_cls(name)
format_node.add_child_node(protocol_node)
devices.append(protocol_node)
devices.append(format_node)
# Add filter node
if image_copy_on_read in ("yes", "on", "true"):
filter_node = qdevices.QBlockdevFilterCOR(name)
filter_node.add_child_node(format_node)
devices.append(filter_node)
filter_node.set_param('file', format_node.get_qid())
if image_throttle_group:
filter_node = qdevices.QBlockdevFilterThrottle(name,
image_throttle_group)
filter_node.add_child_node(format_node)
devices.append(filter_node)
filter_node.set_param('file', format_node.get_qid())
format_node.set_param('file', protocol_node.get_qid())
else:
if self.has_hmp_cmd('__com.redhat_drive_add') and use_device:
devices.append(qdevices.QRHDrive(name))
elif self.has_hmp_cmd('drive_add') and use_device:
devices.append(qdevices.QHPDrive(name))
elif self.has_option("device"):
devices.append(qdevices.QDrive(name, use_device))
else: # very old qemu without 'addr' support
devices.append(qdevices.QOldDrive(name, use_device))

@pevogam
Copy link
Contributor Author

pevogam commented Aug 22, 2023

Closing via #3719.

@pevogam pevogam closed this as completed Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants