Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 602590 - Disable pci_add, pci_del, drive_add
Summary: Disable pci_add, pci_del, drive_add
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.0
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Amit Shah
QA Contact: Virtualization Bugs
Depends On:
TreeView+ depends on / blocked
Reported: 2010-06-10 09:17 UTC by Markus Armbruster
Modified: 2010-11-11 19:30 UTC (History)
5 users (show)

Fixed In Version: qemu-kvm-
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2010-07-02 01:39:05 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description Markus Armbruster 2010-06-10 09:17:17 UTC
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 09:33:13 UTC
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 09:02:44 UTC
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-02 01:39:05 UTC
according to comment6,close this issue.

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