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

Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2020-07-07-v2' into staging



Error reporting patches patches for 2020-07-07

# gpg: Signature made Fri 10 Jul 2020 14:24:42 BST
# 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-2020-07-07-v2: (53 commits)
  xen: Use ERRP_GUARD()
  nbd: Use ERRP_GUARD()
  virtio-9p: Use ERRP_GUARD()
  fw_cfg: Use ERRP_GUARD()
  pflash: Use ERRP_GUARD()
  sd: Use ERRP_GUARD()
  scripts: Coccinelle script to use ERRP_GUARD()
  error: New macro ERRP_GUARD()
  hmp: Ignore Error objects where the return value suffices
  qdev: Ignore Error objects where the return value suffices
  qemu-img: Ignore Error objects where the return value suffices
  error: Avoid error_propagate() after migrate_add_blocker()
  qapi: Purge error_propagate() from QAPI core
  qapi: Smooth visitor error checking in generated code
  qapi: Smooth another visitor error checking pattern
  block/parallels: Simplify parallels_open() after previous commit
  error: Reduce unnecessary error propagation
  error: Eliminate error_propagate() manually
  error: Eliminate error_propagate() with Coccinelle, part 2
  error: Eliminate error_propagate() with Coccinelle, part 1
  ...

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parents b6d7e9b6 1de7096d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2176,6 +2176,7 @@ F: scripts/coccinelle/error-use-after-free.cocci
F: scripts/coccinelle/error_propagate_null.cocci
F: scripts/coccinelle/remove_local_err.cocci
F: scripts/coccinelle/use-error_fatal.cocci
F: scripts/coccinelle/errp-guard.cocci

GDB stub
M: Alex Bennée <alex.bennee@linaro.org>
+24 −31
Original line number Diff line number Diff line
@@ -3113,12 +3113,9 @@ static void kvm_set_kvm_shadow_mem(Object *obj, Visitor *v,
                                   Error **errp)
{
    KVMState *s = KVM_STATE(obj);
    Error *error = NULL;
    int64_t value;

    visit_type_int(v, name, &value, &error);
    if (error) {
        error_propagate(errp, error);
    if (!visit_type_int(v, name, &value, errp)) {
        return;
    }

@@ -3129,15 +3126,12 @@ static void kvm_set_kernel_irqchip(Object *obj, Visitor *v,
                                   const char *name, void *opaque,
                                   Error **errp)
{
    Error *err = NULL;
    KVMState *s = KVM_STATE(obj);
    OnOffSplit mode;

    visit_type_OnOffSplit(v, name, &mode, &err);
    if (err) {
        error_propagate(errp, err);
    if (!visit_type_OnOffSplit(v, name, &mode, errp)) {
        return;
    } else {
    }
    switch (mode) {
    case ON_OFF_SPLIT_ON:
        s->kernel_irqchip_allowed = true;
@@ -3161,7 +3155,6 @@ static void kvm_set_kernel_irqchip(Object *obj, Visitor *v,
        abort();
    }
}
}

bool kvm_kernel_irqchip_allowed(void)
{
+1 −4
Original line number Diff line number Diff line
@@ -182,12 +182,9 @@ static void tcg_set_tb_size(Object *obj, Visitor *v,
                            Error **errp)
{
    TCGState *s = TCG_STATE(obj);
    Error *error = NULL;
    uint32_t value;

    visit_type_uint32(v, name, &value, &error);
    if (error) {
        error_propagate(errp, error);
    if (!visit_type_uint32(v, name, &value, errp)) {
        return;
    }

+10 −5
Original line number Diff line number Diff line
@@ -421,11 +421,12 @@ typedef struct {
    GList *path;
} LegacyPrintVisitor;

static void lv_start_struct(Visitor *v, const char *name, void **obj,
static bool lv_start_struct(Visitor *v, const char *name, void **obj,
                            size_t size, Error **errp)
{
    LegacyPrintVisitor *lv = (LegacyPrintVisitor *) v;
    lv->path = g_list_append(lv->path, g_strdup(name));
    return true;
}

static void lv_end_struct(Visitor *v, void **obj)
@@ -453,27 +454,30 @@ static void lv_print_key(Visitor *v, const char *name)
    printf("%s=", name);
}

static void lv_type_int64(Visitor *v, const char *name, int64_t *obj,
static bool lv_type_int64(Visitor *v, const char *name, int64_t *obj,
                          Error **errp)
{
    lv_print_key(v, name);
    printf("%" PRIi64, *obj);
    return true;
}

static void lv_type_uint64(Visitor *v, const char *name, uint64_t *obj,
static bool lv_type_uint64(Visitor *v, const char *name, uint64_t *obj,
                           Error **errp)
{
    lv_print_key(v, name);
    printf("%" PRIu64, *obj);
    return true;
}

static void lv_type_bool(Visitor *v, const char *name, bool *obj, Error **errp)
static bool lv_type_bool(Visitor *v, const char *name, bool *obj, Error **errp)
{
    lv_print_key(v, name);
    printf("%s", *obj ? "on" : "off");
    return true;
}

static void lv_type_str(Visitor *v, const char *name, char **obj, Error **errp)
static bool lv_type_str(Visitor *v, const char *name, char **obj, Error **errp)
{
    const char *str = *obj;
    lv_print_key(v, name);
@@ -484,6 +488,7 @@ static void lv_type_str(Visitor *v, const char *name, char **obj, Error **errp)
        }
        putchar(*str++);
    }
    return true;
}

static void lv_complete(Visitor *v, void *opaque)
+1 −2
Original line number Diff line number Diff line
@@ -209,8 +209,7 @@ static void cryptodev_vhost_user_init(
        backend->conf.peers.ccs[i] = cc;

        if (i == 0) {
            if (!qemu_chr_fe_init(&s->chr, chr, &local_err)) {
                error_propagate(errp, local_err);
            if (!qemu_chr_fe_init(&s->chr, chr, errp)) {
                return;
            }
        }
Loading