qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [QUESTION] qemu: how to control the switch of floppy drive
@ 2021-04-09  6:48 Xu, Yanfei
  2021-04-09  7:10 ` Philippe Mathieu-Daudé
  2021-04-09  8:19 ` Markus Armbruster
  0 siblings, 2 replies; 5+ messages in thread
From: Xu, Yanfei @ 2021-04-09  6:48 UTC (permalink / raw)
  To: qemu-devel

Hi experts,

How can I disable the floppy controller drive when I boot a VM by qemu-
system-x86_64? I did not specify any arguments about floppy, but after
the qemu boots up, linux always can detect floppy drive and then
modprobe the matched floppy.ko.

qemu version: v5.2

command line:

qemu-system-x86_64 -device virtio-net-
pci,netdev=net0,mac=52:54:00:12:34:02 -netdev
tap,id=net0,ifname=tap0,script=no,downscript=no -object rng-
random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0
-drive file=/path/to/images/qemux86-64
/qemux86-64.ext4,if=virtio,format=raw -usb -device usb-tablet   -cpu
core2duo -enable-kvm -m 512  -pidfile /path/to/pidfile_4167420 -m 512
-snapshot -serial mon:vc -serial null  -kernel /path/to/qemux86-64
/bzImage.bin -append 'root=/dev/vda rw  mem=512M
ip=192.168.7.2::192.168.7.1:255.255.255.0 oprofile.timer=1
printk.time=1'

As I konw BIOS can control the switch of floppy controller on a real
hardware, But how can I do it on qemu? And does the qemu enable that by
default?


Thanks,
Yanfei


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [QUESTION] qemu: how to control the switch of floppy drive
  2021-04-09  6:48 [QUESTION] qemu: how to control the switch of floppy drive Xu, Yanfei
@ 2021-04-09  7:10 ` Philippe Mathieu-Daudé
  2021-04-09  8:27   ` Xu, Yanfei
  2021-04-09  8:19 ` Markus Armbruster
  1 sibling, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-04-09  7:10 UTC (permalink / raw)
  To: Xu, Yanfei, qemu-devel

Hi,

On 4/9/21 8:48 AM, Xu, Yanfei wrote:
> How can I disable the floppy controller drive when I boot a VM by qemu-
> system-x86_64? I did not specify any arguments about floppy, but after
> the qemu boots up, linux always can detect floppy drive and then
> modprobe the matched floppy.ko.
> 
> qemu version: v5.2
> 
> command line:
> 
> qemu-system-x86_64 -device virtio-net-
> pci,netdev=net0,mac=52:54:00:12:34:02 -netdev
> tap,id=net0,ifname=tap0,script=no,downscript=no -object rng-
> random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0
> -drive file=/path/to/images/qemux86-64
> /qemux86-64.ext4,if=virtio,format=raw -usb -device usb-tablet   -cpu
> core2duo -enable-kvm -m 512  -pidfile /path/to/pidfile_4167420 -m 512
> -snapshot -serial mon:vc -serial null  -kernel /path/to/qemux86-64
> /bzImage.bin -append 'root=/dev/vda rw  mem=512M
> ip=192.168.7.2::192.168.7.1:255.255.255.0 oprofile.timer=1
> printk.time=1'
> 
> As I konw BIOS can control the switch of floppy controller on a real
> hardware, But how can I do it on qemu? And does the qemu enable that by
> default?

See
https://gitlab.com/qemu-project/qemu/-/blob/master/docs/qdev-device-use.txt#L105

* if=floppy

  -device floppy,unit=UNIT,drive=DRIVE-ID

  Without any -device floppy,... you get an empty unit 0 and no unit
  1.  You can use -nodefaults to suppress the default unit 0, see
  "Default Devices".

Regards,

Phil.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [QUESTION] qemu: how to control the switch of floppy drive
  2021-04-09  6:48 [QUESTION] qemu: how to control the switch of floppy drive Xu, Yanfei
  2021-04-09  7:10 ` Philippe Mathieu-Daudé
@ 2021-04-09  8:19 ` Markus Armbruster
  2021-04-09  8:30   ` Xu, Yanfei
  1 sibling, 1 reply; 5+ messages in thread
From: Markus Armbruster @ 2021-04-09  8:19 UTC (permalink / raw)
  To: Xu, Yanfei; +Cc: qemu-devel

"Xu, Yanfei" <yanfei.xu@windriver.com> writes:

> Hi experts,
>
> How can I disable the floppy controller drive when I boot a VM by qemu-
> system-x86_64? I did not specify any arguments about floppy, but after
> the qemu boots up, linux always can detect floppy drive and then
> modprobe the matched floppy.ko.
>
> qemu version: v5.2
>
> command line:
>
> qemu-system-x86_64 -device virtio-net-
> pci,netdev=net0,mac=52:54:00:12:34:02 -netdev
> tap,id=net0,ifname=tap0,script=no,downscript=no -object rng-
> random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0
> -drive file=/path/to/images/qemux86-64
> /qemux86-64.ext4,if=virtio,format=raw -usb -device usb-tablet   -cpu
> core2duo -enable-kvm -m 512  -pidfile /path/to/pidfile_4167420 -m 512
> -snapshot -serial mon:vc -serial null  -kernel /path/to/qemux86-64
> /bzImage.bin -append 'root=/dev/vda rw  mem=512M
> ip=192.168.7.2::192.168.7.1:255.255.255.0 oprofile.timer=1
> printk.time=1'
>
> As I konw BIOS can control the switch of floppy controller on a real
> hardware, But how can I do it on qemu? And does the qemu enable that by
> default?

Machine types pc-i440fx-* provide a floppy controller.  An empty floppy
drive is connected by default.  Use -nodefaults to suppress it.

Machine types pc-q35-* provide a floppy controller only when you ask for
it, e.g. with -drive if=floppy.

Use -M to select the machine type.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [QUESTION] qemu: how to control the switch of floppy drive
  2021-04-09  7:10 ` Philippe Mathieu-Daudé
@ 2021-04-09  8:27   ` Xu, Yanfei
  0 siblings, 0 replies; 5+ messages in thread
From: Xu, Yanfei @ 2021-04-09  8:27 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel



On 4/9/21 3:10 PM, Philippe Mathieu-Daudé wrote:
> [Please note: This e-mail is from an EXTERNAL e-mail address]
> 
> Hi,
> 
> On 4/9/21 8:48 AM, Xu, Yanfei wrote:
>> How can I disable the floppy controller drive when I boot a VM by qemu-
>> system-x86_64? I did not specify any arguments about floppy, but after
>> the qemu boots up, linux always can detect floppy drive and then
>> modprobe the matched floppy.ko.
>>
>> qemu version: v5.2
>>
>> command line:
>>
>> qemu-system-x86_64 -device virtio-net-
>> pci,netdev=net0,mac=52:54:00:12:34:02 -netdev
>> tap,id=net0,ifname=tap0,script=no,downscript=no -object rng-
>> random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0
>> -drive file=/path/to/images/qemux86-64
>> /qemux86-64.ext4,if=virtio,format=raw -usb -device usb-tablet   -cpu
>> core2duo -enable-kvm -m 512  -pidfile /path/to/pidfile_4167420 -m 512
>> -snapshot -serial mon:vc -serial null  -kernel /path/to/qemux86-64
>> /bzImage.bin -append 'root=/dev/vda rw  mem=512M
>> ip=192.168.7.2::192.168.7.1:255.255.255.0 oprofile.timer=1
>> printk.time=1'
>>
>> As I konw BIOS can control the switch of floppy controller on a real
>> hardware, But how can I do it on qemu? And does the qemu enable that by
>> default?
> 
> See
> https://gitlab.com/qemu-project/qemu/-/blob/master/docs/qdev-device-use.txt#L105
> 
> * if=floppy
> 
>    -device floppy,unit=UNIT,drive=DRIVE-ID
> 
>    Without any -device floppy,... you get an empty unit 0 and no unit
>    1.  You can use -nodefaults to suppress the default unit 0, see
>    "Default Devices".

I see. Thanks for your link and detailed explanation. :)

Thanks,
Yanfei

> 
> Regards,
> 
> Phil.
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [QUESTION] qemu: how to control the switch of floppy drive
  2021-04-09  8:19 ` Markus Armbruster
@ 2021-04-09  8:30   ` Xu, Yanfei
  0 siblings, 0 replies; 5+ messages in thread
From: Xu, Yanfei @ 2021-04-09  8:30 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel



On 4/9/21 4:19 PM, Markus Armbruster wrote:
> Machine types pc-i440fx-* provide a floppy controller.  An empty floppy
> drive is connected by default.  Use -nodefaults to suppress it.
> 
> Machine types pc-q35-* provide a floppy controller only when you ask for
> it, e.g. with -drive if=floppy.
> 
> Use -M to select the machine type.

Got it. Thanks a lot!  :)

Thanks,
Yanfei


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-04-09  8:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-09  6:48 [QUESTION] qemu: how to control the switch of floppy drive Xu, Yanfei
2021-04-09  7:10 ` Philippe Mathieu-Daudé
2021-04-09  8:27   ` Xu, Yanfei
2021-04-09  8:19 ` Markus Armbruster
2021-04-09  8:30   ` Xu, Yanfei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).