qemu.git
5 years agoMerge remote-tracking branch 'remotes/lalrae/tags/mips-20141015' into staging
Peter Maydell [Wed, 22 Oct 2014 11:06:47 +0000 (12:06 +0100)] 
Merge remote-tracking branch 'remotes/lalrae/tags/mips-20141015' into staging

* remotes/lalrae/tags/mips-20141015: (28 commits)
  target-mips: Remove unused gen_load_ACX, gen_store_ACX and cpu_ACX
  target-mips/dsp_helper.c: Add ifdef guards around various functions
  target-mips/translate.c: Add ifdef guard around check_mips64()
  target-mips/op_helper.c: Remove unused do_lbu() function
  target-mips/dsp_helper.c: Remove unused function get_DSPControl_24()
  target-mips: fix broken MIPS16 and microMIPS
  target-mips/translate.c: Update OPC_SYNCI
  target-mips: define a new generic CPU supporting MIPS64 Release 6 ISA
  mips_malta: update malta's pseudo-bootloader - replace JR with JALR
  target-mips: remove JR, BLTZAL, BGEZAL and add NAL, BAL instructions
  target-mips: do not allow Status.FR=0 mode in 64-bit FPU
  target-mips: add new Floating Point Comparison instructions
  target-mips: add new Floating Point instructions
  softfloat: add functions corresponding to IEEE-2008 min/maxNumMag
  target-mips: add AUI, LSA and PCREL instruction families
  target-mips: add compact and CP1 branches
  target-mips: add ALIGN, DALIGN, BITSWAP and DBITSWAP instructions
  target-mips: Status.UX/SX/KX enable 32-bit address wrapping
  target-mips: move CLO, DCLO, CLZ, DCLZ, SDBBP and free special2 in R6
  target-mips: redefine Integer Multiply and Divide instructions
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agohw/i386/pc_q35.c: Avoid g_assert_cmpint() as it is not in glib 2.12
Peter Maydell [Fri, 17 Oct 2014 18:04:35 +0000 (19:04 +0100)] 
hw/i386/pc_q35.c: Avoid g_assert_cmpint() as it is not in glib 2.12

The function g_assert_cmpint() is not in glib 2.12, which is our current
minimum requirement. Rephrase the recently added assertion to avoid it.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
5 years agoglib: add compatibility interface for g_strcmp0()
Gonglei [Thu, 16 Oct 2014 10:59:37 +0000 (18:59 +0800)] 
glib: add compatibility interface for g_strcmp0()

This patch fixes compilation errors when building against glib < 2.16.0
due to the missing g_strcmp0() function.

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Message-id: 1413457177-10132-1-git-send-email-arei.gonglei@huawei.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-vga-20141015-1' into staging
Peter Maydell [Thu, 16 Oct 2014 08:26:14 +0000 (09:26 +0100)] 
Merge remote-tracking branch 'remotes/kraxel/tags/pull-vga-20141015-1' into staging

vga-pci: add qext region to mmio
vga: Remove unused arrays dmask4 and dmask16

# gpg: Signature made Wed 15 Oct 2014 10:12:06 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-vga-20141015-1:
  hw/display/vga: Remove unused arrays dmask4 and dmask16
  vga-pci: add qext region to mmio

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-bootindex-20141015-1' into...
Peter Maydell [Wed, 15 Oct 2014 20:03:28 +0000 (21:03 +0100)] 
Merge remote-tracking branch 'remotes/kraxel/tags/pull-bootindex-20141015-1' into staging

allow changing bootorder via monitor at runtime,
by making bootindex a writable qom property.

* remotes/kraxel/tags/pull-bootindex-20141015-1: (34 commits)
  bootindex: change fprintf to error_report
  bootindex: delete bootindex when device is removed
  bootindex: move calling add_boot_device_patch to bootindex setter function
  ide: add calling add_boot_device_patch in bootindex setter function
  nvma: ide: add bootindex to qom property
  usb-storage: add bootindex to qom property
  virtio-blk: alias bootindex property explicitly for virt-blk-pci/ccw/s390
  block: remove bootindex property from qdev to qom
  virtio-blk: add bootindex to qom property
  ide: add bootindex to qom property
  scsi: add bootindex to qom property
  isa-fdc: remove bootindexA/B property from qdev to qom
  redirect: remove bootindex property from qdev to qom
  vfio: remove bootindex property from qdev to qom
  pci-assign: remove bootindex property from qdev to qom
  host-libusb: remove bootindex property from qdev to qom
  virtio-net: alias bootindex property explicitly for virt-net-pci/ccw/s390
  net: remove bootindex property from qdev to qom
  usb-net: add bootindex to qom property
  vmxnet3: add bootindex to qom property
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoglib: add compatibility interface for g_get_monotonic_time()
Stefan Hajnoczi [Wed, 15 Oct 2014 12:29:30 +0000 (14:29 +0200)] 
glib: add compatibility interface for g_get_monotonic_time()

This patch fixes compilation errors when building against glib <2.28.0
due to the missing g_get_monotonic_time() function.

The compilation error in tests/libqos/virtio.c was introduced in commit
70556264a89a268efba1d7e8e341adcdd7881eb4 ("libqos: use microseconds
instead of iterations for virtio timeout").

Add a simple g_get_monotonic_time() implementation to glib-compat.h
based on code from vhost-user-test.c.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
[Igor: add G_TIME_SPAN_SECOND, include glib-compat.h in libqtest.h]
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/juanquintela/tags/migration/20141015' into...
Peter Maydell [Wed, 15 Oct 2014 10:55:53 +0000 (11:55 +0100)] 
Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20141015' into staging

migration/next for 20141015

# gpg: Signature made Wed 15 Oct 2014 09:21:54 BST using RSA key ID 5872D723
# gpg: Can't check signature: public key not found

* remotes/juanquintela/tags/migration/20141015:
  migration: catch unknown flag combinations in ram_load
  qemu-file: Move stdio implementation to qemu-file-stdio.c
  qemu-file: Move unix and socket implementations to qemu-file-unix.c
  qemu-file: Use qemu_file_is_writable() on stdio_fclose()
  qemu-file: Make qemu_file_is_writable() non-static
  qemu-file: Add copyright header to qemu-file.c
  vmstate: Allow dynamic allocation for VBUFFER during migration
  block/migration: Disable cache invalidate for incoming migration
  Tests: QEMUSizedBuffer/QEMUBuffer
  QEMUSizedBuffer based QEMUFile

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agohw/display/vga: Remove unused arrays dmask4 and dmask16
Peter Maydell [Fri, 10 Oct 2014 19:44:29 +0000 (20:44 +0100)] 
hw/display/vga: Remove unused arrays dmask4 and dmask16

Following cleanup of the vga device code in commit d2e043a8041,
the arrays dmask4 and dmask16 are now unused. gcc doesn't warn
about this, but clang does; remove them.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agovga-pci: add qext region to mmio
Gerd Hoffmann [Tue, 23 Sep 2014 10:45:56 +0000 (12:45 +0200)] 
vga-pci: add qext region to mmio

Add a qemu extented register range to the standard vga mmio bar.
Right nowe there are two registers:  One readonly register returning the
size of the region (so we can easily add more registers there if needed)
and one endian control register, so guests (especially ppc) can flip
the framebuffer endianness as they need it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
5 years agobootindex: change fprintf to error_report
Gonglei [Tue, 7 Oct 2014 08:00:38 +0000 (16:00 +0800)] 
bootindex: change fprintf to error_report

The function may be called by qmp command, we should
report error message to the caller.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agobootindex: delete bootindex when device is removed
Gonglei [Tue, 7 Oct 2014 08:00:37 +0000 (16:00 +0800)] 
bootindex: delete bootindex when device is removed

Device should be removed from global boot list when
it is hot-unplugged.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agobootindex: move calling add_boot_device_patch to bootindex setter function
Gonglei [Tue, 7 Oct 2014 08:00:36 +0000 (16:00 +0800)] 
bootindex: move calling add_boot_device_patch to bootindex setter function

On this way, we can assure the new bootindex take effect
during vm rebooting.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agoide: add calling add_boot_device_patch in bootindex setter function
Gonglei [Tue, 7 Oct 2014 08:00:35 +0000 (16:00 +0800)] 
ide: add calling add_boot_device_patch in bootindex setter function

On this way, we can assure the new bootindex take effect
during vm rebooting. Meanwhile set the initial value of
bootindex to -1.

Because ide devcies's unit property maybe
do not initialize when set_bootindex function is called,
so that we don't know its suffix. So we have to save the
call add_boot_device_path() on ide realize/init function.
When we want to change bootindex during vm rebooting, we
can call it in setter function.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agonvma: ide: add bootindex to qom property
Gonglei [Tue, 7 Oct 2014 08:00:34 +0000 (16:00 +0800)] 
nvma: ide: add bootindex to qom property

At present, nvma cannot boot. However, it provides already
a bootindex property, so change bootindex to qom for nvma
device, but not call add_boot_device_path.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agousb-storage: add bootindex to qom property
Gonglei [Tue, 7 Oct 2014 08:00:33 +0000 (16:00 +0800)] 
usb-storage: add bootindex to qom property

Add a qom property with the same name 'bootindex',
when we remove it form qdev property, things will
continue to work just fine, and we can use qom features
which are not supported by qdev property.

Because usb-storage rely on scsi-disk which is created
in usb_msg_realize_storage(), so we should store the SCSIDevice
pointer in MSDState struct. Only in this way, we can change
the global boot_order_list when we want to change the bootindex
during vm rebooting by calling object_property_set_int(Object(SCSIDevice),).

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agovirtio-blk: alias bootindex property explicitly for virt-blk-pci/ccw/s390
Gonglei [Tue, 7 Oct 2014 08:00:32 +0000 (16:00 +0800)] 
virtio-blk: alias bootindex property explicitly for virt-blk-pci/ccw/s390

Since the "bootindex" property is a QOM property and not a qdev property
now, we must alias it explicitly for virtio-blk-pci, as well as CCW and
s390-virtio.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agoblock: remove bootindex property from qdev to qom
Gonglei [Tue, 7 Oct 2014 08:00:31 +0000 (16:00 +0800)] 
block: remove bootindex property from qdev to qom

Remove bootindex form qdev property to qom, things will
continue to work just fine, and we can use qom features
which are not supported by qdev property.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agovirtio-blk: add bootindex to qom property
Gonglei [Tue, 7 Oct 2014 08:00:30 +0000 (16:00 +0800)] 
virtio-blk: add bootindex to qom property

Add a qom property with the same name 'bootindex',
when we remove it form qdev property, things will
continue to work just fine, and we can use qom features
which are not supported by qdev property.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agoide: add bootindex to qom property
Gonglei [Tue, 7 Oct 2014 08:00:29 +0000 (16:00 +0800)] 
ide: add bootindex to qom property

Add a qom property with the same name 'bootindex',
when we remove it form qdev property, things will
continue to work just fine, and we can use qom features
which are not supported by qdev property.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agoscsi: add bootindex to qom property
Gonglei [Tue, 7 Oct 2014 08:00:28 +0000 (16:00 +0800)] 
scsi: add bootindex to qom property

Add a qom property with the same name 'bootindex',
when we remove it form qdev property, things will
continue to work just fine, and we can use qom features
which are not supported by qdev property.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agoisa-fdc: remove bootindexA/B property from qdev to qom
Gonglei [Tue, 7 Oct 2014 08:00:27 +0000 (16:00 +0800)] 
isa-fdc: remove bootindexA/B property from qdev to qom

Remove bootindexA/B form qdev property to qom, things will
continue to work just fine, and we can use qom features
which are not supported by qdev property.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agoredirect: remove bootindex property from qdev to qom
Gonglei [Tue, 7 Oct 2014 08:00:26 +0000 (16:00 +0800)] 
redirect: remove bootindex property from qdev to qom

Remove bootindex form qdev property to qom, things will
continue to work just fine, and we can use qom features
which are not supported by qdev property.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agovfio: remove bootindex property from qdev to qom
Gonglei [Tue, 7 Oct 2014 08:00:25 +0000 (16:00 +0800)] 
vfio: remove bootindex property from qdev to qom

Remove bootindex form qdev property to qom, things will
continue to work just fine, and we can use qom features
which are not supported by qdev property.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agopci-assign: remove bootindex property from qdev to qom
Gonglei [Tue, 7 Oct 2014 08:00:24 +0000 (16:00 +0800)] 
pci-assign: remove bootindex property from qdev to qom

Remove bootindex form qdev property to qom, things will
continue to work just fine, and we can use qom features
which are not supported by qdev property.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agohost-libusb: remove bootindex property from qdev to qom
Gonglei [Tue, 7 Oct 2014 08:00:23 +0000 (16:00 +0800)] 
host-libusb: remove bootindex property from qdev to qom

Remove bootindex form qdev property to qom, things will
continue to work just fine, and we can use qom features
which are not supported by qdev property.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agovirtio-net: alias bootindex property explicitly for virt-net-pci/ccw/s390
Gonglei [Tue, 7 Oct 2014 08:00:22 +0000 (16:00 +0800)] 
virtio-net: alias bootindex property explicitly for virt-net-pci/ccw/s390

Since the "bootindex" property is a QOM property and not a qdev property
now, we must alias it explicitly for virtio-net-pci, as well as CCW and
s390-virtio.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agonet: remove bootindex property from qdev to qom
Gonglei [Tue, 7 Oct 2014 08:00:21 +0000 (16:00 +0800)] 
net: remove bootindex property from qdev to qom

Remove bootindex form qdev property to qom, things will
continue to work just fine, and we can use qom features
which are not supported by qdev property.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agousb-net: add bootindex to qom property
Gonglei [Tue, 7 Oct 2014 08:00:20 +0000 (16:00 +0800)] 
usb-net: add bootindex to qom property

Add a qom property with the same name 'bootindex',
when we remove it form qdev property, things will
continue to work just fine, and we can use qom features
which are not supported by qdev property.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agovmxnet3: add bootindex to qom property
Gonglei [Tue, 7 Oct 2014 08:00:19 +0000 (16:00 +0800)] 
vmxnet3: add bootindex to qom property

Add a qom property with the same name 'bootindex',
when we remove it form qdev property, things will
continue to work just fine, and we can use qom features
which are not supported by qdev property.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agospapr_lian: add bootindex to qom property
Gonglei [Tue, 7 Oct 2014 08:00:18 +0000 (16:00 +0800)] 
spapr_lian: add bootindex to qom property

Add a qom property with the same name 'bootindex',
when we remove it form qdev property, things will
continue to work just fine, and we can use qom features
which are not supported by qdev property.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agortl8139: add bootindex to qom property
Gonglei [Tue, 7 Oct 2014 08:00:17 +0000 (16:00 +0800)] 
rtl8139: add bootindex to qom property

Add a qom property with the same name 'bootindex',
when we remove it form qdev property, things will
continue to work just fine, and we can use qom features
which are not supported by qdev property.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agopcnet: add bootindex to qom property
Gonglei [Tue, 7 Oct 2014 08:00:16 +0000 (16:00 +0800)] 
pcnet: add bootindex to qom property

Add a qom property with the same name 'bootindex',
when we remove it form qdev property, things will
continue to work just fine, and we can use qom features
which are not supported by qdev property.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agone2000: add bootindex to qom property
Gonglei [Tue, 7 Oct 2014 08:00:15 +0000 (16:00 +0800)] 
ne2000: add bootindex to qom property

Add a qom property with the same name 'bootindex',
when we remove it form qdev property, things will
continue to work just fine, and we can use qom features
which are not supported by qdev property.

At present, isa_ne2000 device does not support to boot
os, so we register two seprate qom getter/setter functions.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agoeepro100: add bootindex to qom property
Gonglei [Tue, 7 Oct 2014 08:00:14 +0000 (16:00 +0800)] 
eepro100: add bootindex to qom property

Add a qom property with the same name 'bootindex',
when we remove it form qdev property, things will
continue to work just fine, and we can use qom features
which are not supported by qdev property.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agoe1000: add bootindex to qom property
Gonglei [Tue, 7 Oct 2014 08:00:13 +0000 (16:00 +0800)] 
e1000: add bootindex to qom property

Add a qom property with the same name 'bootindex',
when we remove it form qdev property, things will
continue to work just fine, and we can use qom features
which are not supported by qdev property.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agovirtio-net: add bootindex to qom property
Gonglei [Tue, 7 Oct 2014 08:00:12 +0000 (16:00 +0800)] 
virtio-net: add bootindex to qom property

Add a qom property with the same name 'bootindex',
when we remove it form qdev property, things will
continue to work just fine, and we can use qom features
which are not supported by qdev property.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agobootindex: add a setter/getter functions wrapper for bootindex property
Gonglei [Tue, 7 Oct 2014 08:00:11 +0000 (16:00 +0800)] 
bootindex: add a setter/getter functions wrapper for bootindex property

when we remove bootindex form qdev.property to qom.property,
we can use those functions set/get bootindex property for all
correlative devices. Meanwhile set the initial value of
bootindex to -1.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agobootindex: support to set a existent device's bootindex to -1
Gonglei [Tue, 7 Oct 2014 08:00:10 +0000 (16:00 +0800)] 
bootindex: support to set a existent device's bootindex to -1

When set a device's bootindex to -1, we remove it from global
fw_boot_order list.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agobootindex: rework add_boot_device_path function
Gonglei [Tue, 7 Oct 2014 08:00:09 +0000 (16:00 +0800)] 
bootindex: rework add_boot_device_path function

Add the function of updating bootindex about fw_boot_order list
in add_boot_device_path(). We should delete the old one if a
device has existed in global fw_boot_order list.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agofw_cfg: add fw_cfg_machine_reset function
Gonglei [Tue, 7 Oct 2014 08:00:08 +0000 (16:00 +0800)] 
fw_cfg: add fw_cfg_machine_reset function

We must assure that the changed bootindex can take effect
when guest is rebooted. So we introduce fw_cfg_machine_reset(),
which change the fw_cfg file's bootindex data using the new
global fw_boot_order list.

Signed-off-by: Chenliang <chenliang88@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agobootindex: add del_boot_device_path function
Gonglei [Tue, 7 Oct 2014 08:00:07 +0000 (16:00 +0800)] 
bootindex: add del_boot_device_path function

Introduce del_boot_device_path() to clean up fw_cfg content when
hot-unplugging a device that refers to a bootindex or update a
existent devcie's bootindex.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Chenliang <chenliang88@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agobootindex: add check bootindex function
Gonglei [Tue, 7 Oct 2014 08:00:06 +0000 (16:00 +0800)] 
bootindex: add check bootindex function

Determine whether a given bootindex exists or not.
If exists, we report an error.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agobootdevice: move bootdevice related code to new file bootdevice.c
Gonglei [Tue, 7 Oct 2014 08:00:05 +0000 (16:00 +0800)] 
bootdevice: move bootdevice related code to new file bootdevice.c

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agoMerge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' into staging
Peter Maydell [Wed, 15 Oct 2014 07:12:53 +0000 (08:12 +0100)] 
Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' into staging

QOM infrastructure fixes and device conversions

* GPIO conversion to QOM, continued
* Device property description support
* QTest cases for hotplug
* Hotplug handler conversion

# gpg: Signature made Wed 15 Oct 2014 04:05:17 BST using RSA key ID 3E7E013F
# gpg: Good signature from "Andreas Färber <afaerber@suse.de>"
# gpg:                 aka "Andreas Färber <afaerber@suse.com>"

* remotes/afaerber/tags/qom-devices-for-peter: (47 commits)
  qdev: Drop legacy_name from qdev properties
  qmp: Print descriptions of object properties
  qdev: Set the object property's description to the qdev property's.
  qom: Add description field in ObjectProperty struct
  qdev: Add description field in PropertyInfo struct
  qdev: device_del: Search for to be unplugged device in 'peripheral' container
  qdev: HotplugHandler: Add support for unplugging BUS-less devices
  qdev: Drop legacy hotplug fields/methods
  usb: Convert usb devices to hotplug handler API
  usb: Convert usb-ccid to hotplug handler API
  usb-storage: Drop not needed "allow_hotplug = 0"
  usb-bot: Drop not needed "allow_hotplug = 0"
  usb-bot: Mark device as non hotpluggable
  scsi: Cleanup not used anymore SCSIBusInfo{hotplug, hot_unplug} fields
  scsi: Convert virtio-scsi HBA to hotplug handler API
  scsi: Convert pvscsi HBA to hotplug handler API
  scsi: Set SCSI BUS itself as default HotplugHandler
  s390x: Convert virtio-ccw to hotplug handler API
  s390x: Convert s390-virtio to hotplug handler API
  s390x: Drop not used allow_hotplug in event-facility
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoqdev: Drop legacy_name from qdev properties
Gonglei [Tue, 7 Oct 2014 06:33:24 +0000 (14:33 +0800)] 
qdev: Drop legacy_name from qdev properties

The legacy_name is useless now, better help
information is provided by description field of property.

Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agoqmp: Print descriptions of object properties
Gonglei [Tue, 7 Oct 2014 06:33:23 +0000 (14:33 +0800)] 
qmp: Print descriptions of object properties

Add a new "description" field to DevicePropertyInfo.
The descriptions can serve as documentation in the code,
and they can be used to provide better help. For example:

$./qemu-system-x86_64 -device virtio-blk-pci,?

Before this patch:

virtio-blk-pci.iothread=link<iothread>
virtio-blk-pci.x-data-plane=bool
virtio-blk-pci.scsi=bool
virtio-blk-pci.config-wce=bool
virtio-blk-pci.serial=str
virtio-blk-pci.secs=uint32
virtio-blk-pci.heads=uint32
virtio-blk-pci.cyls=uint32
virtio-blk-pci.discard_granularity=uint32
virtio-blk-pci.bootindex=int32
virtio-blk-pci.opt_io_size=uint32
virtio-blk-pci.min_io_size=uint16
virtio-blk-pci.physical_block_size=uint16
virtio-blk-pci.logical_block_size=uint16
virtio-blk-pci.drive=str
virtio-blk-pci.virtio-backend=child<virtio-blk-device>
virtio-blk-pci.command_serr_enable=on/off
virtio-blk-pci.multifunction=on/off
virtio-blk-pci.rombar=uint32
virtio-blk-pci.romfile=str
virtio-blk-pci.addr=pci-devfn
virtio-blk-pci.event_idx=on/off
virtio-blk-pci.indirect_desc=on/off
virtio-blk-pci.vectors=uint32
virtio-blk-pci.ioeventfd=on/off
virtio-blk-pci.class=uint32

After:

virtio-blk-pci.iothread=link<iothread>
virtio-blk-pci.x-data-plane=bool (on/off)
virtio-blk-pci.scsi=bool (on/off)
virtio-blk-pci.config-wce=bool (on/off)
virtio-blk-pci.serial=str
virtio-blk-pci.secs=uint32
virtio-blk-pci.heads=uint32
virtio-blk-pci.cyls=uint32
virtio-blk-pci.discard_granularity=uint32
virtio-blk-pci.bootindex=int32
virtio-blk-pci.opt_io_size=uint32
virtio-blk-pci.min_io_size=uint16
virtio-blk-pci.physical_block_size=uint16 (A power of two between 512 and 32768)
virtio-blk-pci.logical_block_size=uint16 (A power of two between 512 and 32768)
virtio-blk-pci.drive=str (ID of a drive to use as a backend)
virtio-blk-pci.virtio-backend=child<virtio-blk-device>
virtio-blk-pci.command_serr_enable=bool (on/off)
virtio-blk-pci.multifunction=bool (on/off)
virtio-blk-pci.rombar=uint32
virtio-blk-pci.romfile=str
virtio-blk-pci.addr=int32 (Slot and optional function number, example: 06.0 or 06)
virtio-blk-pci.event_idx=bool (on/off)
virtio-blk-pci.indirect_desc=bool (on/off)
virtio-blk-pci.vectors=uint32
virtio-blk-pci.ioeventfd=bool (on/off)
virtio-blk-pci.class=uint32

Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agoqdev: Set the object property's description to the qdev property's.
Gonglei [Tue, 7 Oct 2014 06:33:22 +0000 (14:33 +0800)] 
qdev: Set the object property's description to the qdev property's.

Set all static qdev properties' descriptions to object property's
description.

Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agoqom: Add description field in ObjectProperty struct
Gonglei [Tue, 7 Oct 2014 06:33:21 +0000 (14:33 +0800)] 
qom: Add description field in ObjectProperty struct

The descriptions can serve as documentation in the code,
and they can be used to provide better help.

Copy property descriptions when copying alias properties.

Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agoqdev: Add description field in PropertyInfo struct
Gonglei [Tue, 7 Oct 2014 06:33:20 +0000 (14:33 +0800)] 
qdev: Add description field in PropertyInfo struct

The descriptions can serve as documentation in the code,
and they can be used to provide better help.

Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agoqdev: device_del: Search for to be unplugged device in 'peripheral' container
Igor Mammedov [Thu, 2 Oct 2014 10:08:45 +0000 (10:08 +0000)] 
qdev: device_del: Search for to be unplugged device in 'peripheral' container

device_add puts every device with 'id' inside of 'peripheral'
container using id's value as the last component name.
Use it by replacing recursive search on sysbus with path
lookup in 'peripheral' container, which could handle both
BUS and BUS-less device cases.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agoqdev: HotplugHandler: Add support for unplugging BUS-less devices
Igor Mammedov [Fri, 26 Sep 2014 09:28:41 +0000 (09:28 +0000)] 
qdev: HotplugHandler: Add support for unplugging BUS-less devices

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agoqdev: Drop legacy hotplug fields/methods
Igor Mammedov [Fri, 26 Sep 2014 09:28:40 +0000 (09:28 +0000)] 
qdev: Drop legacy hotplug fields/methods

It removes not needed anymore BusState::allow_hotplug field and
DeviceClass::unplug callback.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agousb: Convert usb devices to hotplug handler API
Igor Mammedov [Fri, 26 Sep 2014 09:28:39 +0000 (09:28 +0000)] 
usb: Convert usb devices to hotplug handler API

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agousb: Convert usb-ccid to hotplug handler API
Igor Mammedov [Fri, 26 Sep 2014 09:28:38 +0000 (09:28 +0000)] 
usb: Convert usb-ccid to hotplug handler API

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agousb-storage: Drop not needed "allow_hotplug = 0"
Igor Mammedov [Fri, 26 Sep 2014 09:28:37 +0000 (09:28 +0000)] 
usb-storage: Drop not needed "allow_hotplug = 0"

Drop useless hack that disables hotplug on bus, after backend
storage was added to it, by setting "allow_hotplug = 0". Even
if bus is hotpluggable, it won't be possible to add another
SCSI device to bus since its realize will fail early with
error "no free target" in scsi_qdev_realize() method.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agousb-bot: Drop not needed "allow_hotplug = 0"
Igor Mammedov [Fri, 26 Sep 2014 09:28:36 +0000 (09:28 +0000)] 
usb-bot: Drop not needed "allow_hotplug = 0"

Drop useless hack that disables hotplug on bus by setting
"allow_hotplug = 0". Even if bus is hotpluggable, It won't
be possible to add another SCSI device to bus since its
realization will fail early with error "no free target"
in scsi_qdev_realize() method.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agousb-bot: Mark device as non hotpluggable
Igor Mammedov [Fri, 26 Sep 2014 09:28:35 +0000 (09:28 +0000)] 
usb-bot: Mark device as non hotpluggable

usb-bot creates SCSI bus and immediately makes it
non hotpluggable which was making not possible to
hotplug usb-bot since QEMU would abort at
bus_add_child(scsi-hd) time when usb-bot is
realized.

Mark usb-bot as not hotpluggable so that attempt
to hotplug it would error out even before it gets
to device initialization point.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agoscsi: Cleanup not used anymore SCSIBusInfo{hotplug, hot_unplug} fields
Igor Mammedov [Fri, 26 Sep 2014 09:28:34 +0000 (09:28 +0000)] 
scsi: Cleanup not used anymore SCSIBusInfo{hotplug, hot_unplug} fields

SCSI subsytem was converted to hotplug handler API and
doesn't use SCSIBusInfo{hotplug, hot_unplug} fields and
related callbacks anymore.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agoscsi: Convert virtio-scsi HBA to hotplug handler API
Igor Mammedov [Fri, 26 Sep 2014 09:28:33 +0000 (09:28 +0000)] 
scsi: Convert virtio-scsi HBA to hotplug handler API

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agoscsi: Convert pvscsi HBA to hotplug handler API
Igor Mammedov [Fri, 26 Sep 2014 09:28:32 +0000 (09:28 +0000)] 
scsi: Convert pvscsi HBA to hotplug handler API

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agoscsi: Set SCSI BUS itself as default HotplugHandler
Igor Mammedov [Fri, 26 Sep 2014 09:28:31 +0000 (09:28 +0000)] 
scsi: Set SCSI BUS itself as default HotplugHandler

That would allow to handle SCSI device unplug
on HBAs without dedicated hot(un)plug handlers
and avoid making such HBAs explicitly hotpluggable.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agos390x: Convert virtio-ccw to hotplug handler API
Igor Mammedov [Fri, 26 Sep 2014 09:28:30 +0000 (09:28 +0000)] 
s390x: Convert virtio-ccw to hotplug handler API

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agos390x: Convert s390-virtio to hotplug handler API
Igor Mammedov [Fri, 26 Sep 2014 12:37:30 +0000 (12:37 +0000)] 
s390x: Convert s390-virtio to hotplug handler API

Beside of conversion, patch drops present unplug
handling, effectively disabling hot-unplug of
s390-virtio devices.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agos390x: Drop not used allow_hotplug in event-facility
Igor Mammedov [Fri, 26 Sep 2014 09:28:28 +0000 (09:28 +0000)] 
s390x: Drop not used allow_hotplug in event-facility

s390-sclp-event-facility creates s390-sclp-events-bus
and immediately sets its allow_hotplug field to 0,
which is NOP since it's already 0 by default.

Also since BUS is not hotpluggable, it's not possible
to call SCLP_EVENT{ DeviceClass::unplug } callback
from qdev_unplug() making this unreachable code,
so drop it as well.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agovirtio-mmio: Drop useless bus->allow_hotplug = 0
Igor Mammedov [Fri, 26 Sep 2014 09:28:27 +0000 (09:28 +0000)] 
virtio-mmio: Drop useless bus->allow_hotplug = 0

Bus by default is not hotpluggable.
virtio-mmio-bus and its parent types do not set allow_hotplug
anywhere explicitly, so remove not needed field access
and wrapper along with it.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agovirtio-serial: Convert to hotplug-handler API
Igor Mammedov [Fri, 26 Sep 2014 09:28:26 +0000 (09:28 +0000)] 
virtio-serial: Convert to hotplug-handler API

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agovirtio-pci: Drop BusState::allow_hotplug
Igor Mammedov [Fri, 26 Sep 2014 09:28:25 +0000 (09:28 +0000)] 
virtio-pci: Drop BusState::allow_hotplug

virtio-pci-bus is an internal object of composite
virtio-pci device and it doesn't participate in
-device/device_add hotplug flow, and since it's
not required by bus_add_child() that BUS must
be hotpluggable to be able to add child at runtime,
it's possible to drop not needed 'allow_hotplug'
field.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agotarget-i386: ICC bus: Drop BusState::allow_hotplug
Igor Mammedov [Fri, 26 Sep 2014 09:28:24 +0000 (09:28 +0000)] 
target-i386: ICC bus: Drop BusState::allow_hotplug

Since bus_add_child() no longer cares if BUS is hotpluggable
or not, there is no need in setting allow_hotplug field.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agoqdev: Drop hotplug check from bus_add_child()
Igor Mammedov [Fri, 26 Sep 2014 09:28:23 +0000 (09:28 +0000)] 
qdev: Drop hotplug check from bus_add_child()

Check is too restrictive and does not allow
to add children to just created bus during hotplug
when the bus is part of composite device.

Removing check from bus_add_child() doesn't affect
devices creatable with device_add/del commands since
they have a similar builtin check and patch will
allow to create complex composite devices during
hotplug.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agoqdev: Add wrapper to set BUS as HotplugHandler
Igor Mammedov [Fri, 26 Sep 2014 09:28:22 +0000 (09:28 +0000)] 
qdev: Add wrapper to set BUS as HotplugHandler

To be used for conversion of SCSI and USB devices,
and would allow to make every HBA/USB host switch
to HotplugHandler API without touching each controller
explicitly.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agoqdev: Add simple/generic unplug callback for HotplugHandler
Igor Mammedov [Fri, 26 Sep 2014 09:28:21 +0000 (09:28 +0000)] 
qdev: Add simple/generic unplug callback for HotplugHandler

It will be used in shallow conversion from legacy hotplug
mechanism and eventually replace all the uses of old mechanism
DeviceClass::unplug = qdev_simple_unplug_cb()

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agoqdev: HotplugHandler: Provide unplug callback
Igor Mammedov [Fri, 26 Sep 2014 09:28:20 +0000 (09:28 +0000)] 
qdev: HotplugHandler: Provide unplug callback

It is to be called for actual device removal and
will allow to separate request and removal handling
phases of x86-CPU devices and also it's a handler
to be called for synchronously removable devices.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agoqdev: HotplugHandler: Rename unplug callback to unplug_request
Igor Mammedov [Fri, 26 Sep 2014 09:28:19 +0000 (09:28 +0000)] 
qdev: HotplugHandler: Rename unplug callback to unplug_request

'HotplugHandler.unplug' callback is currently used as async
call to issue unplug request for device that implements it.
Renaming 'unplug' callback to 'unplug_request' should help to
avoid confusion about what callback does and would allow to
introduce 'unplug' callback that would perform actual device
removal when guest is ready for it.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agoqdev: do not allow to instantiate non hotpluggable device with device_add
Igor Mammedov [Fri, 26 Sep 2014 09:28:18 +0000 (09:28 +0000)] 
qdev: do not allow to instantiate non hotpluggable device with device_add

It will allow explicitly mark device as not hotpluggable and
avoid its creation with following error at realize time
and destroying it afterwards anyway. Instead of it will
error out even before instance of device is created.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agoAccess BusState::allow_hotplug using wraper qbus_is_hotpluggable()
Igor Mammedov [Fri, 26 Sep 2014 09:28:17 +0000 (09:28 +0000)] 
Access BusState::allow_hotplug using wraper qbus_is_hotpluggable()

It would allow to transparently switch detection whether Bus
is hotpluggable from allow_hotplug field to hotplug_handler
link and to drop allow_hotplug field once all users are
converted to hotplug handler API.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agotests: usb: usb-uas hotplug test
Igor Mammedov [Fri, 26 Sep 2014 09:28:16 +0000 (09:28 +0000)] 
tests: usb: usb-uas hotplug test

checks that it's possible to hotplug usb-uas HBA and
then if it's possible to hot(un)plug scsi-disk to it.
Thest basically covers hot(un)plug on dummy HBAs
without means of hot(un)plug notification of the guest.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agotests: usb: usb-storage hotplug test
Igor Mammedov [Fri, 26 Sep 2014 09:28:15 +0000 (09:28 +0000)] 
tests: usb: usb-storage hotplug test

usb-storage is different from usual usb devices
in that it uses a child SCSI bus for underlying storage.
This commit verifies that the SCSI bus is hotpluggable, as
hotplug operation wouldn't succeed without it.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agotests: usb: Generic usb device hotplug
Igor Mammedov [Fri, 26 Sep 2014 09:28:14 +0000 (09:28 +0000)] 
tests: usb: Generic usb device hotplug

use usb-tablet as a hotplugged usb device.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agotests: usb: add port test to uhci unit test
Igor Mammedov [Fri, 26 Sep 2014 09:28:13 +0000 (09:28 +0000)] 
tests: usb: add port test to uhci unit test

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agotests: usb: Move uhci port test code to libqos/usb.c
Igor Mammedov [Fri, 26 Sep 2014 09:28:12 +0000 (09:28 +0000)] 
tests: usb: Move uhci port test code to libqos/usb.c

Move code necessary for testing uhci port into library
so it could be used by other USB tests.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agotests: virtio-blk: Check if hot-plug/unplug works
Igor Mammedov [Fri, 26 Sep 2014 09:28:11 +0000 (09:28 +0000)] 
tests: virtio-blk: Check if hot-plug/unplug works

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agotests: virtio-net: Check if hot-plug/unplug works
Igor Mammedov [Fri, 26 Sep 2014 09:28:10 +0000 (09:28 +0000)] 
tests: virtio-net: Check if hot-plug/unplug works

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agotests: virtio-rng: Check if hot-plug/unplug works
Igor Mammedov [Fri, 26 Sep 2014 09:28:09 +0000 (09:28 +0000)] 
tests: virtio-rng: Check if hot-plug/unplug works

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agolibqos: Add qpci_plug_device_test() and qpci_unplug_acpi_device_test()
Igor Mammedov [Fri, 26 Sep 2014 09:28:08 +0000 (09:28 +0000)] 
libqos: Add qpci_plug_device_test() and qpci_unplug_acpi_device_test()

Functions will be used for testing hot(un)plug of PCI devices.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agotests: virtio-serial: Check if hot-plug/unplug works
Igor Mammedov [Fri, 26 Sep 2014 09:28:07 +0000 (09:28 +0000)] 
tests: virtio-serial: Check if hot-plug/unplug works

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agotests: virtio-scsi: Check if hot-plug/unplug works
Igor Mammedov [Fri, 26 Sep 2014 09:28:06 +0000 (09:28 +0000)] 
tests: virtio-scsi: Check if hot-plug/unplug works

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agoqom: Add error handler for object alias property
Gonglei [Sat, 27 Sep 2014 05:13:56 +0000 (13:13 +0800)] 
qom: Add error handler for object alias property

object_property_add_alias() is called at some
places at present. And its parameter errp may not NULL,
such as
 object_property_add_alias(obj, "iothread", OBJECT(&dev->vdev),"iothread",
                              &error_abort);
This patch add error handler for security.

Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agoqom: Add error handler for object_property_print()
Gonglei [Sat, 27 Sep 2014 05:13:55 +0000 (13:13 +0800)] 
qom: Add error handler for object_property_print()

Avoid the caller of object_property_print() leaking string
argument's memory, such as qdev_print_props() when
encounter errors.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
5 years agotarget-mips: Remove unused gen_load_ACX, gen_store_ACX and cpu_ACX
Peter Maydell [Sun, 14 Sep 2014 19:45:34 +0000 (20:45 +0100)] 
target-mips: Remove unused gen_load_ACX, gen_store_ACX and cpu_ACX

Remove the functions gen_load_ACX and gen_store_ACX, which appear to have
been unused since they were first introduced many years ago. These functions
were the only places using the cpu_ACX[] array of TCG globals, so remove
that and its accompanying regnames_ACX[] as well.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
5 years agotarget-mips/dsp_helper.c: Add ifdef guards around various functions
Peter Maydell [Sun, 14 Sep 2014 19:45:36 +0000 (20:45 +0100)] 
target-mips/dsp_helper.c: Add ifdef guards around various functions

Add ifdef TARGET_MIPS64 guards around various functions that are only
called from helpers for TARGET_MIPS64 CPUs; this avoids compiler
warnings when building other configs.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
5 years agotarget-mips/translate.c: Add ifdef guard around check_mips64()
Peter Maydell [Sun, 14 Sep 2014 19:45:35 +0000 (20:45 +0100)] 
target-mips/translate.c: Add ifdef guard around check_mips64()

The function check_mips64() is only used if TARGET_MIPS64 is defined;
add an ifdef guard to its definition to avoid warnings about it being
unused in other configurations.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
5 years agotarget-mips/op_helper.c: Remove unused do_lbu() function
Peter Maydell [Sun, 14 Sep 2014 19:45:38 +0000 (20:45 +0100)] 
target-mips/op_helper.c: Remove unused do_lbu() function

The do_lbu() function defined by the expansion of HELPER_LD() is
never used, so don't define it.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
5 years agotarget-mips/dsp_helper.c: Remove unused function get_DSPControl_24()
Peter Maydell [Sun, 14 Sep 2014 19:45:37 +0000 (20:45 +0100)] 
target-mips/dsp_helper.c: Remove unused function get_DSPControl_24()

The function get_DSPControl_24() is unused; remove it.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
5 years agotarget-mips: fix broken MIPS16 and microMIPS
Yongbok Kim [Tue, 1 Jul 2014 16:43:05 +0000 (17:43 +0100)] 
target-mips: fix broken MIPS16 and microMIPS

Commit 240ce26a broke MIPS16 and microMIPS support as it didn't
care those branches and jumps don't have delay slot in
MIPS16 and microMIPS.

This patch introduces a new argument delayslot_size to the
gen_compute_branch() indicating size of delay slot {0, 2, 4}.
And the information is used to call handle_delay_slot() forcingly
when no delay slot is required.

There are some microMIPS branch and jump instructions that requires
exact size of instruction in the delay slot. For indicating
these instructions, MIPS_HFLAG_BDS_STRICT flag is introduced.

Those fictional branch opcodes defined to support MIPS16 and
microMIPS are no longer needed.

Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
Tested-by: Jonas Gorski <jogo@openwrt.org>
Reviewed-by: Leon Alrae <leon.alrae@imgtec.com>
[leon.alrae@imgtec.com: cosmetic changes]
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
5 years agotarget-mips/translate.c: Update OPC_SYNCI
Dongxue Zhang [Tue, 29 Jul 2014 13:48:10 +0000 (21:48 +0800)] 
target-mips/translate.c: Update OPC_SYNCI

Update OPC_SYNCI with BS_STOP, in order to handle the instructions which saved
in the same TB of the store instruction.

Signed-off-by: Dongxue Zhang <elta.era@gmail.com>
Reviewed-by: Yongbok Kim <yongbok.kim@imgtec.com>
[leon.alrae@imgtec.com: update microMIPS SYNCI as well]
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
5 years agotarget-mips: define a new generic CPU supporting MIPS64 Release 6 ISA
Leon Alrae [Fri, 27 Jun 2014 07:49:09 +0000 (08:49 +0100)] 
target-mips: define a new generic CPU supporting MIPS64 Release 6 ISA

Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Yongbok Kim <yongbok.kim@imgtec.com>
5 years agomips_malta: update malta's pseudo-bootloader - replace JR with JALR
Leon Alrae [Fri, 27 Jun 2014 07:49:08 +0000 (08:49 +0100)] 
mips_malta: update malta's pseudo-bootloader - replace JR with JALR

JR has been removed in R6 and now this instruction will cause Reserved
Instruction Exception. Therefore use JALR with rd=0 which is equivalent to JR.

Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
5 years agotarget-mips: remove JR, BLTZAL, BGEZAL and add NAL, BAL instructions
Yongbok Kim [Fri, 27 Jun 2014 07:49:08 +0000 (08:49 +0100)] 
target-mips: remove JR, BLTZAL, BGEZAL and add NAL, BAL instructions

Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
5 years agotarget-mips: do not allow Status.FR=0 mode in 64-bit FPU
Leon Alrae [Fri, 27 Jun 2014 07:49:07 +0000 (08:49 +0100)] 
target-mips: do not allow Status.FR=0 mode in 64-bit FPU

Status.FR bit must be ignored on write and read as 1 when an implementation of
Release 6 of the Architecture in which a 64-bit floating point unit is
implemented.

Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Yongbok Kim <yongbok.kim@imgtec.com>
5 years agotarget-mips: add new Floating Point Comparison instructions
Yongbok Kim [Fri, 27 Jun 2014 07:49:07 +0000 (08:49 +0100)] 
target-mips: add new Floating Point Comparison instructions

Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>