Bug 602590 - Disable pci_add, pci_del, drive_add
Disable pci_add, pci_del, drive_add
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
All Linux
low Severity medium
: rc
: ---
Assigned To: Amit Shah
Virtualization Bugs
Depends On:
  Show dependency treegraph
Reported: 2010-06-10 05:17 EDT by Markus Armbruster
Modified: 2010-11-11 14:30 EST (History)
5 users (show)

See Also:
Fixed In Version: qemu-kvm-
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-07-01 21:39:05 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Markus Armbruster 2010-06-10 05:17:17 EDT
Description of problem: pci_add, pci_del and drive_add are old ways to hot-plug and hot-unplug devices and drives.  They should be disabled.

pci_add is limited to PCI NICs, lsi53c895a, and virtio-blk-pci.  device_add is more general.

pci_del is limited to PCI devices.  device_del is more general.

drive_add is limited to SCSI drives and unconnected drives.  There is no way to delete a drive other than by deleting its controller with pci_del.  The forthcoming blockdev_add, blockdev_del will be more general.

Keeping the limited legacy interfaces confuses users.  Moreover, they use special legacy code paths instead of the common ones, and thus make us vulnerable to bugs hiding there.
Comment 2 RHEL Product and Program Management 2010-06-10 05:33:13 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
Comment 6 juzhang 2010-06-29 05:02:44 EDT
Reproduced on qemu-kvm-    

Issue the following commands
(qemu) ? drive_add
drive_add [[<domain>:]<bus>:]<slot>
[snapshot=on|off][,cache=on|off] -- add drive to PCI storage controller
(qemu) ? pci_add 
pci_add auto|[[<domain>:]<bus>:]<slot> nic|storage|host [[vlan=n][,macaddr=addr][,model=type]] [file=file][,if=type][,bus=nr]... [host=02:00.0[,name=string][,dma=none] -- hot-add PCI device
(qemu) ? pci_del
pci_del [[<domain>:]<bus>:]<slot> -- hot remove PCI device

Verified on qemu-kvm-  
1. boot vm
/usr/libexec/qemu-kvm -usbdevice tablet -rtc-td-hack -m 2G -smp 2 -drive file=/root/rhel6_2.33_641.qcow2,if=none,boot=on,cache=none,format=qcow2,werror=stop,rerror=stop,id=drive-virtio-disk0 -device virtio-blk-pci,drive=drive-virtio-disk0,id=virtio-disk0 -netdev tap,id=hostnet0,vhost=on -device virtio-net-pci,netdev=hostnet0,id=net0,mac=22:11:22:45:64:98 -uuid `uuidgen` -cpu qemu64,+sse2,+x2apic -device virtio-balloon-pci -boot c  -vnc :10 -qmp tcp:0:4444,server,server -monitor stdio

2. for text monitor
issue the following commands
(qemu) drive_add
unknown command: 'drive_add'
(qemu) pci_add
unknown command: 'pci_add'
(qemu) pci_del
unknown command: 'pci_del'

3. for qmp monitor
{"return": [{"name": "quit"}, {"name": "eject"}, {"name": "change"}, {"name": "stop"}, {"name": "cont"}, {"name": "system_reset"}, {"name": "system_powerdown"}, {"name": "device_add"}, {"name": "device_del"}, {"name": "cpu"}, {"name": "memsave"}, {"name": "pmemsave"}, {"name": "migrate"}, {"name": "migrate_cancel"}, {"name": "migrate_set_speed"}, {"name": "migrate_set_downtime"}, {"name": "netdev_add"}, {"name": "netdev_del"}, {"name": "balloon"}, {"name": "getfd"}, {"name": "closefd"}, {"name": "block_passwd"}, {"name": "qmp_capabilities"}, {"name": "__com.redhat_set_password"}, {"name": "__com.redhat_spice_migrate_info"}, {"name": "query-version"}, {"name": "query-commands"}, {"name": "query-chardev"}, {"name": "query-block"}, {"name": "query-blockstats"}, {"name": "query-cpus"}, {"name": "query-hpet"}, {"name": "query-kvm"}, {"name": "query-status"}, {"name": "query-mice"}, {"name": "query-vnc"}, {"name": "query-name"}, {"name": "query-uuid"}, {"name": "query-migrate"}, {"name": "query-balloon"}]}

drive_add,pci_add and pci_del is not included in the above commands.
Comment 8 juzhang 2010-07-01 21:39:05 EDT
according to comment6,close this issue.

Note You need to log in before you can comment on or make changes to this bug.