[PATCH v2 00/16] Crazy shit around -global (pardon my french)

Markus Armbruster posted 16 patches 3 years, 10 months ago
Test FreeBSD passed
Test asan passed
Test docker-quick@centos7 passed
Test checkpatch failed
Test docker-mingw@fedora passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200622094227.1271650-1-armbru@redhat.com
Maintainers: John Snow <jsnow@redhat.com>, Max Reitz <mreitz@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Markus Armbruster <armbru@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Artyom Tarasenko <atar4qemu@gmail.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, "Michael S. Tsirkin" <mst@redhat.com>, Michael Walle <michael@walle.cc>
docs/qdev-device-use.txt            |  17 +-
docs/system/deprecated.rst          |  34 ++
include/hw/block/fdc.h              |   2 +-
include/hw/qdev-properties.h        |  18 +-
include/sysemu/blockdev.h           |   2 +
blockdev.c                          |  27 +-
hw/arm/aspeed.c                     |  16 +-
hw/arm/cubieboard.c                 |   2 +-
hw/arm/exynos4210.c                 |   2 +-
hw/arm/imx25_pdk.c                  |   2 +-
hw/arm/mcimx6ul-evk.c               |   2 +-
hw/arm/mcimx7d-sabre.c              |   2 +-
hw/arm/msf2-som.c                   |   4 +-
hw/arm/nseries.c                    |   4 +-
hw/arm/orangepi.c                   |   2 +-
hw/arm/raspi.c                      |   2 +-
hw/arm/sabrelite.c                  |   6 +-
hw/arm/vexpress.c                   |   3 +-
hw/arm/xilinx_zynq.c                |   7 +-
hw/arm/xlnx-versal-virt.c           |   2 +-
hw/arm/xlnx-zcu102.c                |  10 +-
hw/block/fdc.c                      |  82 ++--
hw/block/nand.c                     |   2 +-
hw/block/pflash_cfi01.c             |   6 +-
hw/block/pflash_cfi02.c             |   2 +-
hw/core/qdev-properties-system.c    | 151 ++++---
hw/core/qdev-properties.c           |  17 +
hw/i386/pc.c                        |   8 +-
hw/ide/qdev.c                       |   4 +-
hw/isa/isa-superio.c                |  18 +-
hw/m68k/q800.c                      |   3 +-
hw/microblaze/petalogix_ml605_mmu.c |   5 +-
hw/ppc/pnv.c                        |   3 +-
hw/ppc/spapr.c                      |   4 +-
hw/scsi/scsi-bus.c                  |   2 +-
hw/sd/milkymist-memcard.c           |   2 +-
hw/sd/pxa2xx_mmci.c                 |  15 +-
hw/sd/sd.c                          |   2 +-
hw/sd/ssi-sd.c                      |   3 +-
hw/sparc64/sun4u.c                  |   9 +-
hw/xtensa/xtfpga.c                  |   3 +-
softmmu/vl.c                        |   8 +
tests/qemu-iotests/172              |  27 +-
tests/qemu-iotests/172.out          | 656 +++++++++++++++++++++++++---
44 files changed, 928 insertions(+), 270 deletions(-)
[PATCH v2 00/16] Crazy shit around -global (pardon my french)
Posted by Markus Armbruster 3 years, 10 months ago
There are three ways to configure backends:

* -nic, -serial, -drive, ... (onboard devices)

* Set the property with -device, or, if you feel masochistic, with
  -set device (pluggable devices)

* Set the property with -global (both)

The trouble is -global is terrible.

It gets applied in object_new(), which can't fail.  We treat failure
to apply -global as fatal error, except when hot-plugging, where we
treat it as warning *boggle*.  I'm not addressing that today.

Some code falls apart when you use both -global and the other way.

To make life more interesting, we gave -drive two roles: with
interface type other than none, it's for configuring onboard devices,
and with interface type none, it's for defining backends for use with
-device and such.  Since we neglect to require interface type none for
the latter, you can use one -drive in both roles.  This confuses the
code about as much as you, dear reader, probably are by now.

Because this still isn't interesting enough, there's yet another way
to configure backends, just for floppies: set the floppy controller's
property.  Goes back to the time when floppy wasn't a separate device,
and involves some Bad Magic.  Now -global can interact with itself!

Digging through all this took me an embarrassing amount of time.
Hair, too.

My patches reject some the silliest uses outright, and deprecate some
not so silly ones that have replacements.

Apply on top of my "[PATCH v2 00/58] qdev: Rework how we plug into the
parent bus".

Enjoy!

v2:
* Rebased; tests/qemu-iotests/172.out regenerated to resolve conflicts
* PATCH 10-12: check_non_null() renamed to check_prop_still_unset()
  [Philippe]

Markus Armbruster (16):
  iotests/172: Include "info block" in test output
  iotests/172: Cover empty filename and multiple use of drives
  iotests/172: Cover -global floppy.drive=...
  fdc: Reject clash between -drive if=floppy and -global isa-fdc
  fdc: Open-code fdctrl_init_isa()
  fdc: Deprecate configuring floppies with -global isa-fdc
  docs/qdev-device-use.txt: Update section "Default Devices"
  blockdev: Deprecate -drive with bogus interface type
  qdev: Eliminate get_pointer(), set_pointer()
  qdev: Improve netdev property override error a bit
  qdev: Reject drive property override
  qdev: Reject chardev property override
  qdev: Make qdev_prop_set_drive() match the other helpers
  arm/aspeed: Drop aspeed_board_init_flashes() parameter @errp
  sd/pxa2xx_mmci: Don't crash on pxa2xx_mmci_init() error
  sd/milkymist-memcard: Fix error API violation

 docs/qdev-device-use.txt            |  17 +-
 docs/system/deprecated.rst          |  34 ++
 include/hw/block/fdc.h              |   2 +-
 include/hw/qdev-properties.h        |  18 +-
 include/sysemu/blockdev.h           |   2 +
 blockdev.c                          |  27 +-
 hw/arm/aspeed.c                     |  16 +-
 hw/arm/cubieboard.c                 |   2 +-
 hw/arm/exynos4210.c                 |   2 +-
 hw/arm/imx25_pdk.c                  |   2 +-
 hw/arm/mcimx6ul-evk.c               |   2 +-
 hw/arm/mcimx7d-sabre.c              |   2 +-
 hw/arm/msf2-som.c                   |   4 +-
 hw/arm/nseries.c                    |   4 +-
 hw/arm/orangepi.c                   |   2 +-
 hw/arm/raspi.c                      |   2 +-
 hw/arm/sabrelite.c                  |   6 +-
 hw/arm/vexpress.c                   |   3 +-
 hw/arm/xilinx_zynq.c                |   7 +-
 hw/arm/xlnx-versal-virt.c           |   2 +-
 hw/arm/xlnx-zcu102.c                |  10 +-
 hw/block/fdc.c                      |  82 ++--
 hw/block/nand.c                     |   2 +-
 hw/block/pflash_cfi01.c             |   6 +-
 hw/block/pflash_cfi02.c             |   2 +-
 hw/core/qdev-properties-system.c    | 151 ++++---
 hw/core/qdev-properties.c           |  17 +
 hw/i386/pc.c                        |   8 +-
 hw/ide/qdev.c                       |   4 +-
 hw/isa/isa-superio.c                |  18 +-
 hw/m68k/q800.c                      |   3 +-
 hw/microblaze/petalogix_ml605_mmu.c |   5 +-
 hw/ppc/pnv.c                        |   3 +-
 hw/ppc/spapr.c                      |   4 +-
 hw/scsi/scsi-bus.c                  |   2 +-
 hw/sd/milkymist-memcard.c           |   2 +-
 hw/sd/pxa2xx_mmci.c                 |  15 +-
 hw/sd/sd.c                          |   2 +-
 hw/sd/ssi-sd.c                      |   3 +-
 hw/sparc64/sun4u.c                  |   9 +-
 hw/xtensa/xtfpga.c                  |   3 +-
 softmmu/vl.c                        |   8 +
 tests/qemu-iotests/172              |  27 +-
 tests/qemu-iotests/172.out          | 656 +++++++++++++++++++++++++---
 44 files changed, 928 insertions(+), 270 deletions(-)

-- 
2.26.2


Re: [PATCH v2 00/16] Crazy shit around -global (pardon my french)
Posted by no-reply@patchew.org 3 years, 10 months ago
Patchew URL: https://patchew.org/QEMU/20200622094227.1271650-1-armbru@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Subject: [PATCH v2 00/16] Crazy shit around -global (pardon my french)
Type: series
Message-id: 20200622094227.1271650-1-armbru@redhat.com

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

From https://github.com/patchew-project/qemu
 * [new tag]         patchew/20200622094227.1271650-1-armbru@redhat.com -> patchew/20200622094227.1271650-1-armbru@redhat.com
Switched to a new branch 'test'
f0116ee sd/milkymist-memcard: Fix error API violation
3ce05b4 sd/pxa2xx_mmci: Don't crash on pxa2xx_mmci_init() error
7bb382e arm/aspeed: Drop aspeed_board_init_flashes() parameter @errp
7fc39f8 qdev: Make qdev_prop_set_drive() match the other helpers
a1bad90 qdev: Reject chardev property override
b73765e qdev: Reject drive property override
34072ae qdev: Improve netdev property override error a bit
fa6bc3e qdev: Eliminate get_pointer(), set_pointer()
2e22ad2 blockdev: Deprecate -drive with bogus interface type
2fdd4f4 docs/qdev-device-use.txt: Update section "Default Devices"
3bb6131 fdc: Deprecate configuring floppies with -global isa-fdc
1442ef5 fdc: Open-code fdctrl_init_isa()
6ab9dc2 fdc: Reject clash between -drive if=floppy and -global isa-fdc
00e64a2 iotests/172: Cover -global floppy.drive=...
40c2844 iotests/172: Cover empty filename and multiple use of drives
ba868ba iotests/172: Include "info block" in test output

=== OUTPUT BEGIN ===
1/16 Checking commit ba868baf44f7 (iotests/172: Include "info block" in test output)
2/16 Checking commit 40c28442f546 (iotests/172: Cover empty filename and multiple use of drives)
ERROR: trailing whitespace
#48: FILE: tests/qemu-iotests/172.out:190:
+Testing: -fdb $

total: 1 errors, 0 warnings, 86 lines checked

Patch 2/16 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

3/16 Checking commit 00e64a2b1a99 (iotests/172: Cover -global floppy.drive=...)
4/16 Checking commit 6ab9dc296d08 (fdc: Reject clash between -drive if=floppy and -global isa-fdc)
5/16 Checking commit 1442ef5c1dad (fdc: Open-code fdctrl_init_isa())
6/16 Checking commit 3bb61318d607 (fdc: Deprecate configuring floppies with -global isa-fdc)
7/16 Checking commit 2fdd4f45b355 (docs/qdev-device-use.txt: Update section "Default Devices")
8/16 Checking commit 2e22ad2cf40d (blockdev: Deprecate -drive with bogus interface type)
9/16 Checking commit fa6bc3ea041f (qdev: Eliminate get_pointer(), set_pointer())
10/16 Checking commit 34072ae828ca (qdev: Improve netdev property override error a bit)
11/16 Checking commit b73765e2d86c (qdev: Reject drive property override)
12/16 Checking commit a1bad90fffeb (qdev: Reject chardev property override)
13/16 Checking commit 7fc39f8555b1 (qdev: Make qdev_prop_set_drive() match the other helpers)
14/16 Checking commit 7bb382e31bf4 (arm/aspeed: Drop aspeed_board_init_flashes() parameter @errp)
15/16 Checking commit 3ce05b4e108e (sd/pxa2xx_mmci: Don't crash on pxa2xx_mmci_init() error)
16/16 Checking commit f0116ee141ee (sd/milkymist-memcard: Fix error API violation)
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20200622094227.1271650-1-armbru@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Re: [PATCH v2 00/16] Crazy shit around -global (pardon my french)
Posted by John Snow 3 years, 10 months ago

On 6/22/20 5:42 AM, Markus Armbruster wrote:
> There are three ways to configure backends:
> 
> * -nic, -serial, -drive, ... (onboard devices)
> 
> * Set the property with -device, or, if you feel masochistic, with
>   -set device (pluggable devices)
> 
> * Set the property with -global (both)
> 
> The trouble is -global is terrible.
> 
> It gets applied in object_new(), which can't fail.  We treat failure
> to apply -global as fatal error, except when hot-plugging, where we
> treat it as warning *boggle*.  I'm not addressing that today.
> 
> Some code falls apart when you use both -global and the other way.
> 
> To make life more interesting, we gave -drive two roles: with
> interface type other than none, it's for configuring onboard devices,
> and with interface type none, it's for defining backends for use with
> -device and such.  Since we neglect to require interface type none for
> the latter, you can use one -drive in both roles.  This confuses the
> code about as much as you, dear reader, probably are by now.
> 
> Because this still isn't interesting enough, there's yet another way
> to configure backends, just for floppies: set the floppy controller's
> property.  Goes back to the time when floppy wasn't a separate device,
> and involves some Bad Magic.  Now -global can interact with itself!
> 
> Digging through all this took me an embarrassing amount of time.
> Hair, too.
> 
> My patches reject some the silliest uses outright, and deprecate some
> not so silly ones that have replacements.
> 
> Apply on top of my "[PATCH v2 00/58] qdev: Rework how we plug into the
> parent bus".
> 

Oof. Thank you for your work in fixing our darkest corners. I sincerely
appreciate it.

The qdev tree ordering problems don't cause any issues for migration, do
they?

(I see you already sent a PR, so whatever!)

> Enjoy!
> 
> v2:
> * Rebased; tests/qemu-iotests/172.out regenerated to resolve conflicts
> * PATCH 10-12: check_non_null() renamed to check_prop_still_unset()
>   [Philippe]
> 
> Markus Armbruster (16):
>   iotests/172: Include "info block" in test output
>   iotests/172: Cover empty filename and multiple use of drives
>   iotests/172: Cover -global floppy.drive=...
>   fdc: Reject clash between -drive if=floppy and -global isa-fdc
>   fdc: Open-code fdctrl_init_isa()
>   fdc: Deprecate configuring floppies with -global isa-fdc
>   docs/qdev-device-use.txt: Update section "Default Devices"
>   blockdev: Deprecate -drive with bogus interface type
>   qdev: Eliminate get_pointer(), set_pointer()
>   qdev: Improve netdev property override error a bit
>   qdev: Reject drive property override
>   qdev: Reject chardev property override
>   qdev: Make qdev_prop_set_drive() match the other helpers
>   arm/aspeed: Drop aspeed_board_init_flashes() parameter @errp
>   sd/pxa2xx_mmci: Don't crash on pxa2xx_mmci_init() error
>   sd/milkymist-memcard: Fix error API violation
> 
>  docs/qdev-device-use.txt            |  17 +-
>  docs/system/deprecated.rst          |  34 ++
>  include/hw/block/fdc.h              |   2 +-
>  include/hw/qdev-properties.h        |  18 +-
>  include/sysemu/blockdev.h           |   2 +
>  blockdev.c                          |  27 +-
>  hw/arm/aspeed.c                     |  16 +-
>  hw/arm/cubieboard.c                 |   2 +-
>  hw/arm/exynos4210.c                 |   2 +-
>  hw/arm/imx25_pdk.c                  |   2 +-
>  hw/arm/mcimx6ul-evk.c               |   2 +-
>  hw/arm/mcimx7d-sabre.c              |   2 +-
>  hw/arm/msf2-som.c                   |   4 +-
>  hw/arm/nseries.c                    |   4 +-
>  hw/arm/orangepi.c                   |   2 +-
>  hw/arm/raspi.c                      |   2 +-
>  hw/arm/sabrelite.c                  |   6 +-
>  hw/arm/vexpress.c                   |   3 +-
>  hw/arm/xilinx_zynq.c                |   7 +-
>  hw/arm/xlnx-versal-virt.c           |   2 +-
>  hw/arm/xlnx-zcu102.c                |  10 +-
>  hw/block/fdc.c                      |  82 ++--
>  hw/block/nand.c                     |   2 +-
>  hw/block/pflash_cfi01.c             |   6 +-
>  hw/block/pflash_cfi02.c             |   2 +-
>  hw/core/qdev-properties-system.c    | 151 ++++---
>  hw/core/qdev-properties.c           |  17 +
>  hw/i386/pc.c                        |   8 +-
>  hw/ide/qdev.c                       |   4 +-
>  hw/isa/isa-superio.c                |  18 +-
>  hw/m68k/q800.c                      |   3 +-
>  hw/microblaze/petalogix_ml605_mmu.c |   5 +-
>  hw/ppc/pnv.c                        |   3 +-
>  hw/ppc/spapr.c                      |   4 +-
>  hw/scsi/scsi-bus.c                  |   2 +-
>  hw/sd/milkymist-memcard.c           |   2 +-
>  hw/sd/pxa2xx_mmci.c                 |  15 +-
>  hw/sd/sd.c                          |   2 +-
>  hw/sd/ssi-sd.c                      |   3 +-
>  hw/sparc64/sun4u.c                  |   9 +-
>  hw/xtensa/xtfpga.c                  |   3 +-
>  softmmu/vl.c                        |   8 +
>  tests/qemu-iotests/172              |  27 +-
>  tests/qemu-iotests/172.out          | 656 +++++++++++++++++++++++++---
>  44 files changed, 928 insertions(+), 270 deletions(-)
> 


Re: [PATCH v2 00/16] Crazy shit around -global (pardon my french)
Posted by Markus Armbruster 3 years, 10 months ago
John Snow <jsnow@redhat.com> writes:

> On 6/22/20 5:42 AM, Markus Armbruster wrote:
>> There are three ways to configure backends:
>> 
>> * -nic, -serial, -drive, ... (onboard devices)
>> 
>> * Set the property with -device, or, if you feel masochistic, with
>>   -set device (pluggable devices)
>> 
>> * Set the property with -global (both)
>> 
>> The trouble is -global is terrible.
>> 
>> It gets applied in object_new(), which can't fail.  We treat failure
>> to apply -global as fatal error, except when hot-plugging, where we
>> treat it as warning *boggle*.  I'm not addressing that today.
>> 
>> Some code falls apart when you use both -global and the other way.
>> 
>> To make life more interesting, we gave -drive two roles: with
>> interface type other than none, it's for configuring onboard devices,
>> and with interface type none, it's for defining backends for use with
>> -device and such.  Since we neglect to require interface type none for
>> the latter, you can use one -drive in both roles.  This confuses the
>> code about as much as you, dear reader, probably are by now.
>> 
>> Because this still isn't interesting enough, there's yet another way
>> to configure backends, just for floppies: set the floppy controller's
>> property.  Goes back to the time when floppy wasn't a separate device,
>> and involves some Bad Magic.  Now -global can interact with itself!
>> 
>> Digging through all this took me an embarrassing amount of time.
>> Hair, too.
>> 
>> My patches reject some the silliest uses outright, and deprecate some
>> not so silly ones that have replacements.
>> 
>> Apply on top of my "[PATCH v2 00/58] qdev: Rework how we plug into the
>> parent bus".
>> 
>
> Oof. Thank you for your work in fixing our darkest corners. I sincerely
> appreciate it.
>
> The qdev tree ordering problems don't cause any issues for migration, do
> they?

This series should only change device configuration, not device state or
its encoding in the migration stream.

I'm not sure what you mean by "qdev tree ordering problems".  Ist it
commit e8c9e65816 'qom: Make "info qom-tree" show children sorted'?

> (I see you already sent a PR, so whatever!)

A question that might avoid a later migration debugging session is
*never* "whatever"!


Re: [PATCH v2 00/16] Crazy shit around -global (pardon my french)
Posted by John Snow 3 years, 10 months ago

On 6/25/20 12:45 AM, Markus Armbruster wrote:
> John Snow <jsnow@redhat.com> writes:
> 
>> On 6/22/20 5:42 AM, Markus Armbruster wrote:
>>> There are three ways to configure backends:
>>>
>>> * -nic, -serial, -drive, ... (onboard devices)
>>>
>>> * Set the property with -device, or, if you feel masochistic, with
>>>   -set device (pluggable devices)
>>>
>>> * Set the property with -global (both)
>>>
>>> The trouble is -global is terrible.
>>>
>>> It gets applied in object_new(), which can't fail.  We treat failure
>>> to apply -global as fatal error, except when hot-plugging, where we
>>> treat it as warning *boggle*.  I'm not addressing that today.
>>>
>>> Some code falls apart when you use both -global and the other way.
>>>
>>> To make life more interesting, we gave -drive two roles: with
>>> interface type other than none, it's for configuring onboard devices,
>>> and with interface type none, it's for defining backends for use with
>>> -device and such.  Since we neglect to require interface type none for
>>> the latter, you can use one -drive in both roles.  This confuses the
>>> code about as much as you, dear reader, probably are by now.
>>>
>>> Because this still isn't interesting enough, there's yet another way
>>> to configure backends, just for floppies: set the floppy controller's
>>> property.  Goes back to the time when floppy wasn't a separate device,
>>> and involves some Bad Magic.  Now -global can interact with itself!
>>>
>>> Digging through all this took me an embarrassing amount of time.
>>> Hair, too.
>>>
>>> My patches reject some the silliest uses outright, and deprecate some
>>> not so silly ones that have replacements.
>>>
>>> Apply on top of my "[PATCH v2 00/58] qdev: Rework how we plug into the
>>> parent bus".
>>>
>>
>> Oof. Thank you for your work in fixing our darkest corners. I sincerely
>> appreciate it.
>>
>> The qdev tree ordering problems don't cause any issues for migration, do
>> they?
> 
> This series should only change device configuration, not device state or
> its encoding in the migration stream.
> 
> I'm not sure what you mean by "qdev tree ordering problems".  Ist it
> commit e8c9e65816 'qom: Make "info qom-tree" show children sorted'?
> 
>> (I see you already sent a PR, so whatever!)
> 
> A question that might avoid a later migration debugging session is
> *never* "whatever"!
> 

I thought I had read that one of these patches changes the order in
which devices get instantiated, which I thought might change their QOM
paths. Which I thought *might* have some ramifications for migration,
but wasn't sure.

If it's just showing the same path outputs *sorted*, then there's no
problem.

Likely misread.

--js


Re: [PATCH v2 00/16] Crazy shit around -global (pardon my french)
Posted by Markus Armbruster 3 years, 10 months ago
Cc: David for insurance against me spewing nonsense about migration.

John Snow <jsnow@redhat.com> writes:

> On 6/25/20 12:45 AM, Markus Armbruster wrote:
>> John Snow <jsnow@redhat.com> writes:
>> 
>>> On 6/22/20 5:42 AM, Markus Armbruster wrote:
>>>> There are three ways to configure backends:
>>>>
>>>> * -nic, -serial, -drive, ... (onboard devices)
>>>>
>>>> * Set the property with -device, or, if you feel masochistic, with
>>>>   -set device (pluggable devices)
>>>>
>>>> * Set the property with -global (both)
>>>>
>>>> The trouble is -global is terrible.
>>>>
>>>> It gets applied in object_new(), which can't fail.  We treat failure
>>>> to apply -global as fatal error, except when hot-plugging, where we
>>>> treat it as warning *boggle*.  I'm not addressing that today.
>>>>
>>>> Some code falls apart when you use both -global and the other way.
>>>>
>>>> To make life more interesting, we gave -drive two roles: with
>>>> interface type other than none, it's for configuring onboard devices,
>>>> and with interface type none, it's for defining backends for use with
>>>> -device and such.  Since we neglect to require interface type none for
>>>> the latter, you can use one -drive in both roles.  This confuses the
>>>> code about as much as you, dear reader, probably are by now.
>>>>
>>>> Because this still isn't interesting enough, there's yet another way
>>>> to configure backends, just for floppies: set the floppy controller's
>>>> property.  Goes back to the time when floppy wasn't a separate device,
>>>> and involves some Bad Magic.  Now -global can interact with itself!
>>>>
>>>> Digging through all this took me an embarrassing amount of time.
>>>> Hair, too.
>>>>
>>>> My patches reject some the silliest uses outright, and deprecate some
>>>> not so silly ones that have replacements.
>>>>
>>>> Apply on top of my "[PATCH v2 00/58] qdev: Rework how we plug into the
>>>> parent bus".
>>>>
>>>
>>> Oof. Thank you for your work in fixing our darkest corners. I sincerely
>>> appreciate it.
>>>
>>> The qdev tree ordering problems don't cause any issues for migration, do
>>> they?
>> 
>> This series should only change device configuration, not device state or
>> its encoding in the migration stream.
>> 
>> I'm not sure what you mean by "qdev tree ordering problems".  Ist it
>> commit e8c9e65816 'qom: Make "info qom-tree" show children sorted'?
>> 
>>> (I see you already sent a PR, so whatever!)
>> 
>> A question that might avoid a later migration debugging session is
>> *never* "whatever"!
>> 
>
> I thought I had read that one of these patches changes the order in
> which devices get instantiated, which I thought might change their QOM
> paths. Which I thought *might* have some ramifications for migration,
> but wasn't sure.

Device instantiation order changes should not break migration.

The order in which devices appear in the migration stream should not
matter.

> If it's just showing the same path outputs *sorted*, then there's no
> problem.
>
> Likely misread.
>
> --js


Re: [PATCH v2 00/16] Crazy shit around -global (pardon my french)
Posted by Dr. David Alan Gilbert 3 years, 10 months ago
* Markus Armbruster (armbru@redhat.com) wrote:
> Cc: David for insurance against me spewing nonsense about migration.
> 
> John Snow <jsnow@redhat.com> writes:
> 
> > On 6/25/20 12:45 AM, Markus Armbruster wrote:
> >> John Snow <jsnow@redhat.com> writes:
> >> 
> >>> On 6/22/20 5:42 AM, Markus Armbruster wrote:
> >>>> There are three ways to configure backends:
> >>>>
> >>>> * -nic, -serial, -drive, ... (onboard devices)
> >>>>
> >>>> * Set the property with -device, or, if you feel masochistic, with
> >>>>   -set device (pluggable devices)
> >>>>
> >>>> * Set the property with -global (both)
> >>>>
> >>>> The trouble is -global is terrible.
> >>>>
> >>>> It gets applied in object_new(), which can't fail.  We treat failure
> >>>> to apply -global as fatal error, except when hot-plugging, where we
> >>>> treat it as warning *boggle*.  I'm not addressing that today.
> >>>>
> >>>> Some code falls apart when you use both -global and the other way.
> >>>>
> >>>> To make life more interesting, we gave -drive two roles: with
> >>>> interface type other than none, it's for configuring onboard devices,
> >>>> and with interface type none, it's for defining backends for use with
> >>>> -device and such.  Since we neglect to require interface type none for
> >>>> the latter, you can use one -drive in both roles.  This confuses the
> >>>> code about as much as you, dear reader, probably are by now.
> >>>>
> >>>> Because this still isn't interesting enough, there's yet another way
> >>>> to configure backends, just for floppies: set the floppy controller's
> >>>> property.  Goes back to the time when floppy wasn't a separate device,
> >>>> and involves some Bad Magic.  Now -global can interact with itself!
> >>>>
> >>>> Digging through all this took me an embarrassing amount of time.
> >>>> Hair, too.
> >>>>
> >>>> My patches reject some the silliest uses outright, and deprecate some
> >>>> not so silly ones that have replacements.
> >>>>
> >>>> Apply on top of my "[PATCH v2 00/58] qdev: Rework how we plug into the
> >>>> parent bus".
> >>>>
> >>>
> >>> Oof. Thank you for your work in fixing our darkest corners. I sincerely
> >>> appreciate it.
> >>>
> >>> The qdev tree ordering problems don't cause any issues for migration, do
> >>> they?
> >> 
> >> This series should only change device configuration, not device state or
> >> its encoding in the migration stream.
> >> 
> >> I'm not sure what you mean by "qdev tree ordering problems".  Ist it
> >> commit e8c9e65816 'qom: Make "info qom-tree" show children sorted'?
> >> 
> >>> (I see you already sent a PR, so whatever!)
> >> 
> >> A question that might avoid a later migration debugging session is
> >> *never* "whatever"!
> >> 
> >
> > I thought I had read that one of these patches changes the order in
> > which devices get instantiated, which I thought might change their QOM
> > paths. Which I thought *might* have some ramifications for migration,
> > but wasn't sure.
> 
> Device instantiation order changes should not break migration.

They shouldn't; although I only narrowly stopped a new device from
making a mistake that would have made it dependent.
Of course you do have to explicitly state PCI/USB slot IDs otherwise the
allocation of those is order dependent.

> The order in which devices appear in the migration stream should not
> matter.

Order in the stream is a separate issue; we have ways to enforce that;
for example you want the interrupt controller to arrive before a device
that will raise an interrupt.

Dave


Dave

> > If it's just showing the same path outputs *sorted*, then there's no
> > problem.
> >
> > Likely misread.
> >
> > --js
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK