Commit 39032981 authored by Peter Maydell's avatar Peter Maydell
Browse files

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: default avatarPeter Maydell <peter.maydell@linaro.org>
parents fb224688 cb09104e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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: ");
+14 −13
Original line number Diff line number Diff line
@@ -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);