Alex Chen
a88ae03757
i.MX31: Fix bad printf format specifiers
...
We should use printf format specifier "%u" instead of "%d" for
argument of type "unsigned int".
Reported-by: Euler Robot <euler.robot@huawei.com >
Signed-off-by: Alex Chen <alex.chen@huawei.com >
Message-id: 20201126111109.112238-3-alex.chen@huawei.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org >
Signed-off-by: Peter Maydell <peter.maydell@linaro.org >
2020-12-10 11:44:55 +00:00
Alex Chen
26c69099f7
i.MX25: Fix bad printf format specifiers
...
We should use printf format specifier "%u" instead of "%d" for
argument of type "unsigned int".
Reported-by: Euler Robot <euler.robot@huawei.com >
Signed-off-by: Alex Chen <alex.chen@huawei.com >
Message-id: 20201126111109.112238-2-alex.chen@huawei.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org >
Signed-off-by: Peter Maydell <peter.maydell@linaro.org >
2020-12-10 11:44:55 +00:00
Marcin Juszkiewicz
ce3adffc3c
sbsa-ref: allow to use Cortex-A53/57/72 cpus
...
Trusted Firmware now supports A72 on sbsa-ref by default [1] so enable
it for QEMU as well. A53 was already enabled there.
1. https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/7117
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-id: 20201120141705.246690-1-marcin.juszkiewicz@linaro.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org >
Signed-off-by: Peter Maydell <peter.maydell@linaro.org >
2020-12-10 11:30:44 +00:00
Vikram Garhwal
840c22cd54
xlnx-zynqmp: Connect Xilinx ZynqMP CAN controllers
...
Connect CAN0 and CAN1 on the ZynqMP.
Reviewed-by: Francisco Iglesias <francisco.iglesias@xilinx.com >
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com >
Signed-off-by: Vikram Garhwal <fnu.vikram@xilinx.com >
Message-id: 1605728926-352690-3-git-send-email-fnu.vikram@xilinx.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org >
2020-12-10 11:30:44 +00:00
Vikram Garhwal
98e5d7a2b7
hw/net/can: Introduce Xilinx ZynqMP CAN controller
...
The Xilinx ZynqMP CAN controller is developed based on SocketCAN, QEMU CAN bus
implementation. Bus connection and socketCAN connection for each CAN module
can be set through command lines.
Example for using single CAN:
-object can-bus,id=canbus0 \
-machine xlnx-zcu102.canbus0=canbus0 \
-object can-host-socketcan,id=socketcan0,if=vcan0,canbus=canbus0
Example for connecting both CAN to same virtual CAN on host machine:
-object can-bus,id=canbus0 -object can-bus,id=canbus1 \
-machine xlnx-zcu102.canbus0=canbus0 \
-machine xlnx-zcu102.canbus1=canbus1 \
-object can-host-socketcan,id=socketcan0,if=vcan0,canbus=canbus0 \
-object can-host-socketcan,id=socketcan1,if=vcan0,canbus=canbus1
To create virtual CAN on the host machine, please check the QEMU CAN docs:
https://github.com/qemu/qemu/blob/master/docs/can.txt
Signed-off-by: Vikram Garhwal <fnu.vikram@xilinx.com >
Message-id: 1605728926-352690-2-git-send-email-fnu.vikram@xilinx.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org >
Signed-off-by: Peter Maydell <peter.maydell@linaro.org >
2020-12-10 11:30:44 +00:00
Kunkun Jiang
d9aad887e8
hw/arm/smmuv3: Fix up L1STD_SPAN decoding
...
Accroding to the SMMUv3 spec, the SPAN field of Level1 Stream Table
Descriptor is 5 bits([4:0]).
Fixes: 9bde7f0674f(hw/arm/smmuv3: Implement translate callback)
Signed-off-by: Kunkun Jiang <jiangkunkun@huawei.com >
Message-id: 20201124023711.1184-1-jiangkunkun@huawei.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org >
Acked-by: Eric Auger <eric.auger@redhat.com >
Signed-off-by: Peter Maydell <peter.maydell@linaro.org >
2020-12-10 11:30:44 +00:00
John Wang
6f5f6507e4
aspeed: g220a-bmc: Add an FRU
...
Add an eeprom device and fill it with fru
information
$ ipmitool fru print 0
Product Manufacturer : Bytedance
Product Name : G220A
Signed-off-by: John Wang <wangzhiqiang.bj@bytedance.com >
Reviewed-by: Cédric Le Goater <clg@kaod.org >
Message-Id: <20201210103607.556-1-wangzhiqiang.bj@bytedance.com >
Signed-off-by: Cédric Le Goater <clg@kaod.org >
2020-12-10 12:11:03 +01:00
Cédric Le Goater
af453a5ef5
aspeed/smc: Add support for address lane disablement
...
The controller can be configured to disable or enable address and data
byte lanes when issuing commands. This is useful in read command mode
to send SPI NOR commands that don't have an address space, such as
RDID. It's a good way to have a unified read operation for registers
and flash contents accesses.
A new SPI driver proposed by Aspeed makes use of this feature. Add
support for address lanes to start with. We will do the same for the
data lanes if they are controlled one day.
Cc: Chin-Ting Kuo <chin-ting_kuo@aspeedtech.com >
Signed-off-by: Cédric Le Goater <clg@kaod.org >
Reviewed-by: Joel Stanley <joel@jms.id.au >
Message-Id: <20201120161547.740806-2-clg@kaod.org >
Signed-off-by: Cédric Le Goater <clg@kaod.org >
2020-12-10 12:11:03 +01:00
Joel Stanley
e01b4d5b6e
ast2600: SRAM is 89KB
...
On the AST2600A1, the SRAM size was increased to 89KB.
Fixes: 7582591ae7
("aspeed: Support AST2600A1 silicon revision")
Signed-off-by: Joel Stanley <joel@jms.id.au >
Reviewed-by: Cédric Le Goater <clg@kaod.org >
Message-Id: <20201112012113.835858-1-joel@jms.id.au >
Signed-off-by: Cédric Le Goater <clg@kaod.org >
2020-12-10 12:11:03 +01:00
John Wang
95f068c83d
aspeed: Add support for the g220a-bmc board
...
G220A is a 2 socket x86 motherboard supported by OpenBMC.
Strapping configuration was obtained from hardware.
Signed-off-by: John Wang <wangzhiqiang.bj@bytedance.com >
Reviewed-by: Cédric Le Goater <clg@kaod.org >
Reviewed-by: Joel Stanley <joel@jms.id.au >
Message-Id: <20201122105134.671-2-wangzhiqiang.bj@bytedance.com >
Signed-off-by: Cédric Le Goater <clg@kaod.org >
2020-12-10 12:11:03 +01:00
John Wang
5e623f2bf1
hw/misc: add an EMC141{3,4} device model
...
Largely inspired by the TMP421 temperature sensor, here is a model for
the EMC1413/EMC1414 temperature sensors.
Specs can be found here :
http://ww1.microchip.com/downloads/en/DeviceDoc/20005274A.pdf
Signed-off-by: John Wang <wangzhiqiang.bj@bytedance.com >
Reviewed-by: Cédric Le Goater <clg@kaod.org >
Message-Id: <20201122105134.671-1-wangzhiqiang.bj@bytedance.com >
Signed-off-by: Cédric Le Goater <clg@kaod.org >
2020-12-10 12:11:03 +01:00
Gerd Hoffmann
4d01b8994c
microvm: add second ioapic
...
Create second ioapic, route virtio-mmio IRQs to it,
allow more virtio-mmio devices (24 instead of 8).
Needs ACPI, enabled by default, can be turned off
using -machine ioapic2=off
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Reviewed-by: Igor Mammedov <imammedo@redhat.com >
Reviewed-by: Sergio Lopez <slp@redhat.com >
Message-id: 20201203105423.10431-8-kraxel@redhat.com
2020-12-10 08:47:44 +01:00
Gerd Hoffmann
e57e9ae799
microvm: drop microvm_gsi_handler()
...
With the improved gsi_handler() we don't need
our private version any more.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Reviewed-by: Igor Mammedov <imammedo@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Reviewed-by: Sergio Lopez <slp@redhat.com >
Message-id: 20201203105423.10431-7-kraxel@redhat.com
2020-12-10 08:47:44 +01:00
Gerd Hoffmann
3d09c00704
microvm: make pcie irq base runtime changeable
...
Allows to move them in case we have enough
irq lines available.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Reviewed-by: Igor Mammedov <imammedo@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Reviewed-by: Sergio Lopez <slp@redhat.com >
Message-id: 20201203105423.10431-6-kraxel@redhat.com
2020-12-10 08:47:44 +01:00
Gerd Hoffmann
c214a7bcb6
microvm: make number of virtio transports runtime changeable
...
This will allow to increase the number of transports in
case we have enough irq lines available for them all.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Reviewed-by: Igor Mammedov <imammedo@redhat.com >
Reviewed-by: Sergio Lopez <slp@redhat.com >
Message-id: 20201203105423.10431-5-kraxel@redhat.com
2020-12-10 08:47:44 +01:00
Gerd Hoffmann
94c5a60637
x86: add support for second ioapic
...
Add ioapic_init_secondary to initialize it, wire up
in gsi handling and acpi apic table creation.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Reviewed-by: Igor Mammedov <imammedo@redhat.com >
Reviewed-by: Sergio Lopez <slp@redhat.com >
Message-id: 20201203105423.10431-4-kraxel@redhat.com
2020-12-10 08:47:44 +01:00
Gerd Hoffmann
ceea95cd88
x86: rewrite gsi_handler()
...
Rewrite function to use switch() for IRQ number mapping.
Check i8259_irq exists before raising it so the function
also works in case no i8259 (aka pic) is present.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Reviewed-by: Igor Mammedov <imammedo@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Message-id: 20201203105423.10431-3-kraxel@redhat.com
2020-12-10 08:47:44 +01:00
Peter Maydell
5e7b204dbf
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
...
pc,pci,virtio: fixes, cleanups
Lots of fixes, cleanups.
CPU hot-unplug improvements.
A new AER property for virtio devices, adding a dummy AER capability.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
# gpg: Signature made Wed 09 Dec 2020 18:04:28 GMT
# gpg: using RSA key 5D09FD0871C8F85B94CA8A0D281F0DB8D28D5469
# gpg: issuer "mst@redhat.com "
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org >" [full]
# gpg: aka "Michael S. Tsirkin <mst@redhat.com >" [full]
# Primary key fingerprint: 0270 606B 6F3C DF3D 0B17 0970 C350 3912 AFBE 8E67
# Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA 8A0D 281F 0DB8 D28D 5469
* remotes/mst/tags/for_upstream: (65 commits)
hw/virtio-pci Added AER capability.
hw/virtio-pci Added counter for pcie capabilities offsets.
pcie_aer: Fix help message of pcie_aer_inject_error command
x86: ich9: let firmware negotiate 'CPU hot-unplug with SMI' feature
x86: ich9: factor out "guest_cpu_hotplug_features"
tests/acpi: update expected files
x86: acpi: let the firmware handle pending "CPU remove" events in SMM
tests/acpi: allow expected files change
x86: acpi: introduce AcpiPmInfo::smi_on_cpu_unplug
acpi: cpuhp: introduce 'firmware performs eject' status/control bits
hw/i386/pc: add max combined fw size as machine configuration option
block/export: avoid g_return_val_if() input validation
contrib/vhost-user-input: avoid g_return_val_if() input validation
contrib/vhost-user-gpu: avoid g_return_val_if() input validation
contrib/vhost-user-blk: avoid g_return_val_if() input validation
.gitlab-ci: add build-libvhost-user
libvhost-user: add a simple link test without glib
libvhost-user: make it a meson subproject
libvhost-user: drop qemu/osdep.h dependency
libvhost-user: remove qemu/compiler.h usage
...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org >
2020-12-09 20:08:54 +00:00
Andrew Melnychenko
fdfa3b1d6f
hw/virtio-pci Added AER capability.
...
Added AER capability for virtio-pci devices.
Also added property for devices, by default AER is disabled.
Signed-off-by: Andrew Melnychenko <andrew@daynix.com >
Message-Id: <20201203110713.204938-3-andrew@daynix.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-09 13:04:17 -05:00
Andrew Melnychenko
06e9744242
hw/virtio-pci Added counter for pcie capabilities offsets.
...
Removed hardcoded offset for ats. Added cap offset counter
for future capabilities like AER.
Signed-off-by: Andrew Melnychenko <andrew@daynix.com >
Message-Id: <20201203110713.204938-2-andrew@daynix.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-09 13:04:17 -05:00
Igor Mammedov
7ed3e1ebcb
x86: ich9: let firmware negotiate 'CPU hot-unplug with SMI' feature
...
Keep CPU hotunplug with SMI disabled on 5.2 and older and enable
it by default on newer machine types.
Signed-off-by: Igor Mammedov <imammedo@redhat.com >
Message-Id: <20201207140739.3829993-9-imammedo@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-09 13:04:17 -05:00
Igor Mammedov
cd89134e24
x86: ich9: factor out "guest_cpu_hotplug_features"
...
it will be reused by next patch to check validity of unplug
feature.
Signed-off-by: Igor Mammedov <imammedo@redhat.com >
Message-Id: <20201207140739.3829993-8-imammedo@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-09 13:04:17 -05:00
Igor Mammedov
69dea9d6b3
x86: acpi: let the firmware handle pending "CPU remove" events in SMM
...
if firmware and QEMU negotiated CPU hotunplug support, generate
_EJ0 method so that it will mark CPU for removal by firmware and
pass control to it by triggering SMI.
Signed-off-by: Igor Mammedov <imammedo@redhat.com >
Message-Id: <20201207140739.3829993-6-imammedo@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-09 13:04:17 -05:00
Igor Mammedov
892aae7430
x86: acpi: introduce AcpiPmInfo::smi_on_cpu_unplug
...
Signed-off-by: Igor Mammedov <imammedo@redhat.com >
Message-Id: <20201207140739.3829993-4-imammedo@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-09 13:04:17 -05:00
Igor Mammedov
1e6107d901
acpi: cpuhp: introduce 'firmware performs eject' status/control bits
...
Adds bit #4 to status/control field of CPU hotplug MMIO interface.
New bit will be used OSPM to mark CPUs as pending for removal by firmware,
when it calls _EJ0 method on CPU device node. Later on, when firmware
sees this bit set, it will perform CPU eject which will clear bit #4
as well.
Signed-off-by: Igor Mammedov <imammedo@redhat.com >
Message-Id: <20201207140739.3829993-3-imammedo@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-09 13:04:17 -05:00
Erich-McMillan
0657c657eb
hw/i386/pc: add max combined fw size as machine configuration option
...
At Hewlett Packard Inc. we have a need for increased fw size to enable testing of our custom fw.
Rebase v6 patch to d73c46e4
Signed-off-by: Erich McMillan <erich.mcmillan@hp.com >
Message-Id: <20201208155338.14-1-erich.mcmillan@hp.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-09 13:04:17 -05:00
Peter Maydell
b0bed2c916
hw/m68k/mcf5206: Don't leak IRQs in mcf5206_mbar_realize()
...
Coverity points out that the realize function for the TYPE_MCF5206_MBAR
device leaks the IRQ array it allocates with qemu_allocate_irqs().
Keep a pointer to it in the device state struct to avoid the leak.
(Since it needs to stay around for the life of the simulation there
is no need to actually free it, and the leak was harmless.)
Fixes: Coverity CID 1432412
Signed-off-by: Peter Maydell <peter.maydell@linaro.org >
Reviewed-by: Thomas Huth <huth@tuxfamily.org >
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
Message-Id: <20201120172314.14725-1-peter.maydell@linaro.org >
Signed-off-by: Thomas Huth <thuth@redhat.com >
2020-12-09 08:04:34 +01:00
Cornelia Huck
576a00bdeb
hw: add compat machines for 6.0
...
Add 6.0 machine types for arm/i440fx/q35/s390x/spapr.
Signed-off-by: Cornelia Huck <cohuck@redhat.com >
Message-Id: <20201109173928.1001764-1-cohuck@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-08 13:48:58 -05:00
Juan Quintela
21e8709b29
failover: Remove primary_dev member
...
Only three uses remained, and we can remove them on that case.
Signed-off-by: Juan Quintela <quintela@redhat.com >
Message-Id: <20201118083748.1328-28-quintela@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-08 13:48:58 -05:00
Juan Quintela
07a5d816d5
failover: simplify failover_unplug_primary
...
We can calculate device just once.
Signed-off-by: Juan Quintela <quintela@redhat.com >
Message-Id: <20201118083748.1328-27-quintela@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-08 13:48:58 -05:00
Juan Quintela
0e9a65c5b1
failover: Caller of this two functions already have primary_dev
...
Pass it as an argument.
Signed-off-by: Juan Quintela <quintela@redhat.com >
Message-Id: <20201118083748.1328-26-quintela@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-08 13:48:58 -05:00
Juan Quintela
3abad4a221
failover: We don't need to cache primary_device_id anymore
...
Signed-off-by: Juan Quintela <quintela@redhat.com >
Message-Id: <20201118083748.1328-25-quintela@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-08 13:48:58 -05:00
Juan Quintela
f5e1847ba5
failover: split failover_find_primary_device_id()
...
So we can calculate the device id when we need it.
Signed-off-by: Juan Quintela <quintela@redhat.com >
Message-Id: <20201118083748.1328-24-quintela@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-08 13:48:58 -05:00
Juan Quintela
0a0a27d66b
failover: remove failover_find_primary_device() error parameter
...
It can never give one error.
Signed-off-by: Juan Quintela <quintela@redhat.com >
Message-Id: <20201118083748.1328-23-quintela@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-08 13:48:58 -05:00
Juan Quintela
fec037c1e2
failover: make sure that id always exist
...
We check that it exist at device creation time, so we don't have to
check anywhere else.
Signed-off-by: Juan Quintela <quintela@redhat.com >
Message-Id: <20201118083748.1328-22-quintela@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-08 13:48:58 -05:00
Juan Quintela
85d3b93196
failover: Rename to failover_find_primary_device()
...
This commit:
* Rename them to failover_find_primary_devices() so
- it starts with failover_
- it don't connect anything, just find the primary device
* Create documentation for the function
Signed-off-by: Juan Quintela <quintela@redhat.com >
Message-Id: <20201118083748.1328-19-quintela@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-08 13:48:57 -05:00
Juan Quintela
0763db4f2d
failover: virtio_net_connect_failover_devices() does nothing
...
It just calls virtio_net_find_primary(), so just update the callers.
Signed-off-by: Juan Quintela <quintela@redhat.com >
Message-Id: <20201118083748.1328-18-quintela@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-08 13:48:57 -05:00
Juan Quintela
b91ad981b8
failover: Rename function to hide_device()
...
You should not use pasive.
Signed-off-by: Juan Quintela <quintela@redhat.com >
Message-Id: <20201118083748.1328-17-quintela@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-08 13:48:57 -05:00
Juan Quintela
89631fed27
failover: should_be_hidden() should take a bool
...
We didn't use at all the -1 value, and we don't really care. It was
only used for the cases when this is not the device that we are
searching for. And in that case we should not hide the device.
Once there, simplify virtio-Snet_primary_should_be_hidden.
Signed-off-by: Juan Quintela <quintela@redhat.com >
Message-Id: <20201118083748.1328-16-quintela@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-08 13:48:57 -05:00
Juan Quintela
7cf05b7ed8
failover: simplify virtio_net_find_primary()
...
a - is_my_primary() never sets one error
b - If we return 1, primary_device_id is always set
Signed-off-by: Juan Quintela <quintela@redhat.com >
Message-Id: <20201118083748.1328-15-quintela@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-08 13:48:57 -05:00
Juan Quintela
7b3dc2f8c0
failover: Remove memory leak
...
Two things, at this point:
* n->primary_device_id has to be set, otherwise
virtio_net_find_primary don't work. So we have a leak here.
* it has to be exactly the same that prim_dev->id because what
qdev_find_recursive() does is just compare this two values.
So remove the unneeded assignment and leaky bits.
Signed-off-by: Juan Quintela <quintela@redhat.com >
Message-Id: <20201118083748.1328-14-quintela@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-08 13:48:57 -05:00
Juan Quintela
9673a88e97
failover: Remove primary_device_dict
...
It was only used once. And we have there opts->id, so no need for it.
Signed-off-by: Juan Quintela <quintela@redhat.com >
Message-Id: <20201118083748.1328-13-quintela@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-08 13:48:57 -05:00
Juan Quintela
4f0303aed8
failover: remove standby_id variable
...
We can calculate it, and we only use it once anyways.
Signed-off-by: Juan Quintela <quintela@redhat.com >
Message-Id: <20201118083748.1328-12-quintela@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-08 13:48:57 -05:00
Juan Quintela
19e49bc2e9
failover: Remove primary_device_opts
...
It was really only used once, in failover_add_primary(). Just search
for it on global opts when it is needed.
Signed-off-by: Juan Quintela <quintela@redhat.com >
Message-Id: <20201118083748.1328-11-quintela@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-08 13:48:57 -05:00
Juan Quintela
518eda9fda
failover: g_strcmp0() knows how to handle NULL
...
Signed-off-by: Juan Quintela <quintela@redhat.com >
Message-Id: <20201118083748.1328-10-quintela@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-08 13:48:57 -05:00
Juan Quintela
e2bde83e23
failover: Rename bool to failover_primary_hidden
...
You should not use passive naming variables.
And once there, be able to search for them.
Signed-off-by: Juan Quintela <quintela@redhat.com >
Message-Id: <20201118083748.1328-9-quintela@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-08 13:48:57 -05:00
Juan Quintela
3d1c7a9782
failover: qdev_device_add() returns err or dev set
...
Never both.
Signed-off-by: Juan Quintela <quintela@redhat.com >
Message-Id: <20201118083748.1328-8-quintela@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-08 13:48:57 -05:00
Juan Quintela
594d308b93
failover: Remove external partially_hotplugged property
...
It was only set "once", and with the wrong value. As far as I can see,
libvirt still don't use it.
Signed-off-by: Juan Quintela <quintela@redhat.com >
Message-Id: <20201118083748.1328-7-quintela@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-08 13:48:57 -05:00
Juan Quintela
82ceb65799
failover: Remove unused parameter
...
Signed-off-by: Juan Quintela <quintela@redhat.com >
Message-Id: <20201118083748.1328-6-quintela@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-08 13:48:57 -05:00
Juan Quintela
78274682b7
failover: primary bus is only used once, and where it is set
...
Just remove the struct member.
Signed-off-by: Juan Quintela <quintela@redhat.com >
Message-Id: <20201118083748.1328-5-quintela@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-12-08 13:48:57 -05:00