mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-09-08 16:07:39 -06:00
Machine queue, 2019-01-10
* Simplify GlobalProperty array declarations (Eduardo Habkost) * Deprecate cpu-add commands (Kashyap Chamarthy) * range/memory-device cleanups (David Hildenbrand) * Fix -device scsi-hd,help regression (Marc-André Lureau) * Fix crash when -global generates multiple warnings (Eduardo Habkost) -----BEGIN PGP SIGNATURE----- iQIcBAABCAAGBQJcN1aHAAoJECgHk2+YTcWmi20QALYlChpE/YNh/8RZvpKRRgt4 4aj8/qOlFq+TeoKQPf6KNCrTy6awvVGWOhOZOLdGcalqNZ/l69ZmKmECU0dqTrEw 2zo0FxD8bjqVdsBJifLFa925GbUBHFtw/Am87Qv/LO+PV0bqMMIVUyNo5hd0iMej AhwlaIKAJxIKlsUiZOXpc2n1siFBjciJWdNapsam+ia8b8Y5jZ5GlkfTCJ3Nve2m uHMTPTt6iQao3YmPZ11E2elQENV7F51wM21Ti93Eo90FRpmADzsGw+lnh4wp50Mr q2QvaDByxcNEfdhKWOTdjRV6pkVBUh6GZps9SJvFtSGc2vfxqPgpi+HvN6f79uIO QV3rbkM0dyR+xveKrBVHA7MjCNEdVdpz5GRsYHDC3kjZC/dpEN/nV5g4TKSMzd6A hHQi6sRBi1qiKytsRB8sTElDDJxmoE8t5X1QeW+Wws0hBKVnrlr/BY0u09ip2j4x qoR4QG1nrmAXHIKVwsIdn8tiPqX2iq+OPu/Tp8FHlRI/90+3jazSbderT6I/9oCd AqnxSGXRoPhK0l0n/57mcPeY478ENtRqdeUkUVDVFSoTG9ys8aYqYzS19CdrRExo QsJ1M+NGWqzCal4VxNrdbUHAQoG4b1tVnQJMiFBc9LxS/88Da7huoiXRwAQkwOCd Um3orC2vlv78QXTwTho6 =LNk6 -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging Machine queue, 2019-01-10 * Simplify GlobalProperty array declarations (Eduardo Habkost) * Deprecate cpu-add commands (Kashyap Chamarthy) * range/memory-device cleanups (David Hildenbrand) * Fix -device scsi-hd,help regression (Marc-André Lureau) * Fix crash when -global generates multiple warnings (Eduardo Habkost) # gpg: Signature made Thu 10 Jan 2019 14:28:23 GMT # gpg: using RSA key 2807936F984DC5A6 # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/machine-next-pull-request: qom: Don't keep error value between object_property_parse() calls qdev: fix -device scsi-hd,help regression machine: Use shorter format for GlobalProperty arrays machine: Eliminate unnecessary stringify() usage spapr: Eliminate SPAPR_PCI_2_7_MMIO_WIN_SIZE macro memory-device: rewrite address assignment using ranges range: add some more functions Mention that QMP 'cpu-add' will be deprecated Update that HMP 'cpu-add' is deprecated in 4.0 qemu-deprecated.texi: Rename the HMP section Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
e53f7796fb
13 changed files with 368 additions and 1200 deletions
|
@ -112,6 +112,68 @@ static inline uint64_t range_upb(Range *range)
|
|||
return range->upb;
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize @range to span the interval [@lob,@lob + @size - 1].
|
||||
* @size may be 0. If the range would overflow, returns -ERANGE, otherwise
|
||||
* 0.
|
||||
*/
|
||||
static inline int QEMU_WARN_UNUSED_RESULT range_init(Range *range, uint64_t lob,
|
||||
uint64_t size)
|
||||
{
|
||||
if (lob + size < lob) {
|
||||
return -ERANGE;
|
||||
}
|
||||
range->lob = lob;
|
||||
range->upb = lob + size - 1;
|
||||
range_invariant(range);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize @range to span the interval [@lob,@lob + @size - 1].
|
||||
* @size may be 0. Range must not overflow.
|
||||
*/
|
||||
static inline void range_init_nofail(Range *range, uint64_t lob, uint64_t size)
|
||||
{
|
||||
range->lob = lob;
|
||||
range->upb = lob + size - 1;
|
||||
range_invariant(range);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the size of @range.
|
||||
*/
|
||||
static inline uint64_t range_size(const Range *range)
|
||||
{
|
||||
return range->upb - range->lob + 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if @range1 overlaps with @range2. If one of the ranges is empty,
|
||||
* the result is always "false".
|
||||
*/
|
||||
static inline bool range_overlaps_range(const Range *range1,
|
||||
const Range *range2)
|
||||
{
|
||||
if (range_is_empty(range1) || range_is_empty(range2)) {
|
||||
return false;
|
||||
}
|
||||
return !(range2->upb < range1->lob || range1->upb < range2->lob);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if @range1 contains @range2. If one of the ranges is empty,
|
||||
* the result is always "false".
|
||||
*/
|
||||
static inline bool range_contains_range(const Range *range1,
|
||||
const Range *range2)
|
||||
{
|
||||
if (range_is_empty(range1) || range_is_empty(range2)) {
|
||||
return false;
|
||||
}
|
||||
return range1->lob <= range2->lob && range1->upb >= range2->upb;
|
||||
}
|
||||
|
||||
/*
|
||||
* Extend @range to the smallest interval that includes @extend_by, too.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue