[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4] failover: unregister ROM on unplug

From: Laurent Vivier
Subject: Re: [PATCH v4] failover: unregister ROM on unplug
Date: Wed, 21 Jul 2021 19:01:01 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

On 21/07/2021 18:19, Michael S. Tsirkin wrote:
> On Wed, Jul 21, 2021 at 06:09:05PM +0200, Laurent Vivier wrote:
>> The intend of failover is to allow to migrate a VM with a VFIO
>> networking card without disrupting the network operation by switching
>> to a virtio-net device during the migration.
>> This simple change allows to test failover with a simulated device
>> like e1000e rather than a vfio device, even if it's useless in real
>> life it can help to debug failover.
>> This is interesting to developers that want to test failover on
>> a system with no vfio device. Moreover it simplifies host networking
>> configuration as we can use the same bridge for virtio-net and
>> the other failover networking device.
>> Without this change the migration of a system configured with failover
>> fails with:
>>   ...
>>   -device virtio-net-pci,id=virtionet0,failover=on,...  \
>>   -device e1000,failover_pair_id=virtionet0,... \
>>   ...
>>   (qemu) migrate ...
>>   Unknown ramblock "0000:00:01.1:00.0/e1000e.rom", cannot accept migration
>>   error while loading state for instance 0x0 of device 'ram'
>>   load of migration failed: Invalid argument
>> This happens because QEMU correctly unregisters the interface vmstate but
>> not the ROM one. This patch fixes that.
>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> And does failover_replug_primary roll it all back then?

It seems not.

To check I have started a migration, then I have canceled it, and I have 
started a
migration to a file (migrate "exec:cat > mig") and I have analyzed the result 
with the
script scripts/analyze-migration.py


* with VFIO it's not a problem as we never migrate VFIO device itself,

* with an emulated PCI device, it's only a problem if we disable failover after 
canceled a first try (because if we keep failover we acts like for VFIO and we 
unplug the
card and don't migrate vmstates). This means we need a scenario like that to 
hit the bug:

    - enable failover with an emulated PCI device
    - migrate to another machine
    - cancel/abort the migration before the end of the migration
    - unplug the virtio-net device to disable the failover behavior,
    - migrate the machine again with only the emulated PCI device

  but as I said previously failover with emulated PCI device is only for 
developers and
test purpose and not to use in production...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]