Error reporting patches for 2019-12-02

-----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEENUvIs9frKmtoZ05fOHC0AOuRhlMFAl3lKxkSHGFybWJydUBy
 ZWRoYXQuY29tAAoJEDhwtADrkYZTtmYP/i3G3U3L74gsuk0YDLedqHktcc+QGook
 oUkhEKhaU2VgIPgL58ghALzEXQobridh6FQsysx5ETGEN+snwkgJeqM4pAG1ROB6
 OpF4lvR613HEGK+YjxwYpera8Hu4K/6aYSddrpf+mvnUcI7LR7OrvbnqE8slj294
 fp7LdonIDdzl48zzb2DcRYdySNobMmWgFvX5jGbayZ7274iU7wHbk5D2TCf7MvxP
 iuRpsQYQS9lwtCxiaWveMU5mW7Fjcv54CoCxLpY0Z0kyFR1g6p7hVJtfuaxaRJMp
 8QOkLdLDxOYLmL/eGOjFbaaSEk4aXjCnrHy8LgcViqzOl6pXyXbxSv0GTLcPH1mH
 nVutohuZzjxCa+nNf6CW6DbTOZOBwGl6efVLtUqkkd855ls9poxyxMLTyO/EveSK
 E46ZLSM3XiX8HGmboBeeW18QS5wUJlT8SB0PO9k6oQr9LdCJt45MjGCZCjjOglmk
 1RO+Mx+XlzjFJsbdMoNfSrYVvuPn+c1mACSoITkr0eTr2XyqaxXknHMRKXacJSt7
 1ppA4sFaQH6ORvCKm8NutTRAd0qAlOdougmrgSL7p0ZcaxfygAG4GAgh6UjEDWOe
 /+LmmT2p41BOxmd3F5Pj6YZaOWucw7rZMm1YuxN9ZllMKoj9lP5leGjssGYom+K6
 UW96fQzGmpaV
 =qwBN
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2019-12-02' into staging

Error reporting patches for 2019-12-02

# gpg: Signature made Mon 02 Dec 2019 15:17:45 GMT
# gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
# gpg:                issuer "armbru@redhat.com"
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-error-2019-12-02:
  block/file-posix: Fix laio_init() error handling crash bug
  net/virtio: Fix failover error handling crash bugs
  net/virtio: Drop useless n->primary_dev not null checks

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2019-12-02 16:29:41 +00:00
commit 39032981fa
2 changed files with 15 additions and 14 deletions

View File

@ -1973,7 +1973,7 @@ static void raw_aio_attach_aio_context(BlockDriverState *bs,
#ifdef CONFIG_LINUX_AIO
BDRVRawState *s = bs->opaque;
if (s->use_linux_aio) {
Error *local_err;
Error *local_err = NULL;
if (!aio_setup_linux_aio(new_context, &local_err)) {
error_reportf_err(local_err, "Unable to use native AIO, "
"falling back to thread pool: ");

View File

@ -2795,6 +2795,7 @@ static bool failover_unplug_primary(VirtIONet *n)
static bool failover_replug_primary(VirtIONet *n, Error **errp)
{
Error *err = NULL;
HotplugHandler *hotplug_ctrl;
PCIDevice *pdev = PCI_DEVICE(n->primary_dev);
@ -2806,32 +2807,33 @@ static bool failover_replug_primary(VirtIONet *n, Error **errp)
qemu_find_opts("device"),
n->primary_device_dict, errp);
if (!n->primary_device_opts) {
error_setg(errp, "virtio_net: couldn't find primary device opts");
goto out;
return false;
}
}
if (!n->primary_dev) {
error_setg(errp, "virtio_net: couldn't find primary device");
goto out;
}
n->primary_bus = n->primary_dev->parent_bus;
if (!n->primary_bus) {
error_setg(errp, "virtio_net: couldn't find primary bus");
goto out;
return false;
}
qdev_set_parent_bus(n->primary_dev, n->primary_bus);
n->primary_should_be_hidden = false;
qemu_opt_set_bool(n->primary_device_opts,
"partially_hotplugged", true, errp);
"partially_hotplugged", true, &err);
if (err) {
goto out;
}
hotplug_ctrl = qdev_get_hotplug_handler(n->primary_dev);
if (hotplug_ctrl) {
hotplug_handler_pre_plug(hotplug_ctrl, n->primary_dev, errp);
hotplug_handler_pre_plug(hotplug_ctrl, n->primary_dev, &err);
if (err) {
goto out;
}
hotplug_handler_plug(hotplug_ctrl, n->primary_dev, errp);
}
out:
return *errp == NULL;
error_propagate(errp, err);
return !err;
}
static void virtio_net_handle_migration_primary(VirtIONet *n,
@ -2849,8 +2851,7 @@ static void virtio_net_handle_migration_primary(VirtIONet *n,
}
}
if (migration_in_setup(s) && !should_be_hidden &&
n->primary_dev) {
if (migration_in_setup(s) && !should_be_hidden) {
if (failover_unplug_primary(n)) {
vmstate_unregister(n->primary_dev, qdev_get_vmsd(n->primary_dev),
n->primary_dev);