Message ID | 20210206123955.2196514-2-lvivier@redhat.com |
---|---|
State | New |
Headers | show |
Series | failover: trivial cleanup and fix | expand |
On 06/02/2021 13:39, Laurent Vivier wrote: > Commit a1190ab628 has added a "allow_unplug_during_migration = true" at > the end of the main "if" block, so it is not needed to set it anymore > in the previous checking. > > Remove it, to have only sub-ifs that check for needed conditions and exit > if one fails. > > Fixes: 4f5b6a05a4e7 ("pci: add option for net failover") > Fixes: a1190ab628c0 ("migration: allow unplug during migration for failover devices") > Cc: jfreimann@redhat.com > Signed-off-by: Laurent Vivier <lvivier@virtlab415.virt.lab.eng.bos.redhat.com> Sorry, git misconfiguration, read: Signed-off-by: Laurent Vivier <lvivier@redhat.com> > --- > hw/pci/pci.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/hw/pci/pci.c b/hw/pci/pci.c > index 512e9042ffae..ecb7aa31fabd 100644 > --- a/hw/pci/pci.c > +++ b/hw/pci/pci.c > @@ -2120,10 +2120,8 @@ static void pci_qdev_realize(DeviceState *qdev, Error **errp) > pci_qdev_unrealize(DEVICE(pci_dev)); > return; > } > - if (!(pci_dev->cap_present & QEMU_PCI_CAP_MULTIFUNCTION) > - && (PCI_FUNC(pci_dev->devfn) == 0)) { > - qdev->allow_unplug_during_migration = true; > - } else { > + if ((pci_dev->cap_present & QEMU_PCI_CAP_MULTIFUNCTION) > + || (PCI_FUNC(pci_dev->devfn) != 0)) { > error_setg(errp, "failover: primary device must be in its own " > "PCI slot"); > pci_qdev_unrealize(DEVICE(pci_dev)); >
On Sat, Feb 06, 2021 at 01:39:54PM +0100, Laurent Vivier wrote: >Commit a1190ab628 has added a "allow_unplug_during_migration = true" at >the end of the main "if" block, so it is not needed to set it anymore >in the previous checking. > >Remove it, to have only sub-ifs that check for needed conditions and exit >if one fails. > >Fixes: 4f5b6a05a4e7 ("pci: add option for net failover") >Fixes: a1190ab628c0 ("migration: allow unplug during migration for failover devices") >Cc: jfreimann@redhat.com >Signed-off-by: Laurent Vivier <lvivier@virtlab415.virt.lab.eng.bos.redhat.com> >--- > hw/pci/pci.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > Reviewed-by: Jens Freimann <jfreimann@redhat.com> Thank you Laurent! regards, Jens
CC: Michael On 06/02/2021 13:39, Laurent Vivier wrote: > Commit a1190ab628 has added a "allow_unplug_during_migration = true" at > the end of the main "if" block, so it is not needed to set it anymore > in the previous checking. > > Remove it, to have only sub-ifs that check for needed conditions and exit > if one fails. > > Fixes: 4f5b6a05a4e7 ("pci: add option for net failover") > Fixes: a1190ab628c0 ("migration: allow unplug during migration for failover devices") > Cc: jfreimann@redhat.com > Signed-off-by: Laurent Vivier <lvivier@virtlab415.virt.lab.eng.bos.redhat.com> > --- > hw/pci/pci.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/hw/pci/pci.c b/hw/pci/pci.c > index 512e9042ffae..ecb7aa31fabd 100644 > --- a/hw/pci/pci.c > +++ b/hw/pci/pci.c > @@ -2120,10 +2120,8 @@ static void pci_qdev_realize(DeviceState *qdev, Error **errp) > pci_qdev_unrealize(DEVICE(pci_dev)); > return; > } > - if (!(pci_dev->cap_present & QEMU_PCI_CAP_MULTIFUNCTION) > - && (PCI_FUNC(pci_dev->devfn) == 0)) { > - qdev->allow_unplug_during_migration = true; > - } else { > + if ((pci_dev->cap_present & QEMU_PCI_CAP_MULTIFUNCTION) > + || (PCI_FUNC(pci_dev->devfn) != 0)) { > error_setg(errp, "failover: primary device must be in its own " > "PCI slot"); > pci_qdev_unrealize(DEVICE(pci_dev)); >
diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 512e9042ffae..ecb7aa31fabd 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2120,10 +2120,8 @@ static void pci_qdev_realize(DeviceState *qdev, Error **errp) pci_qdev_unrealize(DEVICE(pci_dev)); return; } - if (!(pci_dev->cap_present & QEMU_PCI_CAP_MULTIFUNCTION) - && (PCI_FUNC(pci_dev->devfn) == 0)) { - qdev->allow_unplug_during_migration = true; - } else { + if ((pci_dev->cap_present & QEMU_PCI_CAP_MULTIFUNCTION) + || (PCI_FUNC(pci_dev->devfn) != 0)) { error_setg(errp, "failover: primary device must be in its own " "PCI slot"); pci_qdev_unrealize(DEVICE(pci_dev));
Commit a1190ab628 has added a "allow_unplug_during_migration = true" at the end of the main "if" block, so it is not needed to set it anymore in the previous checking. Remove it, to have only sub-ifs that check for needed conditions and exit if one fails. Fixes: 4f5b6a05a4e7 ("pci: add option for net failover") Fixes: a1190ab628c0 ("migration: allow unplug during migration for failover devices") Cc: jfreimann@redhat.com Signed-off-by: Laurent Vivier <lvivier@virtlab415.virt.lab.eng.bos.redhat.com> --- hw/pci/pci.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)