Error reporting patches patches for 2020-07-07
-----BEGIN PGP SIGNATURE----- iQJGBAABCAAwFiEENUvIs9frKmtoZ05fOHC0AOuRhlMFAl8IbBoSHGFybWJydUBy ZWRoYXQuY29tAAoJEDhwtADrkYZTeBsP+waQcWmLHkRWSW4zRbCqc3JhavrD8m6h nBk8J4tvMMaKIUNNpmFLl7xxB17FBpuUGJ6l/LBcW8XuAXmN6utT47UQqxlmsQ45 qtqcZ0GEfCqD0OVnrs2Mxun8ZpRSW/I+wrKVxaOFsF+Klq4lduixiRgFk+tpMtf2 eYxX1GlxnQK0JDjRrQe+ssx+q5nwbamxx1dVsFSjObLKXg+GJElQBfU0+HblXCGi N5hiZ2rw5a2+wPGQ3UVu1EWDuv7y67PZBidpmDX4t16atMCEGMgqG0Q+Rm5Tqwak NS84fn7RF7Q6zbXj/BdVwhZUjBcbfnYyWCR8mU1h/VKtvedlLp9Q3NsYjK3ilyjT NtygbLai9IEeKUcAYTfHyeK/pcfo//5joasFc5Q4FPTtLzK1K9ZFBUOcNyxOTIFD XVcM5fmnxkVFPGfV3nfwuXxhDPfCwk9FyB7hpVpHqtAPYWjYrqmnThZ2ineVcslQ mU/EBBcpb/hovlPyNZxWqfH3mU+8DJ1ojZwOgU6Z6NlIrm3L4mDG8ZOSm+wp6Q+s VIeXPVnvDTYlBuehPsV/B8eEwwYxfl43EDRw5ZuScj2QM4fyKuNXYjbDfTj9O+By eGs4PLKLi/9Sa0fUSRYqFAk8+XSrlkM7VlJ/xdBxMu7MeJq8896xINcSkLkewGml wkzB78QRZ6k4 =P9Td -----END PGP SIGNATURE----- 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: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
f2a1cf9180
|
@ -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>
|
||||
|
|
|
@ -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,37 +3126,33 @@ 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;
|
||||
s->kernel_irqchip_required = true;
|
||||
s->kernel_irqchip_split = ON_OFF_AUTO_OFF;
|
||||
break;
|
||||
case ON_OFF_SPLIT_OFF:
|
||||
s->kernel_irqchip_allowed = false;
|
||||
s->kernel_irqchip_required = false;
|
||||
s->kernel_irqchip_split = ON_OFF_AUTO_OFF;
|
||||
break;
|
||||
case ON_OFF_SPLIT_SPLIT:
|
||||
s->kernel_irqchip_allowed = true;
|
||||
s->kernel_irqchip_required = true;
|
||||
s->kernel_irqchip_split = ON_OFF_AUTO_ON;
|
||||
break;
|
||||
default:
|
||||
/* The value was checked in visit_type_OnOffSplit() above. If
|
||||
* we get here, then something is wrong in QEMU.
|
||||
*/
|
||||
abort();
|
||||
}
|
||||
}
|
||||
switch (mode) {
|
||||
case ON_OFF_SPLIT_ON:
|
||||
s->kernel_irqchip_allowed = true;
|
||||
s->kernel_irqchip_required = true;
|
||||
s->kernel_irqchip_split = ON_OFF_AUTO_OFF;
|
||||
break;
|
||||
case ON_OFF_SPLIT_OFF:
|
||||
s->kernel_irqchip_allowed = false;
|
||||
s->kernel_irqchip_required = false;
|
||||
s->kernel_irqchip_split = ON_OFF_AUTO_OFF;
|
||||
break;
|
||||
case ON_OFF_SPLIT_SPLIT:
|
||||
s->kernel_irqchip_allowed = true;
|
||||
s->kernel_irqchip_required = true;
|
||||
s->kernel_irqchip_split = ON_OFF_AUTO_ON;
|
||||
break;
|
||||
default:
|
||||
/* The value was checked in visit_type_OnOffSplit() above. If
|
||||
* we get here, then something is wrong in QEMU.
|
||||
*/
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -154,21 +154,17 @@ cryptodev_backend_set_queues(Object *obj, Visitor *v, const char *name,
|
|||
void *opaque, Error **errp)
|
||||
{
|
||||
CryptoDevBackend *backend = CRYPTODEV_BACKEND(obj);
|
||||
Error *local_err = NULL;
|
||||
uint32_t value;
|
||||
|
||||
visit_type_uint32(v, name, &value, &local_err);
|
||||
if (local_err) {
|
||||
goto out;
|
||||
if (!visit_type_uint32(v, name, &value, errp)) {
|
||||
return;
|
||||
}
|
||||
if (!value) {
|
||||
error_setg(&local_err, "Property '%s.%s' doesn't take value '%"
|
||||
PRIu32 "'", object_get_typename(obj), name, value);
|
||||
goto out;
|
||||
error_setg(errp, "Property '%s.%s' doesn't take value '%" PRIu32 "'",
|
||||
object_get_typename(obj), name, value);
|
||||
return;
|
||||
}
|
||||
backend->conf.peers.queues = value;
|
||||
out:
|
||||
error_propagate(errp, local_err);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -215,7 +211,7 @@ static void cryptodev_backend_instance_init(Object *obj)
|
|||
cryptodev_backend_set_queues,
|
||||
NULL, NULL);
|
||||
/* Initialize devices' queues property to 1 */
|
||||
object_property_set_int(obj, 1, "queues", NULL);
|
||||
object_property_set_int(obj, "queues", 1, NULL);
|
||||
}
|
||||
|
||||
static void cryptodev_backend_finalize(Object *obj)
|
||||
|
|
|
@ -110,23 +110,18 @@ static void file_memory_backend_set_align(Object *o, Visitor *v,
|
|||
{
|
||||
HostMemoryBackend *backend = MEMORY_BACKEND(o);
|
||||
HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(o);
|
||||
Error *local_err = NULL;
|
||||
uint64_t val;
|
||||
|
||||
if (host_memory_backend_mr_inited(backend)) {
|
||||
error_setg(&local_err, "cannot change property '%s' of %s",
|
||||
name, object_get_typename(o));
|
||||
goto out;
|
||||
error_setg(errp, "cannot change property '%s' of %s", name,
|
||||
object_get_typename(o));
|
||||
return;
|
||||
}
|
||||
|
||||
visit_type_size(v, name, &val, &local_err);
|
||||
if (local_err) {
|
||||
goto out;
|
||||
if (!visit_type_size(v, name, &val, errp)) {
|
||||
return;
|
||||
}
|
||||
fb->align = val;
|
||||
|
||||
out:
|
||||
error_propagate(errp, local_err);
|
||||
}
|
||||
|
||||
static bool file_memory_backend_get_pmem(Object *o, Error **errp)
|
||||
|
@ -140,7 +135,6 @@ static void file_memory_backend_set_pmem(Object *o, bool value, Error **errp)
|
|||
HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(o);
|
||||
|
||||
if (host_memory_backend_mr_inited(backend)) {
|
||||
|
||||
error_setg(errp, "cannot change property 'pmem' of %s.",
|
||||
object_get_typename(o));
|
||||
return;
|
||||
|
@ -148,13 +142,9 @@ static void file_memory_backend_set_pmem(Object *o, bool value, Error **errp)
|
|||
|
||||
#ifndef CONFIG_LIBPMEM
|
||||
if (value) {
|
||||
Error *local_err = NULL;
|
||||
|
||||
error_setg(&local_err,
|
||||
"Lack of libpmem support while setting the 'pmem=on'"
|
||||
error_setg(errp, "Lack of libpmem support while setting the 'pmem=on'"
|
||||
" of %s. We can't ensure data persistence.",
|
||||
object_get_typename(o));
|
||||
error_propagate(errp, local_err);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -77,26 +77,22 @@ memfd_backend_set_hugetlbsize(Object *obj, Visitor *v, const char *name,
|
|||
void *opaque, Error **errp)
|
||||
{
|
||||
HostMemoryBackendMemfd *m = MEMORY_BACKEND_MEMFD(obj);
|
||||
Error *local_err = NULL;
|
||||
uint64_t value;
|
||||
|
||||
if (host_memory_backend_mr_inited(MEMORY_BACKEND(obj))) {
|
||||
error_setg(&local_err, "cannot change property value");
|
||||
goto out;
|
||||
error_setg(errp, "cannot change property value");
|
||||
return;
|
||||
}
|
||||
|
||||
visit_type_size(v, name, &value, &local_err);
|
||||
if (local_err) {
|
||||
goto out;
|
||||
if (!visit_type_size(v, name, &value, errp)) {
|
||||
return;
|
||||
}
|
||||
if (!value) {
|
||||
error_setg(&local_err, "Property '%s.%s' doesn't take value '%"
|
||||
PRIu64 "'", object_get_typename(obj), name, value);
|
||||
goto out;
|
||||
error_setg(errp, "Property '%s.%s' doesn't take value '%" PRIu64 "'",
|
||||
object_get_typename(obj), name, value);
|
||||
return;
|
||||
}
|
||||
m->hugetlbsize = value;
|
||||
out:
|
||||
error_propagate(errp, local_err);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -54,28 +54,24 @@ host_memory_backend_set_size(Object *obj, Visitor *v, const char *name,
|
|||
void *opaque, Error **errp)
|
||||
{
|
||||
HostMemoryBackend *backend = MEMORY_BACKEND(obj);
|
||||
Error *local_err = NULL;
|
||||
uint64_t value;
|
||||
|
||||
if (host_memory_backend_mr_inited(backend)) {
|
||||
error_setg(&local_err, "cannot change property %s of %s ",
|
||||
name, object_get_typename(obj));
|
||||
goto out;
|
||||
error_setg(errp, "cannot change property %s of %s ", name,
|
||||
object_get_typename(obj));
|
||||
return;
|
||||
}
|
||||
|
||||
visit_type_size(v, name, &value, &local_err);
|
||||
if (local_err) {
|
||||
goto out;
|
||||
if (!visit_type_size(v, name, &value, errp)) {
|
||||
return;
|
||||
}
|
||||
if (!value) {
|
||||
error_setg(&local_err,
|
||||
error_setg(errp,
|
||||
"property '%s' of %s doesn't take value '%" PRIu64 "'",
|
||||
name, object_get_typename(obj), value);
|
||||
goto out;
|
||||
return;
|
||||
}
|
||||
backend->size = value;
|
||||
out:
|
||||
error_propagate(errp, local_err);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -254,22 +250,17 @@ static void host_memory_backend_set_prealloc_threads(Object *obj, Visitor *v,
|
|||
const char *name, void *opaque, Error **errp)
|
||||
{
|
||||
HostMemoryBackend *backend = MEMORY_BACKEND(obj);
|
||||
Error *local_err = NULL;
|
||||
uint32_t value;
|
||||
|
||||
visit_type_uint32(v, name, &value, &local_err);
|
||||
if (local_err) {
|
||||
goto out;
|
||||
if (!visit_type_uint32(v, name, &value, errp)) {
|
||||
return;
|
||||
}
|
||||
if (value <= 0) {
|
||||
error_setg(&local_err,
|
||||
"property '%s' of %s doesn't take value '%d'",
|
||||
name, object_get_typename(obj), value);
|
||||
goto out;
|
||||
error_setg(errp, "property '%s' of %s doesn't take value '%d'", name,
|
||||
object_get_typename(obj), value);
|
||||
return;
|
||||
}
|
||||
backend->prealloc_threads = value;
|
||||
out:
|
||||
error_propagate(errp, local_err);
|
||||
}
|
||||
|
||||
static void host_memory_backend_init(Object *obj)
|
||||
|
|
|
@ -48,7 +48,7 @@ static bool rng_backend_prop_get_opened(Object *obj, Error **errp)
|
|||
|
||||
static void rng_backend_complete(UserCreatable *uc, Error **errp)
|
||||
{
|
||||
object_property_set_bool(OBJECT(uc), true, "opened", errp);
|
||||
object_property_set_bool(OBJECT(uc), "opened", true, errp);
|
||||
}
|
||||
|
||||
static void rng_backend_prop_set_opened(Object *obj, bool value, Error **errp)
|
||||
|
|
|
@ -48,7 +48,6 @@ static void set_tpm(Object *obj, Visitor *v, const char *name, void *opaque,
|
|||
Error **errp)
|
||||
{
|
||||
DeviceState *dev = DEVICE(obj);
|
||||
Error *local_err = NULL;
|
||||
Property *prop = opaque;
|
||||
TPMBackend *s, **be = qdev_get_prop_ptr(dev, prop);
|
||||
char *str;
|
||||
|
@ -58,9 +57,7 @@ static void set_tpm(Object *obj, Visitor *v, const char *name, void *opaque,
|
|||
return;
|
||||
}
|
||||
|
||||
visit_type_str(v, name, &str, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!visit_type_str(v, name, &str, errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
21
block.c
21
block.c
|
@ -1629,9 +1629,7 @@ static int bdrv_open_common(BlockDriverState *bs, BlockBackend *file,
|
|||
assert(options != NULL && bs->options != options);
|
||||
|
||||
opts = qemu_opts_create(&bdrv_runtime_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!qemu_opts_absorb_qdict(opts, options, errp)) {
|
||||
ret = -EINVAL;
|
||||
goto fail_opts;
|
||||
}
|
||||
|
@ -4091,9 +4089,7 @@ int bdrv_reopen_prepare(BDRVReopenState *reopen_state, BlockReopenQueue *queue,
|
|||
|
||||
/* Process generic block layer options */
|
||||
opts = qemu_opts_create(&bdrv_runtime_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, reopen_state->options, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!qemu_opts_absorb_qdict(opts, reopen_state->options, errp)) {
|
||||
ret = -EINVAL;
|
||||
goto error;
|
||||
}
|
||||
|
@ -5665,10 +5661,9 @@ static void coroutine_fn bdrv_co_invalidate_cache(BlockDriverState *bs,
|
|||
if (bs->open_flags & BDRV_O_INACTIVE) {
|
||||
bs->open_flags &= ~BDRV_O_INACTIVE;
|
||||
bdrv_get_cumulative_perm(bs, &perm, &shared_perm);
|
||||
ret = bdrv_check_perm(bs, NULL, perm, shared_perm, NULL, NULL, &local_err);
|
||||
ret = bdrv_check_perm(bs, NULL, perm, shared_perm, NULL, NULL, errp);
|
||||
if (ret < 0) {
|
||||
bs->open_flags |= BDRV_O_INACTIVE;
|
||||
error_propagate(errp, local_err);
|
||||
return;
|
||||
}
|
||||
bdrv_set_perm(bs, perm, shared_perm);
|
||||
|
@ -6063,8 +6058,7 @@ void bdrv_img_create(const char *filename, const char *fmt,
|
|||
|
||||
/* Parse -o options */
|
||||
if (options) {
|
||||
qemu_opts_do_parse(opts, options, NULL, &local_err);
|
||||
if (local_err) {
|
||||
if (!qemu_opts_do_parse(opts, options, NULL, errp)) {
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
@ -6077,8 +6071,8 @@ void bdrv_img_create(const char *filename, const char *fmt,
|
|||
}
|
||||
|
||||
if (base_filename) {
|
||||
qemu_opt_set(opts, BLOCK_OPT_BACKING_FILE, base_filename, &local_err);
|
||||
if (local_err) {
|
||||
if (!qemu_opt_set(opts, BLOCK_OPT_BACKING_FILE, base_filename,
|
||||
NULL)) {
|
||||
error_setg(errp, "Backing file not supported for file format '%s'",
|
||||
fmt);
|
||||
goto out;
|
||||
|
@ -6086,8 +6080,7 @@ void bdrv_img_create(const char *filename, const char *fmt,
|
|||
}
|
||||
|
||||
if (base_fmt) {
|
||||
qemu_opt_set(opts, BLOCK_OPT_BACKING_FMT, base_fmt, &local_err);
|
||||
if (local_err) {
|
||||
if (!qemu_opt_set(opts, BLOCK_OPT_BACKING_FMT, base_fmt, NULL)) {
|
||||
error_setg(errp, "Backing file format not supported for file "
|
||||
"format '%s'", fmt);
|
||||
goto out;
|
||||
|
|
|
@ -359,7 +359,6 @@ static int blkdebug_parse_perm_list(uint64_t *dest, QDict *options,
|
|||
QObject *crumpled_subqdict = NULL;
|
||||
Visitor *v = NULL;
|
||||
BlockPermissionList *perm_list = NULL, *element;
|
||||
Error *local_err = NULL;
|
||||
|
||||
*dest = 0;
|
||||
|
||||
|
@ -375,9 +374,7 @@ static int blkdebug_parse_perm_list(uint64_t *dest, QDict *options,
|
|||
}
|
||||
|
||||
v = qobject_input_visitor_new(crumpled_subqdict);
|
||||
visit_type_BlockPermissionList(v, NULL, &perm_list, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!visit_type_BlockPermissionList(v, NULL, &perm_list, errp)) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
@ -472,9 +469,7 @@ static int blkdebug_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
uint64_t align;
|
||||
|
||||
opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!qemu_opts_absorb_qdict(opts, options, errp)) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
|
|
@ -149,10 +149,8 @@ static int blk_log_writes_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
bool log_append;
|
||||
|
||||
opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
if (!qemu_opts_absorb_qdict(opts, options, errp)) {
|
||||
ret = -EINVAL;
|
||||
error_propagate(errp, local_err);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
|
|
@ -116,9 +116,7 @@ static int blkverify_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
int ret;
|
||||
|
||||
opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!qemu_opts_absorb_qdict(opts, options, errp)) {
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
|
|
@ -260,7 +260,6 @@ static int block_crypto_open_generic(QCryptoBlockFormat format,
|
|||
{
|
||||
BlockCrypto *crypto = bs->opaque;
|
||||
QemuOpts *opts = NULL;
|
||||
Error *local_err = NULL;
|
||||
int ret = -EINVAL;
|
||||
QCryptoBlockOpenOptions *open_opts = NULL;
|
||||
unsigned int cflags = 0;
|
||||
|
@ -276,9 +275,7 @@ static int block_crypto_open_generic(QCryptoBlockFormat format,
|
|||
bs->file->bs->supported_write_flags;
|
||||
|
||||
opts = qemu_opts_create(opts_spec, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!qemu_opts_absorb_qdict(opts, options, errp)) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
|
|
@ -669,7 +669,6 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
BDRVCURLState *s = bs->opaque;
|
||||
CURLState *state = NULL;
|
||||
QemuOpts *opts;
|
||||
Error *local_err = NULL;
|
||||
const char *file;
|
||||
const char *cookie;
|
||||
const char *cookie_secret;
|
||||
|
@ -695,9 +694,7 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
|
||||
qemu_mutex_init(&s->mutex);
|
||||
opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!qemu_opts_absorb_qdict(opts, options, errp)) {
|
||||
goto out_noclean;
|
||||
}
|
||||
|
||||
|
|
|
@ -490,9 +490,7 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
|
|||
OnOffAuto locking;
|
||||
|
||||
opts = qemu_opts_create(&raw_runtime_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!qemu_opts_absorb_qdict(opts, options, errp)) {
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
@ -1000,9 +998,7 @@ static int raw_reopen_prepare(BDRVReopenState *state,
|
|||
|
||||
/* Handle options changes */
|
||||
opts = qemu_opts_create(&raw_runtime_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, state->options, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!qemu_opts_absorb_qdict(opts, state->options, errp)) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
@ -3333,7 +3329,6 @@ static int hdev_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
Error **errp)
|
||||
{
|
||||
BDRVRawState *s = bs->opaque;
|
||||
Error *local_err = NULL;
|
||||
int ret;
|
||||
|
||||
#if defined(__APPLE__) && defined(__MACH__)
|
||||
|
@ -3398,9 +3393,8 @@ hdev_open_Mac_error:
|
|||
|
||||
s->type = FTYPE_FILE;
|
||||
|
||||
ret = raw_open_common(bs, options, flags, 0, true, &local_err);
|
||||
ret = raw_open_common(bs, options, flags, 0, true, errp);
|
||||
if (ret < 0) {
|
||||
error_propagate(errp, local_err);
|
||||
#if defined(__APPLE__) && defined(__MACH__)
|
||||
if (*bsd_path) {
|
||||
filename = bsd_path;
|
||||
|
@ -3676,14 +3670,12 @@ static int cdrom_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
Error **errp)
|
||||
{
|
||||
BDRVRawState *s = bs->opaque;
|
||||
Error *local_err = NULL;
|
||||
int ret;
|
||||
|
||||
s->type = FTYPE_CD;
|
||||
|
||||
ret = raw_open_common(bs, options, flags, 0, true, &local_err);
|
||||
ret = raw_open_common(bs, options, flags, 0, true, errp);
|
||||
if (ret) {
|
||||
error_propagate(errp, local_err);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -338,9 +338,7 @@ static int raw_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
s->type = FTYPE_FILE;
|
||||
|
||||
opts = qemu_opts_create(&raw_runtime_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!qemu_opts_absorb_qdict(opts, options, errp)) {
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
@ -739,9 +737,7 @@ static int hdev_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
|
||||
QemuOpts *opts = qemu_opts_create(&raw_runtime_opts, NULL, 0,
|
||||
&error_abort);
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!qemu_opts_absorb_qdict(opts, options, errp)) {
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
|
|
@ -523,8 +523,7 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
|
|||
|
||||
/* create opts info from runtime_json_opts list */
|
||||
opts = qemu_opts_create(&runtime_json_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
if (!qemu_opts_absorb_qdict(opts, options, errp)) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -555,8 +554,7 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
|
|||
|
||||
/* create opts info from runtime_type_opts list */
|
||||
opts = qemu_opts_create(&runtime_type_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, backing_options, &local_err);
|
||||
if (local_err) {
|
||||
if (!qemu_opts_absorb_qdict(opts, backing_options, errp)) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -586,8 +584,7 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
|
|||
if (gsconf->type == SOCKET_ADDRESS_TYPE_INET) {
|
||||
/* create opts info from runtime_inet_opts list */
|
||||
opts = qemu_opts_create(&runtime_inet_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, backing_options, &local_err);
|
||||
if (local_err) {
|
||||
if (!qemu_opts_absorb_qdict(opts, backing_options, errp)) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -635,8 +632,7 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
|
|||
} else {
|
||||
/* create opts info from runtime_unix_opts list */
|
||||
opts = qemu_opts_create(&runtime_unix_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, backing_options, &local_err);
|
||||
if (local_err) {
|
||||
if (!qemu_opts_absorb_qdict(opts, backing_options, errp)) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -815,13 +811,10 @@ static int qemu_gluster_open(BlockDriverState *bs, QDict *options,
|
|||
int ret = 0;
|
||||
BlockdevOptionsGluster *gconf = NULL;
|
||||
QemuOpts *opts;
|
||||
Error *local_err = NULL;
|
||||
const char *filename, *logfile;
|
||||
|
||||
opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!qemu_opts_absorb_qdict(opts, options, errp)) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
|
|
@ -1792,9 +1792,7 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
int i, ret = 0, timeout = 0, lun;
|
||||
|
||||
opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!qemu_opts_absorb_qdict(opts, options, errp)) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
|
17
block/nbd.c
17
block/nbd.c
|
@ -1408,16 +1408,15 @@ static void nbd_client_close(BlockDriverState *bs)
|
|||
static QIOChannelSocket *nbd_establish_connection(SocketAddress *saddr,
|
||||
Error **errp)
|
||||
{
|
||||
ERRP_GUARD();
|
||||
QIOChannelSocket *sioc;
|
||||
Error *local_err = NULL;
|
||||
|
||||
sioc = qio_channel_socket_new();
|
||||
qio_channel_set_name(QIO_CHANNEL(sioc), "nbd-client");
|
||||
|
||||
qio_channel_socket_connect_sync(sioc, saddr, &local_err);
|
||||
if (local_err) {
|
||||
qio_channel_socket_connect_sync(sioc, saddr, errp);
|
||||
if (*errp) {
|
||||
object_unref(OBJECT(sioc));
|
||||
error_propagate(errp, local_err);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -1726,7 +1725,6 @@ static SocketAddress *nbd_config(BDRVNBDState *s, QDict *options,
|
|||
SocketAddress *saddr = NULL;
|
||||
QDict *addr = NULL;
|
||||
Visitor *iv = NULL;
|
||||
Error *local_err = NULL;
|
||||
|
||||
qdict_extract_subqdict(options, &addr, "server.");
|
||||
if (!qdict_size(addr)) {
|
||||
|
@ -1739,9 +1737,7 @@ static SocketAddress *nbd_config(BDRVNBDState *s, QDict *options,
|
|||
goto done;
|
||||
}
|
||||
|
||||
visit_type_SocketAddress(iv, NULL, &saddr, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!visit_type_SocketAddress(iv, NULL, &saddr, errp)) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
@ -1836,13 +1832,10 @@ static int nbd_process_options(BlockDriverState *bs, QDict *options,
|
|||
{
|
||||
BDRVNBDState *s = bs->opaque;
|
||||
QemuOpts *opts;
|
||||
Error *local_err = NULL;
|
||||
int ret = -EINVAL;
|
||||
|
||||
opts = qemu_opts_create(&nbd_runtime_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!qemu_opts_absorb_qdict(opts, options, errp)) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
|
|
@ -563,18 +563,15 @@ static BlockdevOptionsNfs *nfs_options_qdict_to_qapi(QDict *options,
|
|||
BlockdevOptionsNfs *opts = NULL;
|
||||
Visitor *v;
|
||||
const QDictEntry *e;
|
||||
Error *local_err = NULL;
|
||||
|
||||
v = qobject_input_visitor_new_flat_confused(options, errp);
|
||||
if (!v) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
visit_type_BlockdevOptionsNfs(v, NULL, &opts, &local_err);
|
||||
visit_type_BlockdevOptionsNfs(v, NULL, &opts, errp);
|
||||
visit_free(v);
|
||||
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!opts) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -625,7 +625,6 @@ static int coroutine_fn parallels_co_create_opts(BlockDriver *drv,
|
|||
Error **errp)
|
||||
{
|
||||
BlockdevCreateOptions *create_options = NULL;
|
||||
Error *local_err = NULL;
|
||||
BlockDriverState *bs = NULL;
|
||||
QDict *qdict;
|
||||
Visitor *v;
|
||||
|
@ -646,9 +645,8 @@ static int coroutine_fn parallels_co_create_opts(BlockDriver *drv,
|
|||
}
|
||||
|
||||
/* Create and open the file (protocol layer) */
|
||||
ret = bdrv_create_file(filename, opts, &local_err);
|
||||
ret = bdrv_create_file(filename, opts, errp);
|
||||
if (ret < 0) {
|
||||
error_propagate(errp, local_err);
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
@ -669,11 +667,9 @@ static int coroutine_fn parallels_co_create_opts(BlockDriver *drv,
|
|||
goto done;
|
||||
}
|
||||
|
||||
visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
|
||||
visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
|
||||
visit_free(v);
|
||||
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!create_options) {
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
@ -824,13 +820,12 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
}
|
||||
}
|
||||
|
||||
opts = qemu_opts_create(¶llels_runtime_opts, NULL, 0, &local_err);
|
||||
if (local_err != NULL) {
|
||||
opts = qemu_opts_create(¶llels_runtime_opts, NULL, 0, errp);
|
||||
if (!opts) {
|
||||
goto fail_options;
|
||||
}
|
||||
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err != NULL) {
|
||||
if (!qemu_opts_absorb_qdict(opts, options, errp)) {
|
||||
goto fail_options;
|
||||
}
|
||||
|
||||
|
@ -844,6 +839,7 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
&local_err);
|
||||
g_free(buf);
|
||||
if (local_err != NULL) {
|
||||
error_propagate(errp, local_err);
|
||||
goto fail_options;
|
||||
}
|
||||
|
||||
|
@ -863,9 +859,8 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
error_setg(&s->migration_blocker, "The Parallels format used by node '%s' "
|
||||
"does not support live migration",
|
||||
bdrv_get_device_or_node_name(bs));
|
||||
ret = migrate_add_blocker(s->migration_blocker, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
ret = migrate_add_blocker(s->migration_blocker, errp);
|
||||
if (ret < 0) {
|
||||
error_free(s->migration_blocker);
|
||||
goto fail;
|
||||
}
|
||||
|
@ -874,15 +869,11 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
|
||||
fail_format:
|
||||
error_setg(errp, "Image not in Parallels format");
|
||||
fail_options:
|
||||
ret = -EINVAL;
|
||||
fail:
|
||||
qemu_vfree(s->header);
|
||||
return ret;
|
||||
|
||||
fail_options:
|
||||
error_propagate(errp, local_err);
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
|
|
16
block/qcow.c
16
block/qcow.c
|
@ -121,7 +121,6 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
unsigned int len, i, shift;
|
||||
int ret;
|
||||
QCowHeader header;
|
||||
Error *local_err = NULL;
|
||||
QCryptoBlockOpenOptions *crypto_opts = NULL;
|
||||
unsigned int cflags = 0;
|
||||
QDict *encryptopts = NULL;
|
||||
|
@ -314,9 +313,8 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
error_setg(&s->migration_blocker, "The qcow format used by node '%s' "
|
||||
"does not support live migration",
|
||||
bdrv_get_device_or_node_name(bs));
|
||||
ret = migrate_add_blocker(s->migration_blocker, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
ret = migrate_add_blocker(s->migration_blocker, errp);
|
||||
if (ret < 0) {
|
||||
error_free(s->migration_blocker);
|
||||
goto fail;
|
||||
}
|
||||
|
@ -943,7 +941,6 @@ static int coroutine_fn qcow_co_create_opts(BlockDriver *drv,
|
|||
QDict *qdict;
|
||||
Visitor *v;
|
||||
const char *val;
|
||||
Error *local_err = NULL;
|
||||
int ret;
|
||||
|
||||
static const QDictRenames opt_renames[] = {
|
||||
|
@ -973,9 +970,8 @@ static int coroutine_fn qcow_co_create_opts(BlockDriver *drv,
|
|||
}
|
||||
|
||||
/* Create and open the file (protocol layer) */
|
||||
ret = bdrv_create_file(filename, opts, &local_err);
|
||||
ret = bdrv_create_file(filename, opts, errp);
|
||||
if (ret < 0) {
|
||||
error_propagate(errp, local_err);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -996,11 +992,9 @@ static int coroutine_fn qcow_co_create_opts(BlockDriver *drv,
|
|||
goto fail;
|
||||
}
|
||||
|
||||
visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
|
||||
visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
|
||||
visit_free(v);
|
||||
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!create_options) {
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
|
|
@ -990,9 +990,7 @@ static int qcow2_update_options_prepare(BlockDriverState *bs,
|
|||
encryptfmt = qdict_get_try_str(encryptopts, "format");
|
||||
|
||||
opts = qemu_opts_create(&qcow2_runtime_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!qemu_opts_absorb_qdict(opts, options, errp)) {
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
@ -1596,8 +1594,7 @@ static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options,
|
|||
|
||||
/* read qcow2 extensions */
|
||||
if (qcow2_read_extensions(bs, header.header_length, ext_end, NULL,
|
||||
flags, &update_header, &local_err)) {
|
||||
error_propagate(errp, local_err);
|
||||
flags, &update_header, errp)) {
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
@ -3358,7 +3355,6 @@ qcow2_co_create(BlockdevCreateOptions *create_options, Error **errp)
|
|||
int version;
|
||||
int refcount_order;
|
||||
uint64_t* refcount_table;
|
||||
Error *local_err = NULL;
|
||||
int ret;
|
||||
uint8_t compression_type = QCOW2_COMPRESSION_TYPE_ZLIB;
|
||||
|
||||
|
@ -3584,9 +3580,8 @@ qcow2_co_create(BlockdevCreateOptions *create_options, Error **errp)
|
|||
}
|
||||
blk = blk_new_open(NULL, NULL, options,
|
||||
BDRV_O_RDWR | BDRV_O_RESIZE | BDRV_O_NO_FLUSH,
|
||||
&local_err);
|
||||
errp);
|
||||
if (blk == NULL) {
|
||||
error_propagate(errp, local_err);
|
||||
ret = -EIO;
|
||||
goto out;
|
||||
}
|
||||
|
@ -3666,9 +3661,8 @@ qcow2_co_create(BlockdevCreateOptions *create_options, Error **errp)
|
|||
}
|
||||
blk = blk_new_open(NULL, NULL, options,
|
||||
BDRV_O_RDWR | BDRV_O_NO_BACKING | BDRV_O_NO_IO,
|
||||
&local_err);
|
||||
errp);
|
||||
if (blk == NULL) {
|
||||
error_propagate(errp, local_err);
|
||||
ret = -EIO;
|
||||
goto out;
|
||||
}
|
||||
|
@ -3691,7 +3685,6 @@ static int coroutine_fn qcow2_co_create_opts(BlockDriver *drv,
|
|||
Visitor *v;
|
||||
BlockDriverState *bs = NULL;
|
||||
BlockDriverState *data_bs = NULL;
|
||||
Error *local_err = NULL;
|
||||
const char *val;
|
||||
int ret;
|
||||
|
||||
|
@ -3787,11 +3780,9 @@ static int coroutine_fn qcow2_co_create_opts(BlockDriver *drv,
|
|||
goto finish;
|
||||
}
|
||||
|
||||
visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
|
||||
visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
|
||||
visit_free(v);
|
||||
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!create_options) {
|
||||
ret = -EINVAL;
|
||||
goto finish;
|
||||
}
|
||||
|
|
10
block/qed.c
10
block/qed.c
|
@ -729,7 +729,6 @@ static int coroutine_fn bdrv_qed_co_create_opts(BlockDriver *drv,
|
|||
QDict *qdict;
|
||||
Visitor *v;
|
||||
BlockDriverState *bs = NULL;
|
||||
Error *local_err = NULL;
|
||||
int ret;
|
||||
|
||||
static const QDictRenames opt_renames[] = {
|
||||
|
@ -749,9 +748,8 @@ static int coroutine_fn bdrv_qed_co_create_opts(BlockDriver *drv,
|
|||
}
|
||||
|
||||
/* Create and open the file (protocol layer) */
|
||||
ret = bdrv_create_file(filename, opts, &local_err);
|
||||
ret = bdrv_create_file(filename, opts, errp);
|
||||
if (ret < 0) {
|
||||
error_propagate(errp, local_err);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -772,11 +770,9 @@ static int coroutine_fn bdrv_qed_co_create_opts(BlockDriver *drv,
|
|||
goto fail;
|
||||
}
|
||||
|
||||
visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
|
||||
visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
|
||||
visit_free(v);
|
||||
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!create_options) {
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
|
|
@ -910,27 +910,25 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
/* count how many different children are present */
|
||||
s->num_children = qdict_array_entries(options, "children.");
|
||||
if (s->num_children < 0) {
|
||||
error_setg(&local_err, "Option children is not a valid array");
|
||||
error_setg(errp, "Option children is not a valid array");
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
if (s->num_children < 1) {
|
||||
error_setg(&local_err,
|
||||
"Number of provided children must be 1 or more");
|
||||
error_setg(errp, "Number of provided children must be 1 or more");
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
opts = qemu_opts_create(&quorum_runtime_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
if (!qemu_opts_absorb_qdict(opts, options, errp)) {
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
s->threshold = qemu_opt_get_number(opts, QUORUM_OPT_VOTE_THRESHOLD, 0);
|
||||
/* and validate it against s->num_children */
|
||||
ret = quorum_valid_threshold(s->threshold, s->num_children, &local_err);
|
||||
ret = quorum_valid_threshold(s->threshold, s->num_children, errp);
|
||||
if (ret < 0) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -943,7 +941,7 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
-EINVAL, NULL);
|
||||
}
|
||||
if (ret < 0) {
|
||||
error_setg(&local_err, "Please set read-pattern as fifo or quorum");
|
||||
error_setg(errp, "Please set read-pattern as fifo or quorum");
|
||||
goto exit;
|
||||
}
|
||||
s->read_pattern = ret;
|
||||
|
@ -951,7 +949,7 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
if (s->read_pattern == QUORUM_READ_PATTERN_QUORUM) {
|
||||
s->is_blkverify = qemu_opt_get_bool(opts, QUORUM_OPT_BLKVERIFY, false);
|
||||
if (s->is_blkverify && (s->num_children != 2 || s->threshold != 2)) {
|
||||
error_setg(&local_err, "blkverify=on can only be set if there are "
|
||||
error_setg(errp, "blkverify=on can only be set if there are "
|
||||
"exactly two files and vote-threshold is 2");
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
|
@ -960,7 +958,7 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
s->rewrite_corrupted = qemu_opt_get_bool(opts, QUORUM_OPT_REWRITE,
|
||||
false);
|
||||
if (s->rewrite_corrupted && s->is_blkverify) {
|
||||
error_setg(&local_err,
|
||||
error_setg(errp,
|
||||
"rewrite-corrupted=on cannot be used with blkverify=on");
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
|
@ -980,6 +978,7 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
&child_of_bds, BDRV_CHILD_DATA, false,
|
||||
&local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
ret = -EINVAL;
|
||||
goto close_exit;
|
||||
}
|
||||
|
@ -1005,8 +1004,6 @@ close_exit:
|
|||
g_free(opened);
|
||||
exit:
|
||||
qemu_opts_del(opts);
|
||||
/* propagate error */
|
||||
error_propagate(errp, local_err);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -74,14 +74,11 @@ static QemuOptsList raw_create_opts = {
|
|||
static int raw_read_options(QDict *options, uint64_t *offset, bool *has_size,
|
||||
uint64_t *size, Error **errp)
|
||||
{
|
||||
Error *local_err = NULL;
|
||||
QemuOpts *opts = NULL;
|
||||
int ret;
|
||||
|
||||
opts = qemu_opts_create(&raw_runtime_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!qemu_opts_absorb_qdict(opts, options, errp)) {
|
||||
ret = -EINVAL;
|
||||
goto end;
|
||||
}
|
||||
|
|
|
@ -681,7 +681,6 @@ static int qemu_rbd_convert_options(QDict *options, BlockdevOptionsRbd **opts,
|
|||
Error **errp)
|
||||
{
|
||||
Visitor *v;
|
||||
Error *local_err = NULL;
|
||||
|
||||
/* Convert the remaining options into a QAPI object */
|
||||
v = qobject_input_visitor_new_flat_confused(options, errp);
|
||||
|
@ -689,11 +688,9 @@ static int qemu_rbd_convert_options(QDict *options, BlockdevOptionsRbd **opts,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
visit_type_BlockdevOptionsRbd(v, NULL, opts, &local_err);
|
||||
visit_type_BlockdevOptionsRbd(v, NULL, opts, errp);
|
||||
visit_free(v);
|
||||
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!opts) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
|
@ -85,7 +85,6 @@ static int replication_open(BlockDriverState *bs, QDict *options,
|
|||
{
|
||||
int ret;
|
||||
BDRVReplicationState *s = bs->opaque;
|
||||
Error *local_err = NULL;
|
||||
QemuOpts *opts = NULL;
|
||||
const char *mode;
|
||||
const char *top_id;
|
||||
|
@ -99,14 +98,13 @@ static int replication_open(BlockDriverState *bs, QDict *options,
|
|||
|
||||
ret = -EINVAL;
|
||||
opts = qemu_opts_create(&replication_runtime_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
if (!qemu_opts_absorb_qdict(opts, options, errp)) {
|
||||
goto fail;
|
||||
}
|
||||
|
||||
mode = qemu_opt_get(opts, REPLICATION_MODE);
|
||||
if (!mode) {
|
||||
error_setg(&local_err, "Missing the option mode");
|
||||
error_setg(errp, "Missing the option mode");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -114,7 +112,8 @@ static int replication_open(BlockDriverState *bs, QDict *options,
|
|||
s->mode = REPLICATION_MODE_PRIMARY;
|
||||
top_id = qemu_opt_get(opts, REPLICATION_TOP_ID);
|
||||
if (top_id) {
|
||||
error_setg(&local_err, "The primary side does not support option top-id");
|
||||
error_setg(errp,
|
||||
"The primary side does not support option top-id");
|
||||
goto fail;
|
||||
}
|
||||
} else if (!strcmp(mode, "secondary")) {
|
||||
|
@ -122,11 +121,11 @@ static int replication_open(BlockDriverState *bs, QDict *options,
|
|||
top_id = qemu_opt_get(opts, REPLICATION_TOP_ID);
|
||||
s->top_id = g_strdup(top_id);
|
||||
if (!s->top_id) {
|
||||
error_setg(&local_err, "Missing the option top-id");
|
||||
error_setg(errp, "Missing the option top-id");
|
||||
goto fail;
|
||||
}
|
||||
} else {
|
||||
error_setg(&local_err,
|
||||
error_setg(errp,
|
||||
"The option mode's value should be primary or secondary");
|
||||
goto fail;
|
||||
}
|
||||
|
@ -137,8 +136,6 @@ static int replication_open(BlockDriverState *bs, QDict *options,
|
|||
|
||||
fail:
|
||||
qemu_opts_del(opts);
|
||||
error_propagate(errp, local_err);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -369,7 +366,6 @@ static void reopen_backing_file(BlockDriverState *bs, bool writable,
|
|||
{
|
||||
BDRVReplicationState *s = bs->opaque;
|
||||
BlockReopenQueue *reopen_queue = NULL;
|
||||
Error *local_err = NULL;
|
||||
|
||||
if (writable) {
|
||||
s->orig_hidden_read_only = bdrv_is_read_only(s->hidden_disk->bs);
|
||||
|
@ -394,8 +390,7 @@ static void reopen_backing_file(BlockDriverState *bs, bool writable,
|
|||
}
|
||||
|
||||
if (reopen_queue) {
|
||||
bdrv_reopen_multiple(reopen_queue, &local_err);
|
||||
error_propagate(errp, local_err);
|
||||
bdrv_reopen_multiple(reopen_queue, errp);
|
||||
}
|
||||
|
||||
bdrv_subtree_drained_end(s->hidden_disk->bs);
|
||||
|
|
|
@ -532,7 +532,6 @@ static SocketAddress *sd_server_config(QDict *options, Error **errp)
|
|||
QDict *server = NULL;
|
||||
Visitor *iv = NULL;
|
||||
SocketAddress *saddr = NULL;
|
||||
Error *local_err = NULL;
|
||||
|
||||
qdict_extract_subqdict(options, &server, "server.");
|
||||
|
||||
|
@ -541,9 +540,7 @@ static SocketAddress *sd_server_config(QDict *options, Error **errp)
|
|||
goto done;
|
||||
}
|
||||
|
||||
visit_type_SocketAddress(iv, NULL, &saddr, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!visit_type_SocketAddress(iv, NULL, &saddr, errp)) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
@ -1550,15 +1547,12 @@ static int sd_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
uint64_t snap_id;
|
||||
char *buf = NULL;
|
||||
QemuOpts *opts;
|
||||
Error *local_err = NULL;
|
||||
|
||||
s->bs = bs;
|
||||
s->aio_context = bdrv_get_aio_context(bs);
|
||||
|
||||
opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!qemu_opts_absorb_qdict(opts, options, errp)) {
|
||||
ret = -EINVAL;
|
||||
goto err_no_fd;
|
||||
}
|
||||
|
@ -2199,11 +2193,9 @@ static int coroutine_fn sd_co_create_opts(BlockDriver *drv,
|
|||
goto fail;
|
||||
}
|
||||
|
||||
visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
|
||||
visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
|
||||
visit_free(v);
|
||||
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!create_options) {
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
|
11
block/ssh.c
11
block/ssh.c
|
@ -616,15 +616,12 @@ static BlockdevOptionsSsh *ssh_parse_options(QDict *options, Error **errp)
|
|||
{
|
||||
BlockdevOptionsSsh *result = NULL;
|
||||
QemuOpts *opts = NULL;
|
||||
Error *local_err = NULL;
|
||||
const QDictEntry *e;
|
||||
Visitor *v;
|
||||
|
||||
/* Translate legacy options */
|
||||
opts = qemu_opts_create(&ssh_runtime_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!qemu_opts_absorb_qdict(opts, options, errp)) {
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -638,11 +635,9 @@ static BlockdevOptionsSsh *ssh_parse_options(QDict *options, Error **errp)
|
|||
goto fail;
|
||||
}
|
||||
|
||||
visit_type_BlockdevOptionsSsh(v, NULL, &result, &local_err);
|
||||
visit_type_BlockdevOptionsSsh(v, NULL, &result, errp);
|
||||
visit_free(v);
|
||||
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!result) {
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
|
|
@ -811,7 +811,6 @@ static void throttle_group_set(Object *obj, Visitor *v, const char * name,
|
|||
ThrottleGroup *tg = THROTTLE_GROUP(obj);
|
||||
ThrottleConfig *cfg;
|
||||
ThrottleParamInfo *info = opaque;
|
||||
Error *local_err = NULL;
|
||||
int64_t value;
|
||||
|
||||
/* If we have finished initialization, don't accept individual property
|
||||
|
@ -819,17 +818,16 @@ static void throttle_group_set(Object *obj, Visitor *v, const char * name,
|
|||
* transaction, as certain combinations are invalid.
|
||||
*/
|
||||
if (tg->is_initialized) {
|
||||
error_setg(&local_err, "Property cannot be set after initialization");
|
||||
goto ret;
|
||||
error_setg(errp, "Property cannot be set after initialization");
|
||||
return;
|
||||
}
|
||||
|
||||
visit_type_int64(v, name, &value, &local_err);
|
||||
if (local_err) {
|
||||
goto ret;
|
||||
if (!visit_type_int64(v, name, &value, errp)) {
|
||||
return;
|
||||
}
|
||||
if (value < 0) {
|
||||
error_setg(&local_err, "Property values cannot be negative");
|
||||
goto ret;
|
||||
error_setg(errp, "Property values cannot be negative");
|
||||
return;
|
||||
}
|
||||
|
||||
cfg = &tg->ts.cfg;
|
||||
|
@ -842,9 +840,9 @@ static void throttle_group_set(Object *obj, Visitor *v, const char * name,
|
|||
break;
|
||||
case BURST_LENGTH:
|
||||
if (value > UINT_MAX) {
|
||||
error_setg(&local_err, "%s value must be in the"
|
||||
"range [0, %u]", info->name, UINT_MAX);
|
||||
goto ret;
|
||||
error_setg(errp, "%s value must be in the" "range [0, %u]",
|
||||
info->name, UINT_MAX);
|
||||
return;
|
||||
}
|
||||
cfg->buckets[info->type].burst_length = value;
|
||||
break;
|
||||
|
@ -852,11 +850,6 @@ static void throttle_group_set(Object *obj, Visitor *v, const char * name,
|
|||
cfg->op_size = value;
|
||||
break;
|
||||
}
|
||||
|
||||
ret:
|
||||
error_propagate(errp, local_err);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
static void throttle_group_get(Object *obj, Visitor *v, const char *name,
|
||||
|
@ -896,9 +889,8 @@ static void throttle_group_set_limits(Object *obj, Visitor *v,
|
|||
ThrottleLimits *argp;
|
||||
Error *local_err = NULL;
|
||||
|
||||
visit_type_ThrottleLimits(v, name, &argp, &local_err);
|
||||
if (local_err) {
|
||||
goto ret;
|
||||
if (!visit_type_ThrottleLimits(v, name, &argp, errp)) {
|
||||
return;
|
||||
}
|
||||
qemu_mutex_lock(&tg->lock);
|
||||
throttle_get_config(&tg->ts, &cfg);
|
||||
|
@ -910,7 +902,6 @@ static void throttle_group_set_limits(Object *obj, Visitor *v,
|
|||
|
||||
unlock:
|
||||
qemu_mutex_unlock(&tg->lock);
|
||||
ret:
|
||||
qapi_free_ThrottleLimits(argp);
|
||||
error_propagate(errp, local_err);
|
||||
return;
|
||||
|
|
|
@ -46,12 +46,9 @@ static int throttle_parse_options(QDict *options, char **group, Error **errp)
|
|||
{
|
||||
int ret;
|
||||
const char *group_name;
|
||||
Error *local_err = NULL;
|
||||
QemuOpts *opts = qemu_opts_create(&throttle_opts, NULL, 0, &error_abort);
|
||||
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!qemu_opts_absorb_qdict(opts, options, errp)) {
|
||||
ret = -EINVAL;
|
||||
goto fin;
|
||||
}
|
||||
|
|
13
block/vdi.c
13
block/vdi.c
|
@ -374,7 +374,6 @@ static int vdi_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
VdiHeader header;
|
||||
size_t bmap_size;
|
||||
int ret;
|
||||
Error *local_err = NULL;
|
||||
QemuUUID uuid_link, uuid_parent;
|
||||
|
||||
bs->file = bdrv_open_child(NULL, options, "file", bs, &child_of_bds,
|
||||
|
@ -495,9 +494,8 @@ static int vdi_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
error_setg(&s->migration_blocker, "The vdi format used by node '%s' "
|
||||
"does not support live migration",
|
||||
bdrv_get_device_or_node_name(bs));
|
||||
ret = migrate_add_blocker(s->migration_blocker, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
ret = migrate_add_blocker(s->migration_blocker, errp);
|
||||
if (ret < 0) {
|
||||
error_free(s->migration_blocker);
|
||||
goto fail_free_bmap;
|
||||
}
|
||||
|
@ -906,7 +904,6 @@ static int coroutine_fn vdi_co_create_opts(BlockDriver *drv,
|
|||
uint64_t block_size = DEFAULT_CLUSTER_SIZE;
|
||||
bool is_static = false;
|
||||
Visitor *v;
|
||||
Error *local_err = NULL;
|
||||
int ret;
|
||||
|
||||
/* Parse options and convert legacy syntax.
|
||||
|
@ -957,11 +954,9 @@ static int coroutine_fn vdi_co_create_opts(BlockDriver *drv,
|
|||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
|
||||
visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
|
||||
visit_free(v);
|
||||
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!create_options) {
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
|
15
block/vhdx.c
15
block/vhdx.c
|
@ -1089,9 +1089,8 @@ static int vhdx_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
error_setg(&s->migration_blocker, "The vhdx format used by node '%s' "
|
||||
"does not support live migration",
|
||||
bdrv_get_device_or_node_name(bs));
|
||||
ret = migrate_add_blocker(s->migration_blocker, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
ret = migrate_add_blocker(s->migration_blocker, errp);
|
||||
if (ret < 0) {
|
||||
error_free(s->migration_blocker);
|
||||
goto fail;
|
||||
}
|
||||
|
@ -2064,7 +2063,6 @@ static int coroutine_fn vhdx_co_create_opts(BlockDriver *drv,
|
|||
QDict *qdict;
|
||||
Visitor *v;
|
||||
BlockDriverState *bs = NULL;
|
||||
Error *local_err = NULL;
|
||||
int ret;
|
||||
|
||||
static const QDictRenames opt_renames[] = {
|
||||
|
@ -2083,9 +2081,8 @@ static int coroutine_fn vhdx_co_create_opts(BlockDriver *drv,
|
|||
}
|
||||
|
||||
/* Create and open the file (protocol layer) */
|
||||
ret = bdrv_create_file(filename, opts, &local_err);
|
||||
ret = bdrv_create_file(filename, opts, errp);
|
||||
if (ret < 0) {
|
||||
error_propagate(errp, local_err);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -2106,11 +2103,9 @@ static int coroutine_fn vhdx_co_create_opts(BlockDriver *drv,
|
|||
goto fail;
|
||||
}
|
||||
|
||||
visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
|
||||
visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
|
||||
visit_free(v);
|
||||
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!create_options) {
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
|
13
block/vmdk.c
13
block/vmdk.c
|
@ -1263,7 +1263,6 @@ static int vmdk_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
int ret;
|
||||
BDRVVmdkState *s = bs->opaque;
|
||||
uint32_t magic;
|
||||
Error *local_err = NULL;
|
||||
|
||||
bs->file = bdrv_open_child(NULL, options, "file", bs, &child_of_bds,
|
||||
BDRV_CHILD_IMAGE, false, errp);
|
||||
|
@ -1317,9 +1316,8 @@ static int vmdk_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
error_setg(&s->migration_blocker, "The vmdk format used by node '%s' "
|
||||
"does not support live migration",
|
||||
bdrv_get_device_or_node_name(bs));
|
||||
ret = migrate_add_blocker(s->migration_blocker, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
ret = migrate_add_blocker(s->migration_blocker, errp);
|
||||
if (ret < 0) {
|
||||
error_free(s->migration_blocker);
|
||||
goto fail;
|
||||
}
|
||||
|
@ -2250,19 +2248,16 @@ static int vmdk_create_extent(const char *filename, int64_t filesize,
|
|||
{
|
||||
int ret;
|
||||
BlockBackend *blk = NULL;
|
||||
Error *local_err = NULL;
|
||||
|
||||
ret = bdrv_create_file(filename, opts, &local_err);
|
||||
ret = bdrv_create_file(filename, opts, errp);
|
||||
if (ret < 0) {
|
||||
error_propagate(errp, local_err);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
blk = blk_new_open(filename, NULL, NULL,
|
||||
BDRV_O_RDWR | BDRV_O_RESIZE | BDRV_O_PROTOCOL,
|
||||
&local_err);
|
||||
errp);
|
||||
if (blk == NULL) {
|
||||
error_propagate(errp, local_err);
|
||||
ret = -EIO;
|
||||
goto exit;
|
||||
}
|
||||
|
|
19
block/vpc.c
19
block/vpc.c
|
@ -235,9 +235,7 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
}
|
||||
|
||||
opts = qemu_opts_create(&vpc_runtime_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!qemu_opts_absorb_qdict(opts, options, errp)) {
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
@ -448,9 +446,8 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
error_setg(&s->migration_blocker, "The vpc format used by node '%s' "
|
||||
"does not support live migration",
|
||||
bdrv_get_device_or_node_name(bs));
|
||||
ret = migrate_add_blocker(s->migration_blocker, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
ret = migrate_add_blocker(s->migration_blocker, errp);
|
||||
if (ret < 0) {
|
||||
error_free(s->migration_blocker);
|
||||
goto fail;
|
||||
}
|
||||
|
@ -1097,7 +1094,6 @@ static int coroutine_fn vpc_co_create_opts(BlockDriver *drv,
|
|||
QDict *qdict;
|
||||
Visitor *v;
|
||||
BlockDriverState *bs = NULL;
|
||||
Error *local_err = NULL;
|
||||
int ret;
|
||||
|
||||
static const QDictRenames opt_renames[] = {
|
||||
|
@ -1114,9 +1110,8 @@ static int coroutine_fn vpc_co_create_opts(BlockDriver *drv,
|
|||
}
|
||||
|
||||
/* Create and open the file (protocol layer) */
|
||||
ret = bdrv_create_file(filename, opts, &local_err);
|
||||
ret = bdrv_create_file(filename, opts, errp);
|
||||
if (ret < 0) {
|
||||
error_propagate(errp, local_err);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -1137,11 +1132,9 @@ static int coroutine_fn vpc_co_create_opts(BlockDriver *drv,
|
|||
goto fail;
|
||||
}
|
||||
|
||||
visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
|
||||
visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
|
||||
visit_free(v);
|
||||
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!create_options) {
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
|
|
@ -1141,7 +1141,6 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
bool floppy;
|
||||
const char *dirname, *label;
|
||||
QemuOpts *opts;
|
||||
Error *local_err = NULL;
|
||||
int ret;
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -1149,9 +1148,7 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
#endif
|
||||
|
||||
opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!qemu_opts_absorb_qdict(opts, options, errp)) {
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
@ -1269,9 +1266,8 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
"The vvfat (rw) format used by node '%s' "
|
||||
"does not support live migration",
|
||||
bdrv_get_device_or_node_name(bs));
|
||||
ret = migrate_add_blocker(s->migration_blocker, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
ret = migrate_add_blocker(s->migration_blocker, errp);
|
||||
if (ret < 0) {
|
||||
error_free(s->migration_blocker);
|
||||
goto fail;
|
||||
}
|
||||
|
|
15
block/vxhs.c
15
block/vxhs.c
|
@ -318,8 +318,7 @@ static int vxhs_open(BlockDriverState *bs, QDict *options,
|
|||
opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
|
||||
tcp_opts = qemu_opts_create(&runtime_tcp_opts, NULL, 0, &error_abort);
|
||||
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
if (!qemu_opts_absorb_qdict(opts, options, errp)) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
@ -327,14 +326,14 @@ static int vxhs_open(BlockDriverState *bs, QDict *options,
|
|||
/* vdisk-id is the disk UUID */
|
||||
vdisk_id_opt = qemu_opt_get(opts, VXHS_OPT_VDISK_ID);
|
||||
if (!vdisk_id_opt) {
|
||||
error_setg(&local_err, QERR_MISSING_PARAMETER, VXHS_OPT_VDISK_ID);
|
||||
error_setg(errp, QERR_MISSING_PARAMETER, VXHS_OPT_VDISK_ID);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* vdisk-id may contain a leading '/' */
|
||||
if (strlen(vdisk_id_opt) > UUID_FMT_LEN + 1) {
|
||||
error_setg(&local_err, "vdisk-id cannot be more than %d characters",
|
||||
error_setg(errp, "vdisk-id cannot be more than %d characters",
|
||||
UUID_FMT_LEN);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
|
@ -346,22 +345,21 @@ static int vxhs_open(BlockDriverState *bs, QDict *options,
|
|||
/* get the 'server.' arguments */
|
||||
qdict_extract_subqdict(options, &backing_options, VXHS_OPT_SERVER".");
|
||||
|
||||
qemu_opts_absorb_qdict(tcp_opts, backing_options, &local_err);
|
||||
if (local_err != NULL) {
|
||||
if (!qemu_opts_absorb_qdict(tcp_opts, backing_options, errp)) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
server_host_opt = qemu_opt_get(tcp_opts, VXHS_OPT_HOST);
|
||||
if (!server_host_opt) {
|
||||
error_setg(&local_err, QERR_MISSING_PARAMETER,
|
||||
error_setg(errp, QERR_MISSING_PARAMETER,
|
||||
VXHS_OPT_SERVER"."VXHS_OPT_HOST);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (strlen(server_host_opt) > MAXHOSTNAMELEN) {
|
||||
error_setg(&local_err, "server.host cannot be more than %d characters",
|
||||
error_setg(errp, "server.host cannot be more than %d characters",
|
||||
MAXHOSTNAMELEN);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
|
@ -414,7 +412,6 @@ out:
|
|||
|
||||
if (ret < 0) {
|
||||
vxhs_unref();
|
||||
error_propagate(errp, local_err);
|
||||
g_free(s->vdisk_hostinfo.host);
|
||||
g_free(s->vdisk_guid);
|
||||
g_free(s->tlscredsid);
|
||||
|
|
40
blockdev.c
40
blockdev.c
|
@ -504,15 +504,12 @@ static BlockBackend *blockdev_init(const char *file, QDict *bs_opts,
|
|||
/* Check common options by copying from bs_opts to opts, all other options
|
||||
* stay in bs_opts for processing by bdrv_open(). */
|
||||
id = qdict_get_try_str(bs_opts, "id");
|
||||
opts = qemu_opts_create(&qemu_common_drive_opts, id, 1, &error);
|
||||
if (error) {
|
||||
error_propagate(errp, error);
|
||||
opts = qemu_opts_create(&qemu_common_drive_opts, id, 1, errp);
|
||||
if (!opts) {
|
||||
goto err_no_opts;
|
||||
}
|
||||
|
||||
qemu_opts_absorb_qdict(opts, bs_opts, &error);
|
||||
if (error) {
|
||||
error_propagate(errp, error);
|
||||
if (!qemu_opts_absorb_qdict(opts, bs_opts, errp)) {
|
||||
goto early_err;
|
||||
}
|
||||
|
||||
|
@ -706,7 +703,7 @@ BlockDriverState *bdrv_next_monitor_owned(BlockDriverState *bs)
|
|||
: QTAILQ_FIRST(&monitor_bdrv_states);
|
||||
}
|
||||
|
||||
static void qemu_opt_rename(QemuOpts *opts, const char *from, const char *to,
|
||||
static bool qemu_opt_rename(QemuOpts *opts, const char *from, const char *to,
|
||||
Error **errp)
|
||||
{
|
||||
const char *value;
|
||||
|
@ -716,7 +713,7 @@ static void qemu_opt_rename(QemuOpts *opts, const char *from, const char *to,
|
|||
if (qemu_opt_find(opts, to)) {
|
||||
error_setg(errp, "'%s' and its alias '%s' can't be used at the "
|
||||
"same time", to, from);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -725,6 +722,7 @@ static void qemu_opt_rename(QemuOpts *opts, const char *from, const char *to,
|
|||
qemu_opt_set(opts, to, value, &error_abort);
|
||||
qemu_opt_unset(opts, from);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
QemuOptsList qemu_legacy_drive_opts = {
|
||||
|
@ -795,7 +793,6 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type,
|
|||
bool read_only = false;
|
||||
bool copy_on_read;
|
||||
const char *filename;
|
||||
Error *local_err = NULL;
|
||||
int i;
|
||||
|
||||
/* Change legacy command line options into QMP ones */
|
||||
|
@ -827,10 +824,8 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type,
|
|||
};
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(opt_renames); i++) {
|
||||
qemu_opt_rename(all_opts, opt_renames[i].from, opt_renames[i].to,
|
||||
&local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!qemu_opt_rename(all_opts, opt_renames[i].from,
|
||||
opt_renames[i].to, errp)) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -867,9 +862,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type,
|
|||
|
||||
legacy_opts = qemu_opts_create(&qemu_legacy_drive_opts, NULL, 0,
|
||||
&error_abort);
|
||||
qemu_opts_absorb_qdict(legacy_opts, bs_opts, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!qemu_opts_absorb_qdict(legacy_opts, bs_opts, errp)) {
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -1009,13 +1002,10 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type,
|
|||
}
|
||||
|
||||
/* Actual block device init: Functionality shared with blockdev-add */
|
||||
blk = blockdev_init(filename, bs_opts, &local_err);
|
||||
blk = blockdev_init(filename, bs_opts, errp);
|
||||
bs_opts = NULL;
|
||||
if (!blk) {
|
||||
error_propagate(errp, local_err);
|
||||
goto fail;
|
||||
} else {
|
||||
assert(!local_err);
|
||||
}
|
||||
|
||||
/* Create legacy DriveInfo */
|
||||
|
@ -3147,9 +3137,8 @@ void qmp_drive_mirror(DriveMirror *arg, Error **errp)
|
|||
arg->has_copy_mode, arg->copy_mode,
|
||||
arg->has_auto_finalize, arg->auto_finalize,
|
||||
arg->has_auto_dismiss, arg->auto_dismiss,
|
||||
&local_err);
|
||||
errp);
|
||||
bdrv_unref(target_bs);
|
||||
error_propagate(errp, local_err);
|
||||
out:
|
||||
aio_context_release(aio_context);
|
||||
}
|
||||
|
@ -3177,7 +3166,6 @@ void qmp_blockdev_mirror(bool has_job_id, const char *job_id,
|
|||
AioContext *aio_context;
|
||||
AioContext *old_context;
|
||||
BlockMirrorBackingMode backing_mode = MIRROR_LEAVE_BACKING_CHAIN;
|
||||
Error *local_err = NULL;
|
||||
bool zero_target;
|
||||
int ret;
|
||||
|
||||
|
@ -3219,8 +3207,7 @@ void qmp_blockdev_mirror(bool has_job_id, const char *job_id,
|
|||
has_copy_mode, copy_mode,
|
||||
has_auto_finalize, auto_finalize,
|
||||
has_auto_dismiss, auto_dismiss,
|
||||
&local_err);
|
||||
error_propagate(errp, local_err);
|
||||
errp);
|
||||
out:
|
||||
aio_context_release(aio_context);
|
||||
}
|
||||
|
@ -3439,8 +3426,7 @@ void qmp_change_backing_file(const char *device,
|
|||
}
|
||||
|
||||
if (ro) {
|
||||
bdrv_reopen_set_read_only(image_bs, true, &local_err);
|
||||
error_propagate(errp, local_err);
|
||||
bdrv_reopen_set_read_only(image_bs, true, errp);
|
||||
}
|
||||
|
||||
out:
|
||||
|
|
13
bootdevice.c
13
bootdevice.c
|
@ -297,22 +297,19 @@ static void device_set_bootindex(Object *obj, Visitor *v, const char *name,
|
|||
int32_t boot_index;
|
||||
Error *local_err = NULL;
|
||||
|
||||
visit_type_int32(v, name, &boot_index, &local_err);
|
||||
if (local_err) {
|
||||
goto out;
|
||||
if (!visit_type_int32(v, name, &boot_index, errp)) {
|
||||
return;
|
||||
}
|
||||
/* check whether bootindex is present in fw_boot_order list */
|
||||
check_boot_index(boot_index, &local_err);
|
||||
if (local_err) {
|
||||
goto out;
|
||||
error_propagate(errp, local_err);
|
||||
return;
|
||||
}
|
||||
/* change bootindex to a new one */
|
||||
*prop->bootindex = boot_index;
|
||||
|
||||
add_boot_device_path(*prop->bootindex, prop->dev, prop->suffix);
|
||||
|
||||
out:
|
||||
error_propagate(errp, local_err);
|
||||
}
|
||||
|
||||
static void property_release_bootindex(Object *obj, const char *name,
|
||||
|
@ -342,7 +339,7 @@ void device_add_bootindex_property(Object *obj, int32_t *bootindex,
|
|||
prop);
|
||||
|
||||
/* initialize devices' bootindex property to -1 */
|
||||
object_property_set_int(obj, -1, name, NULL);
|
||||
object_property_set_int(obj, name, -1, NULL);
|
||||
}
|
||||
|
||||
typedef struct FWLCHSEntry FWLCHSEntry;
|
||||
|
|
|
@ -444,8 +444,7 @@ QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename,
|
|||
qemu_opt_set(opts, "host", host, &error_abort);
|
||||
qemu_opt_set(opts, "port", port, &error_abort);
|
||||
if (p[pos] == ',') {
|
||||
qemu_opts_do_parse(opts, p+pos+1, NULL, &local_err);
|
||||
if (local_err) {
|
||||
if (!qemu_opts_do_parse(opts, p + pos + 1, NULL, &local_err)) {
|
||||
error_report_err(local_err);
|
||||
goto fail;
|
||||
}
|
||||
|
@ -484,8 +483,7 @@ QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename,
|
|||
}
|
||||
if (strstart(filename, "unix:", &p)) {
|
||||
qemu_opt_set(opts, "backend", "socket", &error_abort);
|
||||
qemu_opts_do_parse(opts, p, "path", &local_err);
|
||||
if (local_err) {
|
||||
if (!qemu_opts_do_parse(opts, p, "path", &local_err)) {
|
||||
error_report_err(local_err);
|
||||
goto fail;
|
||||
}
|
||||
|
|
|
@ -103,8 +103,8 @@ ivshmem_server_parse_args(IvshmemServerArgs *args, int argc, char *argv[])
|
|||
break;
|
||||
|
||||
case 'l': /* shm size */
|
||||
parse_option_size("shm_size", optarg, &args->shm_size, &err);
|
||||
if (err) {
|
||||
if (!parse_option_size("shm_size", optarg, &args->shm_size,
|
||||
&err)) {
|
||||
error_report_err(err);
|
||||
ivshmem_server_help(argv[0]);
|
||||
exit(1);
|
||||
|
|
|
@ -110,7 +110,7 @@ qcrypto_secret_prop_get_file(Object *obj,
|
|||
static void
|
||||
qcrypto_secret_complete(UserCreatable *uc, Error **errp)
|
||||
{
|
||||
object_property_set_bool(OBJECT(uc), true, "loaded", errp);
|
||||
object_property_set_bool(OBJECT(uc), "loaded", true, errp);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ qcrypto_secret_prop_get_key(Object *obj, Visitor *v,
|
|||
static void
|
||||
qcrypto_secret_keyring_complete(UserCreatable *uc, Error **errp)
|
||||
{
|
||||
object_property_set_bool(OBJECT(uc), true, "loaded", errp);
|
||||
object_property_set_bool(OBJECT(uc), "loaded", true, errp);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -165,7 +165,7 @@ qcrypto_tls_creds_anon_prop_get_loaded(Object *obj G_GNUC_UNUSED,
|
|||
static void
|
||||
qcrypto_tls_creds_anon_complete(UserCreatable *uc, Error **errp)
|
||||
{
|
||||
object_property_set_bool(OBJECT(uc), true, "loaded", errp);
|
||||
object_property_set_bool(OBJECT(uc), "loaded", true, errp);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -234,7 +234,7 @@ qcrypto_tls_creds_psk_prop_get_loaded(Object *obj G_GNUC_UNUSED,
|
|||
static void
|
||||
qcrypto_tls_creds_psk_complete(UserCreatable *uc, Error **errp)
|
||||
{
|
||||
object_property_set_bool(OBJECT(uc), true, "loaded", errp);
|
||||
object_property_set_bool(OBJECT(uc), "loaded", true, errp);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -774,7 +774,7 @@ qcrypto_tls_creds_x509_prop_get_sanity(Object *obj,
|
|||
static void
|
||||
qcrypto_tls_creds_x509_complete(UserCreatable *uc, Error **errp)
|
||||
{
|
||||
object_property_set_bool(OBJECT(uc), true, "loaded", errp);
|
||||
object_property_set_bool(OBJECT(uc), "loaded", true, errp);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1408,105 +1408,87 @@ Example:
|
|||
#include "example-qapi-types.h"
|
||||
|
||||
|
||||
void visit_type_UserDefOne_members(Visitor *v, UserDefOne *obj, Error **errp);
|
||||
void visit_type_UserDefOne(Visitor *v, const char *name, UserDefOne **obj, Error **errp);
|
||||
void visit_type_UserDefOneList(Visitor *v, const char *name, UserDefOneList **obj, Error **errp);
|
||||
bool visit_type_UserDefOne_members(Visitor *v, UserDefOne *obj, Error **errp);
|
||||
bool visit_type_UserDefOne(Visitor *v, const char *name, UserDefOne **obj, Error **errp);
|
||||
bool visit_type_UserDefOneList(Visitor *v, const char *name, UserDefOneList **obj, Error **errp);
|
||||
|
||||
void visit_type_q_obj_my_command_arg_members(Visitor *v, q_obj_my_command_arg *obj, Error **errp);
|
||||
bool visit_type_q_obj_my_command_arg_members(Visitor *v, q_obj_my_command_arg *obj, Error **errp);
|
||||
|
||||
#endif /* EXAMPLE_QAPI_VISIT_H */
|
||||
$ cat qapi-generated/example-qapi-visit.c
|
||||
[Uninteresting stuff omitted...]
|
||||
|
||||
void visit_type_UserDefOne_members(Visitor *v, UserDefOne *obj, Error **errp)
|
||||
bool visit_type_UserDefOne_members(Visitor *v, UserDefOne *obj, Error **errp)
|
||||
{
|
||||
Error *err = NULL;
|
||||
|
||||
visit_type_int(v, "integer", &obj->integer, &err);
|
||||
if (err) {
|
||||
goto out;
|
||||
if (!visit_type_int(v, "integer", &obj->integer, errp)) {
|
||||
return false;
|
||||
}
|
||||
if (visit_optional(v, "string", &obj->has_string)) {
|
||||
visit_type_str(v, "string", &obj->string, &err);
|
||||
if (err) {
|
||||
goto out;
|
||||
if (!visit_type_str(v, "string", &obj->string, errp)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
error_propagate(errp, err);
|
||||
return true;
|
||||
}
|
||||
|
||||
void visit_type_UserDefOne(Visitor *v, const char *name, UserDefOne **obj, Error **errp)
|
||||
bool visit_type_UserDefOne(Visitor *v, const char *name, UserDefOne **obj, Error **errp)
|
||||
{
|
||||
Error *err = NULL;
|
||||
bool ok = false;
|
||||
|
||||
visit_start_struct(v, name, (void **)obj, sizeof(UserDefOne), &err);
|
||||
if (err) {
|
||||
goto out;
|
||||
if (!visit_start_struct(v, name, (void **)obj, sizeof(UserDefOne), errp)) {
|
||||
return false;
|
||||
}
|
||||
if (!*obj) {
|
||||
/* incomplete */
|
||||
assert(visit_is_dealloc(v));
|
||||
goto out_obj;
|
||||
}
|
||||
visit_type_UserDefOne_members(v, *obj, &err);
|
||||
if (err) {
|
||||
if (!visit_type_UserDefOne_members(v, *obj, errp)) {
|
||||
goto out_obj;
|
||||
}
|
||||
visit_check_struct(v, &err);
|
||||
ok = visit_check_struct(v, errp);
|
||||
out_obj:
|
||||
visit_end_struct(v, (void **)obj);
|
||||
if (err && visit_is_input(v)) {
|
||||
if (!ok && visit_is_input(v)) {
|
||||
qapi_free_UserDefOne(*obj);
|
||||
*obj = NULL;
|
||||
}
|
||||
out:
|
||||
error_propagate(errp, err);
|
||||
return ok;
|
||||
}
|
||||
|
||||
void visit_type_UserDefOneList(Visitor *v, const char *name, UserDefOneList **obj, Error **errp)
|
||||
bool visit_type_UserDefOneList(Visitor *v, const char *name, UserDefOneList **obj, Error **errp)
|
||||
{
|
||||
Error *err = NULL;
|
||||
bool ok = false;
|
||||
UserDefOneList *tail;
|
||||
size_t size = sizeof(**obj);
|
||||
|
||||
visit_start_list(v, name, (GenericList **)obj, size, &err);
|
||||
if (err) {
|
||||
goto out;
|
||||
if (!visit_start_list(v, name, (GenericList **)obj, size, errp)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (tail = *obj; tail;
|
||||
tail = (UserDefOneList *)visit_next_list(v, (GenericList *)tail, size)) {
|
||||
visit_type_UserDefOne(v, NULL, &tail->value, &err);
|
||||
if (err) {
|
||||
break;
|
||||
if (!visit_type_UserDefOne(v, NULL, &tail->value, errp)) {
|
||||
goto out_obj;
|
||||
}
|
||||
}
|
||||
|
||||
if (!err) {
|
||||
visit_check_list(v, &err);
|
||||
}
|
||||
ok = visit_check_list(v, errp);
|
||||
out_obj:
|
||||
visit_end_list(v, (void **)obj);
|
||||
if (err && visit_is_input(v)) {
|
||||
if (!ok && visit_is_input(v)) {
|
||||
qapi_free_UserDefOneList(*obj);
|
||||
*obj = NULL;
|
||||
}
|
||||
out:
|
||||
error_propagate(errp, err);
|
||||
return ok;
|
||||
}
|
||||
|
||||
void visit_type_q_obj_my_command_arg_members(Visitor *v, q_obj_my_command_arg *obj, Error **errp)
|
||||
bool visit_type_q_obj_my_command_arg_members(Visitor *v, q_obj_my_command_arg *obj, Error **errp)
|
||||
{
|
||||
Error *err = NULL;
|
||||
|
||||
visit_type_UserDefOneList(v, "arg1", &obj->arg1, &err);
|
||||
if (err) {
|
||||
goto out;
|
||||
if (!visit_type_UserDefOneList(v, "arg1", &obj->arg1, errp)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
out:
|
||||
error_propagate(errp, err);
|
||||
return true;
|
||||
}
|
||||
|
||||
[Uninteresting stuff omitted...]
|
||||
|
@ -1561,15 +1543,12 @@ Example:
|
|||
|
||||
static void qmp_marshal_output_UserDefOne(UserDefOne *ret_in, QObject **ret_out, Error **errp)
|
||||
{
|
||||
Error *err = NULL;
|
||||
Visitor *v;
|
||||
|
||||
v = qobject_output_visitor_new(ret_out);
|
||||
visit_type_UserDefOne(v, "unused", &ret_in, &err);
|
||||
if (!err) {
|
||||
if (visit_type_UserDefOne(v, "unused", &ret_in, errp)) {
|
||||
visit_complete(v, ret_out);
|
||||
}
|
||||
error_propagate(errp, err);
|
||||
visit_free(v);
|
||||
v = qapi_dealloc_visitor_new();
|
||||
visit_type_UserDefOne(v, "unused", &ret_in, NULL);
|
||||
|
@ -1579,33 +1558,32 @@ Example:
|
|||
void qmp_marshal_my_command(QDict *args, QObject **ret, Error **errp)
|
||||
{
|
||||
Error *err = NULL;
|
||||
bool ok = false;
|
||||
Visitor *v;
|
||||
UserDefOne *retval;
|
||||
q_obj_my_command_arg arg = {0};
|
||||
|
||||
v = qobject_input_visitor_new(QOBJECT(args));
|
||||
visit_start_struct(v, NULL, NULL, 0, &err);
|
||||
if (err) {
|
||||
if (!visit_start_struct(v, NULL, NULL, 0, errp)) {
|
||||
goto out;
|
||||
}
|
||||
visit_type_q_obj_my_command_arg_members(v, &arg, &err);
|
||||
if (!err) {
|
||||
visit_check_struct(v, &err);
|
||||
if (visit_type_q_obj_my_command_arg_members(v, &arg, errp)) {
|
||||
ok = visit_check_struct(v, errp);
|
||||
}
|
||||
visit_end_struct(v, NULL);
|
||||
if (err) {
|
||||
if (!ok) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
retval = qmp_my_command(arg.arg1, &err);
|
||||
error_propagate(errp, err);
|
||||
if (err) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
qmp_marshal_output_UserDefOne(retval, ret, &err);
|
||||
qmp_marshal_output_UserDefOne(retval, ret, errp);
|
||||
|
||||
out:
|
||||
error_propagate(errp, err);
|
||||
visit_free(v);
|
||||
v = qapi_dealloc_visitor_new();
|
||||
visit_start_struct(v, NULL, NULL, 0, NULL);
|
||||
|
@ -1613,6 +1591,7 @@ Example:
|
|||
visit_end_struct(v, NULL);
|
||||
visit_free(v);
|
||||
}
|
||||
|
||||
[Uninteresting stuff omitted...]
|
||||
$ cat qapi-generated/example-qapi-init-commands.h
|
||||
[Uninteresting stuff omitted...]
|
||||
|
|
|
@ -1031,14 +1031,11 @@ out:
|
|||
|
||||
static void write_dump_header(DumpState *s, Error **errp)
|
||||
{
|
||||
Error *local_err = NULL;
|
||||
|
||||
if (s->dump_info.d_class == ELFCLASS32) {
|
||||
create_header32(s, &local_err);
|
||||
create_header32(s, errp);
|
||||
} else {
|
||||
create_header64(s, &local_err);
|
||||
create_header64(s, errp);
|
||||
}
|
||||
error_propagate(errp, local_err);
|
||||
}
|
||||
|
||||
static size_t dump_bitmap_get_bufsize(DumpState *s)
|
||||
|
|
|
@ -1479,10 +1479,10 @@ static void error_append_security_model_hint(Error *const *errp)
|
|||
|
||||
static int local_parse_opts(QemuOpts *opts, FsDriverEntry *fse, Error **errp)
|
||||
{
|
||||
ERRP_GUARD();
|
||||
const char *sec_model = qemu_opt_get(opts, "security_model");
|
||||
const char *path = qemu_opt_get(opts, "path");
|
||||
const char *multidevs = qemu_opt_get(opts, "multidevs");
|
||||
Error *local_err = NULL;
|
||||
|
||||
if (!sec_model) {
|
||||
error_setg(errp, "security_model property not set");
|
||||
|
@ -1516,11 +1516,10 @@ static int local_parse_opts(QemuOpts *opts, FsDriverEntry *fse, Error **errp)
|
|||
fse->export_flags &= ~V9FS_FORBID_MULTIDEVS;
|
||||
fse->export_flags &= ~V9FS_REMAP_INODES;
|
||||
} else {
|
||||
error_setg(&local_err, "invalid multidevs property '%s'",
|
||||
error_setg(errp, "invalid multidevs property '%s'",
|
||||
multidevs);
|
||||
error_append_hint(&local_err, "Valid options are: multidevs="
|
||||
error_append_hint(errp, "Valid options are: multidevs="
|
||||
"[remap|forbid|warn]\n");
|
||||
error_propagate(errp, local_err);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@ -1530,9 +1529,8 @@ static int local_parse_opts(QemuOpts *opts, FsDriverEntry *fse, Error **errp)
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (fsdev_throttle_parse_opts(opts, &fse->fst, &local_err)) {
|
||||
error_propagate_prepend(errp, local_err,
|
||||
"invalid throttle configuration: ");
|
||||
if (fsdev_throttle_parse_opts(opts, &fse->fst, errp)) {
|
||||
error_prepend(errp, "invalid throttle configuration: ");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -4011,6 +4011,7 @@ void pdu_submit(V9fsPDU *pdu, P9MsgHeader *hdr)
|
|||
int v9fs_device_realize_common(V9fsState *s, const V9fsTransport *t,
|
||||
Error **errp)
|
||||
{
|
||||
ERRP_GUARD();
|
||||
int i, len;
|
||||
struct stat stat;
|
||||
FsDriverEntry *fse;
|
||||
|
|
|
@ -239,7 +239,6 @@ static void acpi_table_install(const char unsigned *blob, size_t bloblen,
|
|||
void acpi_table_add(const QemuOpts *opts, Error **errp)
|
||||
{
|
||||
AcpiTableOptions *hdrs = NULL;
|
||||
Error *err = NULL;
|
||||
char **pathnames = NULL;
|
||||
char **cur;
|
||||
size_t bloblen = 0;
|
||||
|
@ -249,21 +248,21 @@ void acpi_table_add(const QemuOpts *opts, Error **errp)
|
|||
Visitor *v;
|
||||
|
||||
v = opts_visitor_new(opts);
|
||||
visit_type_AcpiTableOptions(v, NULL, &hdrs, &err);
|
||||
visit_type_AcpiTableOptions(v, NULL, &hdrs, errp);
|
||||
visit_free(v);
|
||||
}
|
||||
|
||||
if (err) {
|
||||
if (!hdrs) {
|
||||
goto out;
|
||||
}
|
||||
if (hdrs->has_file == hdrs->has_data) {
|
||||
error_setg(&err, "'-acpitable' requires one of 'data' or 'file'");
|
||||
error_setg(errp, "'-acpitable' requires one of 'data' or 'file'");
|
||||
goto out;
|
||||
}
|
||||
|
||||
pathnames = g_strsplit(hdrs->has_file ? hdrs->file : hdrs->data, ":", 0);
|
||||
if (pathnames == NULL || pathnames[0] == NULL) {
|
||||
error_setg(&err, "'-acpitable' requires at least one pathname");
|
||||
error_setg(errp, "'-acpitable' requires at least one pathname");
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -272,7 +271,7 @@ void acpi_table_add(const QemuOpts *opts, Error **errp)
|
|||
int fd = open(*cur, O_RDONLY | O_BINARY);
|
||||
|
||||
if (fd < 0) {
|
||||
error_setg(&err, "can't open file %s: %s", *cur, strerror(errno));
|
||||
error_setg(errp, "can't open file %s: %s", *cur, strerror(errno));
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -288,8 +287,8 @@ void acpi_table_add(const QemuOpts *opts, Error **errp)
|
|||
memcpy(blob + bloblen, data, r);
|
||||
bloblen += r;
|
||||
} else if (errno != EINTR) {
|
||||
error_setg(&err, "can't read file %s: %s",
|
||||
*cur, strerror(errno));
|
||||
error_setg(errp, "can't read file %s: %s", *cur,
|
||||
strerror(errno));
|
||||
close(fd);
|
||||
goto out;
|
||||
}
|
||||
|
@ -298,14 +297,12 @@ void acpi_table_add(const QemuOpts *opts, Error **errp)
|
|||
close(fd);
|
||||
}
|
||||
|
||||
acpi_table_install(blob, bloblen, hdrs->has_file, hdrs, &err);
|
||||
acpi_table_install(blob, bloblen, hdrs->has_file, hdrs, errp);
|
||||
|
||||
out:
|
||||
g_free(blob);
|
||||
g_strfreev(pathnames);
|
||||
qapi_free_AcpiTableOptions(hdrs);
|
||||
|
||||
error_propagate(errp, err);
|
||||
}
|
||||
|
||||
unsigned acpi_table_len(void *current)
|
||||
|
|
|
@ -41,7 +41,7 @@ static void cpu_status_write(void *opaque, hwaddr addr, uint64_t data,
|
|||
*/
|
||||
if (addr == 0 && data == 0) {
|
||||
AcpiCpuHotplug *cpus = opaque;
|
||||
object_property_set_bool(cpus->device, false, "cpu-hotplug-legacy",
|
||||
object_property_set_bool(cpus->device, "cpu-hotplug-legacy", false,
|
||||
&error_abort);
|
||||
}
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ static void acpi_set_cpu_present_bit(AcpiCpuHotplug *g, CPUState *cpu)
|
|||
|
||||
cpu_id = k->get_arch_id(cpu);
|
||||
if ((cpu_id / 8) >= ACPI_GPE_PROC_LEN) {
|
||||
object_property_set_bool(g->device, false, "cpu-hotplug-legacy",
|
||||
object_property_set_bool(g->device, "cpu-hotplug-legacy", false,
|
||||
&error_abort);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -201,7 +201,7 @@ static int vmstate_cpuhp_pre_load(void *opaque)
|
|||
{
|
||||
ICH9LPCPMRegs *s = opaque;
|
||||
Object *obj = OBJECT(s->gpe_cpu.device);
|
||||
object_property_set_bool(obj, false, "cpu-hotplug-legacy", &error_abort);
|
||||
object_property_set_bool(obj, "cpu-hotplug-legacy", false, &error_abort);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -244,7 +244,7 @@ static bool vmstate_test_use_cpuhp(void *opaque)
|
|||
static int vmstate_cpuhp_pre_load(void *opaque)
|
||||
{
|
||||
Object *obj = OBJECT(opaque);
|
||||
object_property_set_bool(obj, false, "cpu-hotplug-legacy", &error_abort);
|
||||
object_property_set_bool(obj, "cpu-hotplug-legacy", false, &error_abort);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -72,17 +72,12 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)
|
|||
{
|
||||
AwA10State *s = AW_A10(dev);
|
||||
SysBusDevice *sysbusdev;
|
||||
Error *err = NULL;
|
||||
|
||||
qdev_realize(DEVICE(&s->cpu), NULL, &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!qdev_realize(DEVICE(&s->cpu), NULL, errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->intc), &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->intc), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbusdev = SYS_BUS_DEVICE(&s->intc);
|
||||
|
@ -93,9 +88,7 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)
|
|||
qdev_get_gpio_in(DEVICE(&s->cpu), ARM_CPU_FIQ));
|
||||
qdev_pass_gpios(DEVICE(&s->intc), dev, NULL);
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->timer), &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->timer), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbusdev = SYS_BUS_DEVICE(&s->timer);
|
||||
|
@ -117,18 +110,14 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)
|
|||
qemu_check_nic_model(&nd_table[0], TYPE_AW_EMAC);
|
||||
qdev_set_nic_properties(DEVICE(&s->emac), &nd_table[0]);
|
||||
}
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->emac), &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->emac), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbusdev = SYS_BUS_DEVICE(&s->emac);
|
||||
sysbus_mmio_map(sysbusdev, 0, AW_A10_EMAC_BASE);
|
||||
sysbus_connect_irq(sysbusdev, 0, qdev_get_gpio_in(dev, 55));
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->sata), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->sata), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->sata), 0, AW_A10_SATA_BASE);
|
||||
|
@ -147,15 +136,15 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)
|
|||
|
||||
sprintf(bus, "usb-bus.%d", i);
|
||||
|
||||
object_property_set_bool(OBJECT(&s->ehci[i]), true,
|
||||
"companion-enable", &error_fatal);
|
||||
object_property_set_bool(OBJECT(&s->ehci[i]), "companion-enable",
|
||||
true, &error_fatal);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->ehci[i]), &error_fatal);
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->ehci[i]), 0,
|
||||
AW_A10_EHCI_BASE + i * 0x8000);
|
||||
sysbus_connect_irq(SYS_BUS_DEVICE(&s->ehci[i]), 0,
|
||||
qdev_get_gpio_in(dev, 39 + i));
|
||||
|
||||
object_property_set_str(OBJECT(&s->ohci[i]), bus, "masterbus",
|
||||
object_property_set_str(OBJECT(&s->ohci[i]), "masterbus", bus,
|
||||
&error_fatal);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->ohci[i]), &error_fatal);
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->ohci[i]), 0,
|
||||
|
|
208
hw/arm/armsse.c
208
hw/arm/armsse.c
|
@ -534,23 +534,18 @@ static void armsse_realize(DeviceState *dev, Error **errp)
|
|||
* later if necessary.
|
||||
*/
|
||||
if (extract32(info->cpuwait_rst, i, 1)) {
|
||||
object_property_set_bool(cpuobj, true, "start-powered-off", &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_bool(cpuobj, "start-powered-off", true,
|
||||
errp)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!s->cpu_fpu[i]) {
|
||||
object_property_set_bool(cpuobj, false, "vfp", &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_bool(cpuobj, "vfp", false, errp)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!s->cpu_dsp[i]) {
|
||||
object_property_set_bool(cpuobj, false, "dsp", &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_bool(cpuobj, "dsp", false, errp)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -562,12 +557,10 @@ static void armsse_realize(DeviceState *dev, Error **errp)
|
|||
memory_region_add_subregion_overlap(&s->cpu_container[i], 0,
|
||||
&s->container, -1);
|
||||
}
|
||||
object_property_set_link(cpuobj, OBJECT(&s->cpu_container[i]),
|
||||
"memory", &error_abort);
|
||||
object_property_set_link(cpuobj, OBJECT(s), "idau", &error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(cpuobj), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
object_property_set_link(cpuobj, "memory",
|
||||
OBJECT(&s->cpu_container[i]), &error_abort);
|
||||
object_property_set_link(cpuobj, "idau", OBJECT(s), &error_abort);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(cpuobj), errp)) {
|
||||
return;
|
||||
}
|
||||
/*
|
||||
|
@ -576,9 +569,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
|
|||
* CPU must exist and have been parented into the cluster before
|
||||
* the cluster is realized.
|
||||
*/
|
||||
qdev_realize(DEVICE(&s->cluster[i]), NULL, &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!qdev_realize(DEVICE(&s->cluster[i]), NULL, errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -606,15 +597,11 @@ static void armsse_realize(DeviceState *dev, Error **errp)
|
|||
DeviceState *devs = DEVICE(splitter);
|
||||
int cpunum;
|
||||
|
||||
object_property_set_int(splitter, info->num_cpus,
|
||||
"num-lines", &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_int(splitter, "num-lines",
|
||||
info->num_cpus, errp)) {
|
||||
return;
|
||||
}
|
||||
qdev_realize(DEVICE(splitter), NULL, &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!qdev_realize(DEVICE(splitter), NULL, errp)) {
|
||||
return;
|
||||
}
|
||||
for (cpunum = 0; cpunum < info->num_cpus; cpunum++) {
|
||||
|
@ -645,9 +632,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
|
|||
}
|
||||
|
||||
/* Security controller */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->secctl), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->secctl), errp)) {
|
||||
return;
|
||||
}
|
||||
sbd_secctl = SYS_BUS_DEVICE(&s->secctl);
|
||||
|
@ -662,15 +647,11 @@ static void armsse_realize(DeviceState *dev, Error **errp)
|
|||
* multiple lines, one for each of the PPCs within the ARMSSE and one
|
||||
* that will be an output from the ARMSSE to the system.
|
||||
*/
|
||||
object_property_set_int(OBJECT(&s->sec_resp_splitter), 3,
|
||||
"num-lines", &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_int(OBJECT(&s->sec_resp_splitter),
|
||||
"num-lines", 3, errp)) {
|
||||
return;
|
||||
}
|
||||
qdev_realize(DEVICE(&s->sec_resp_splitter), NULL, &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!qdev_realize(DEVICE(&s->sec_resp_splitter), NULL, errp)) {
|
||||
return;
|
||||
}
|
||||
dev_splitter = DEVICE(&s->sec_resp_splitter);
|
||||
|
@ -690,11 +671,9 @@ static void armsse_realize(DeviceState *dev, Error **errp)
|
|||
error_propagate(errp, err);
|
||||
return;
|
||||
}
|
||||
object_property_set_link(OBJECT(&s->mpc[i]), OBJECT(&s->sram[i]),
|
||||
"downstream", &error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->mpc[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
object_property_set_link(OBJECT(&s->mpc[i]), "downstream",
|
||||
OBJECT(&s->sram[i]), &error_abort);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->mpc[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
/* Map the upstream end of the MPC into the right place... */
|
||||
|
@ -708,16 +687,12 @@ static void armsse_realize(DeviceState *dev, Error **errp)
|
|||
}
|
||||
|
||||
/* We must OR together lines from the MPC splitters to go to the NVIC */
|
||||
object_property_set_int(OBJECT(&s->mpc_irq_orgate),
|
||||
IOTS_NUM_EXP_MPC + info->sram_banks,
|
||||
"num-lines", &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_int(OBJECT(&s->mpc_irq_orgate), "num-lines",
|
||||
IOTS_NUM_EXP_MPC + info->sram_banks,
|
||||
errp)) {
|
||||
return;
|
||||
}
|
||||
qdev_realize(DEVICE(&s->mpc_irq_orgate), NULL, &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!qdev_realize(DEVICE(&s->mpc_irq_orgate), NULL, errp)) {
|
||||
return;
|
||||
}
|
||||
qdev_connect_gpio_out(DEVICE(&s->mpc_irq_orgate), 0,
|
||||
|
@ -734,39 +709,33 @@ static void armsse_realize(DeviceState *dev, Error **errp)
|
|||
* map its upstream ends to the right place in the container.
|
||||
*/
|
||||
qdev_prop_set_uint32(DEVICE(&s->timer0), "pclk-frq", s->mainclk_frq);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->timer0), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->timer0), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_connect_irq(SYS_BUS_DEVICE(&s->timer0), 0,
|
||||
armsse_get_common_irq_in(s, 3));
|
||||
mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->timer0), 0);
|
||||
object_property_set_link(OBJECT(&s->apb_ppc0), OBJECT(mr), "port[0]",
|
||||
object_property_set_link(OBJECT(&s->apb_ppc0), "port[0]", OBJECT(mr),
|
||||
&error_abort);
|
||||
|
||||
qdev_prop_set_uint32(DEVICE(&s->timer1), "pclk-frq", s->mainclk_frq);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->timer1), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->timer1), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_connect_irq(SYS_BUS_DEVICE(&s->timer1), 0,
|
||||
armsse_get_common_irq_in(s, 4));
|
||||
mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->timer1), 0);
|
||||
object_property_set_link(OBJECT(&s->apb_ppc0), OBJECT(mr), "port[1]",
|
||||
object_property_set_link(OBJECT(&s->apb_ppc0), "port[1]", OBJECT(mr),
|
||||
&error_abort);
|
||||
|
||||
qdev_prop_set_uint32(DEVICE(&s->dualtimer), "pclk-frq", s->mainclk_frq);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->dualtimer), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->dualtimer), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_connect_irq(SYS_BUS_DEVICE(&s->dualtimer), 0,
|
||||
armsse_get_common_irq_in(s, 5));
|
||||
mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->dualtimer), 0);
|
||||
object_property_set_link(OBJECT(&s->apb_ppc0), OBJECT(mr), "port[2]",
|
||||
object_property_set_link(OBJECT(&s->apb_ppc0), "port[2]", OBJECT(mr),
|
||||
&error_abort);
|
||||
|
||||
if (info->has_mhus) {
|
||||
|
@ -784,15 +753,13 @@ static void armsse_realize(DeviceState *dev, Error **errp)
|
|||
int cpunum;
|
||||
SysBusDevice *mhu_sbd = SYS_BUS_DEVICE(&s->mhu[i]);
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->mhu[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->mhu[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
port = g_strdup_printf("port[%d]", i + 3);
|
||||
mr = sysbus_mmio_get_region(mhu_sbd, 0);
|
||||
object_property_set_link(OBJECT(&s->apb_ppc0), OBJECT(mr),
|
||||
port, &error_abort);
|
||||
object_property_set_link(OBJECT(&s->apb_ppc0), port, OBJECT(mr),
|
||||
&error_abort);
|
||||
g_free(port);
|
||||
|
||||
/*
|
||||
|
@ -811,9 +778,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
|
|||
}
|
||||
}
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->apb_ppc0), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->apb_ppc0), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -854,15 +819,11 @@ static void armsse_realize(DeviceState *dev, Error **errp)
|
|||
* ones) are sent individually to the security controller, and also
|
||||
* ORed together to give a single combined PPC interrupt to the NVIC.
|
||||
*/
|
||||
object_property_set_int(OBJECT(&s->ppc_irq_orgate),
|
||||
NUM_PPCS, "num-lines", &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_int(OBJECT(&s->ppc_irq_orgate),
|
||||
"num-lines", NUM_PPCS, errp)) {
|
||||
return;
|
||||
}
|
||||
qdev_realize(DEVICE(&s->ppc_irq_orgate), NULL, &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!qdev_realize(DEVICE(&s->ppc_irq_orgate), NULL, errp)) {
|
||||
return;
|
||||
}
|
||||
qdev_connect_gpio_out(DEVICE(&s->ppc_irq_orgate), 0,
|
||||
|
@ -883,9 +844,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
|
|||
qdev_prop_set_string(DEVICE(&s->cachectrl[i]), "name", name);
|
||||
g_free(name);
|
||||
qdev_prop_set_uint64(DEVICE(&s->cachectrl[i]), "size", 0x1000);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->cachectrl[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->cachectrl[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -901,9 +860,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
|
|||
qdev_prop_set_string(DEVICE(&s->cpusecctrl[i]), "name", name);
|
||||
g_free(name);
|
||||
qdev_prop_set_uint64(DEVICE(&s->cpusecctrl[i]), "size", 0x1000);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->cpusecctrl[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->cpusecctrl[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -916,9 +873,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
|
|||
MemoryRegion *mr;
|
||||
|
||||
qdev_prop_set_uint32(DEVICE(&s->cpuid[i]), "CPUID", i);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->cpuid[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->cpuid[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -932,20 +887,16 @@ static void armsse_realize(DeviceState *dev, Error **errp)
|
|||
* 0x4002f000: S32K timer
|
||||
*/
|
||||
qdev_prop_set_uint32(DEVICE(&s->s32ktimer), "pclk-frq", S32KCLK);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->s32ktimer), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->s32ktimer), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_connect_irq(SYS_BUS_DEVICE(&s->s32ktimer), 0,
|
||||
armsse_get_common_irq_in(s, 2));
|
||||
mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->s32ktimer), 0);
|
||||
object_property_set_link(OBJECT(&s->apb_ppc1), OBJECT(mr), "port[0]",
|
||||
object_property_set_link(OBJECT(&s->apb_ppc1), "port[0]", OBJECT(mr),
|
||||
&error_abort);
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->apb_ppc1), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->apb_ppc1), errp)) {
|
||||
return;
|
||||
}
|
||||
mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->apb_ppc1), 0);
|
||||
|
@ -968,38 +919,29 @@ static void armsse_realize(DeviceState *dev, Error **errp)
|
|||
qdev_get_gpio_in_named(dev_apb_ppc1,
|
||||
"cfg_sec_resp", 0));
|
||||
|
||||
object_property_set_int(OBJECT(&s->sysinfo), info->sys_version,
|
||||
"SYS_VERSION", &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_int(OBJECT(&s->sysinfo), "SYS_VERSION",
|
||||
info->sys_version, errp)) {
|
||||
return;
|
||||
}
|
||||
object_property_set_int(OBJECT(&s->sysinfo),
|
||||
armsse_sys_config_value(s, info),
|
||||
"SYS_CONFIG", &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_int(OBJECT(&s->sysinfo), "SYS_CONFIG",
|
||||
armsse_sys_config_value(s, info), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->sysinfo), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->sysinfo), errp)) {
|
||||
return;
|
||||
}
|
||||
/* System information registers */
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->sysinfo), 0, 0x40020000);
|
||||
/* System control registers */
|
||||
object_property_set_int(OBJECT(&s->sysctl), info->sys_version,
|
||||
"SYS_VERSION", &error_abort);
|
||||
object_property_set_int(OBJECT(&s->sysctl), info->cpuwait_rst,
|
||||
"CPUWAIT_RST", &error_abort);
|
||||
object_property_set_int(OBJECT(&s->sysctl), s->init_svtor,
|
||||
"INITSVTOR0_RST", &error_abort);
|
||||
object_property_set_int(OBJECT(&s->sysctl), s->init_svtor,
|
||||
"INITSVTOR1_RST", &error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->sysctl), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
object_property_set_int(OBJECT(&s->sysctl), "SYS_VERSION",
|
||||
info->sys_version, &error_abort);
|
||||
object_property_set_int(OBJECT(&s->sysctl), "CPUWAIT_RST",
|
||||
info->cpuwait_rst, &error_abort);
|
||||
object_property_set_int(OBJECT(&s->sysctl), "INITSVTOR0_RST",
|
||||
s->init_svtor, &error_abort);
|
||||
object_property_set_int(OBJECT(&s->sysctl), "INITSVTOR1_RST",
|
||||
s->init_svtor, &error_abort);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->sysctl), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->sysctl), 0, 0x50021000);
|
||||
|
@ -1027,23 +969,18 @@ static void armsse_realize(DeviceState *dev, Error **errp)
|
|||
}
|
||||
|
||||
/* This OR gate wires together outputs from the secure watchdogs to NMI */
|
||||
object_property_set_int(OBJECT(&s->nmi_orgate), 2, "num-lines", &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_int(OBJECT(&s->nmi_orgate), "num-lines", 2,
|
||||
errp)) {
|
||||
return;
|
||||
}
|
||||
qdev_realize(DEVICE(&s->nmi_orgate), NULL, &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!qdev_realize(DEVICE(&s->nmi_orgate), NULL, errp)) {
|
||||
return;
|
||||
}
|
||||
qdev_connect_gpio_out(DEVICE(&s->nmi_orgate), 0,
|
||||
qdev_get_gpio_in_named(DEVICE(&s->armv7m), "NMI", 0));
|
||||
|
||||
qdev_prop_set_uint32(DEVICE(&s->s32kwatchdog), "wdogclk-frq", S32KCLK);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->s32kwatchdog), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->s32kwatchdog), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_connect_irq(SYS_BUS_DEVICE(&s->s32kwatchdog), 0,
|
||||
|
@ -1053,9 +990,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
|
|||
/* 0x40080000 .. 0x4008ffff : ARMSSE second Base peripheral region */
|
||||
|
||||
qdev_prop_set_uint32(DEVICE(&s->nswatchdog), "wdogclk-frq", s->mainclk_frq);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->nswatchdog), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->nswatchdog), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_connect_irq(SYS_BUS_DEVICE(&s->nswatchdog), 0,
|
||||
|
@ -1063,9 +998,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
|
|||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->nswatchdog), 0, 0x40081000);
|
||||
|
||||
qdev_prop_set_uint32(DEVICE(&s->swatchdog), "wdogclk-frq", s->mainclk_frq);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->swatchdog), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->swatchdog), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_connect_irq(SYS_BUS_DEVICE(&s->swatchdog), 0,
|
||||
|
@ -1075,14 +1008,10 @@ static void armsse_realize(DeviceState *dev, Error **errp)
|
|||
for (i = 0; i < ARRAY_SIZE(s->ppc_irq_splitter); i++) {
|
||||
Object *splitter = OBJECT(&s->ppc_irq_splitter[i]);
|
||||
|
||||
object_property_set_int(splitter, 2, "num-lines", &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_int(splitter, "num-lines", 2, errp)) {
|
||||
return;
|
||||
}
|
||||
qdev_realize(DEVICE(splitter), NULL, &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!qdev_realize(DEVICE(splitter), NULL, errp)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1122,14 +1051,11 @@ static void armsse_realize(DeviceState *dev, Error **errp)
|
|||
SplitIRQ *splitter = &s->mpc_irq_splitter[i];
|
||||
DeviceState *dev_splitter = DEVICE(splitter);
|
||||
|
||||
object_property_set_int(OBJECT(splitter), 2, "num-lines", &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_int(OBJECT(splitter), "num-lines", 2,
|
||||
errp)) {
|
||||
return;
|
||||
}
|
||||
qdev_realize(DEVICE(splitter), NULL, &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!qdev_realize(DEVICE(splitter), NULL, errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -167,41 +167,31 @@ static void armv7m_realize(DeviceState *dev, Error **errp)
|
|||
return;
|
||||
}
|
||||
|
||||
object_property_set_link(OBJECT(s->cpu), OBJECT(&s->container), "memory",
|
||||
object_property_set_link(OBJECT(s->cpu), "memory", OBJECT(&s->container),
|
||||
&error_abort);
|
||||
if (object_property_find(OBJECT(s->cpu), "idau", NULL)) {
|
||||
object_property_set_link(OBJECT(s->cpu), s->idau, "idau",
|
||||
object_property_set_link(OBJECT(s->cpu), "idau", s->idau,
|
||||
&error_abort);
|
||||
}
|
||||
if (object_property_find(OBJECT(s->cpu), "init-svtor", NULL)) {
|
||||
object_property_set_uint(OBJECT(s->cpu), s->init_svtor,
|
||||
"init-svtor", &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_uint(OBJECT(s->cpu), "init-svtor",
|
||||
s->init_svtor, errp)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (object_property_find(OBJECT(s->cpu), "start-powered-off", NULL)) {
|
||||
object_property_set_bool(OBJECT(s->cpu), s->start_powered_off,
|
||||
"start-powered-off", &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_bool(OBJECT(s->cpu), "start-powered-off",
|
||||
s->start_powered_off, errp)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (object_property_find(OBJECT(s->cpu), "vfp", NULL)) {
|
||||
object_property_set_bool(OBJECT(s->cpu), s->vfp,
|
||||
"vfp", &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_bool(OBJECT(s->cpu), "vfp", s->vfp, errp)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (object_property_find(OBJECT(s->cpu), "dsp", NULL)) {
|
||||
object_property_set_bool(OBJECT(s->cpu), s->dsp,
|
||||
"dsp", &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_bool(OBJECT(s->cpu), "dsp", s->dsp, errp)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -213,16 +203,12 @@ static void armv7m_realize(DeviceState *dev, Error **errp)
|
|||
s->cpu->env.nvic = &s->nvic;
|
||||
s->nvic.cpu = s->cpu;
|
||||
|
||||
qdev_realize(DEVICE(s->cpu), NULL, &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!qdev_realize(DEVICE(s->cpu), NULL, errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Note that we must realize the NVIC after the CPU */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->nvic), &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->nvic), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -247,16 +233,13 @@ static void armv7m_realize(DeviceState *dev, Error **errp)
|
|||
Object *obj = OBJECT(&s->bitband[i]);
|
||||
SysBusDevice *sbd = SYS_BUS_DEVICE(&s->bitband[i]);
|
||||
|
||||
object_property_set_int(obj, bitband_input_addr[i], "base", &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_int(obj, "base",
|
||||
bitband_input_addr[i], errp)) {
|
||||
return;
|
||||
}
|
||||
object_property_set_link(obj, OBJECT(s->board_memory),
|
||||
"source-memory", &error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(obj), &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
object_property_set_link(obj, "source-memory",
|
||||
OBJECT(s->board_memory), &error_abort);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(obj), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -277,7 +277,7 @@ static void aspeed_machine_init(MachineState *machine)
|
|||
/*
|
||||
* This will error out if isize is not supported by memory controller.
|
||||
*/
|
||||
object_property_set_uint(OBJECT(&bmc->soc), ram_size, "ram-size",
|
||||
object_property_set_uint(OBJECT(&bmc->soc), "ram-size", ram_size,
|
||||
&error_fatal);
|
||||
|
||||
for (i = 0; i < sc->macs_num; i++) {
|
||||
|
@ -288,22 +288,22 @@ static void aspeed_machine_init(MachineState *machine)
|
|||
}
|
||||
}
|
||||
|
||||
object_property_set_int(OBJECT(&bmc->soc), amc->hw_strap1, "hw-strap1",
|
||||
object_property_set_int(OBJECT(&bmc->soc), "hw-strap1", amc->hw_strap1,
|
||||
&error_abort);
|
||||
object_property_set_int(OBJECT(&bmc->soc), amc->hw_strap2, "hw-strap2",
|
||||
object_property_set_int(OBJECT(&bmc->soc), "hw-strap2", amc->hw_strap2,
|
||||
&error_abort);
|
||||
object_property_set_int(OBJECT(&bmc->soc), amc->num_cs, "num-cs",
|
||||
object_property_set_int(OBJECT(&bmc->soc), "num-cs", amc->num_cs,
|
||||
&error_abort);
|
||||
object_property_set_link(OBJECT(&bmc->soc), OBJECT(&bmc->ram_container),
|
||||
"dram", &error_abort);
|
||||
object_property_set_link(OBJECT(&bmc->soc), "dram",
|
||||
OBJECT(&bmc->ram_container), &error_abort);
|
||||
if (machine->kernel_filename) {
|
||||
/*
|
||||
* When booting with a -kernel command line there is no u-boot
|
||||
* that runs to unlock the SCU. In this case set the default to
|
||||
* be unlocked as the kernel expects
|
||||
*/
|
||||
object_property_set_int(OBJECT(&bmc->soc), ASPEED_SCU_PROT_KEY,
|
||||
"hw-prot-key", &error_abort);
|
||||
object_property_set_int(OBJECT(&bmc->soc), "hw-prot-key",
|
||||
ASPEED_SCU_PROT_KEY, &error_abort);
|
||||
}
|
||||
qdev_realize(DEVICE(&bmc->soc), NULL, &error_abort);
|
||||
|
||||
|
@ -393,10 +393,10 @@ static void palmetto_bmc_i2c_init(AspeedMachineState *bmc)
|
|||
/* add a TMP423 temperature sensor */
|
||||
dev = i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 2),
|
||||
"tmp423", 0x4c);
|
||||
object_property_set_int(OBJECT(dev), 31000, "temperature0", &error_abort);
|
||||
object_property_set_int(OBJECT(dev), 28000, "temperature1", &error_abort);
|
||||
object_property_set_int(OBJECT(dev), 20000, "temperature2", &error_abort);
|
||||
object_property_set_int(OBJECT(dev), 110000, "temperature3", &error_abort);
|
||||
object_property_set_int(OBJECT(dev), "temperature0", 31000, &error_abort);
|
||||
object_property_set_int(OBJECT(dev), "temperature1", 28000, &error_abort);
|
||||
object_property_set_int(OBJECT(dev), "temperature2", 20000, &error_abort);
|
||||
object_property_set_int(OBJECT(dev), "temperature3", 110000, &error_abort);
|
||||
}
|
||||
|
||||
static void ast2500_evb_i2c_init(AspeedMachineState *bmc)
|
||||
|
|
|
@ -196,7 +196,7 @@ static void aspeed_soc_ast2600_init(Object *obj)
|
|||
object_initialize_child(obj, "sd-controller", &s->sdhci,
|
||||
TYPE_ASPEED_SDHCI);
|
||||
|
||||
object_property_set_int(OBJECT(&s->sdhci), 2, "num-slots", &error_abort);
|
||||
object_property_set_int(OBJECT(&s->sdhci), "num-slots", 2, &error_abort);
|
||||
|
||||
/* Init sd card slot class here so that they're under the correct parent */
|
||||
for (i = 0; i < ASPEED_SDHCI_NUM_SLOTS; ++i) {
|
||||
|
@ -207,7 +207,7 @@ static void aspeed_soc_ast2600_init(Object *obj)
|
|||
object_initialize_child(obj, "emmc-controller", &s->emmc,
|
||||
TYPE_ASPEED_SDHCI);
|
||||
|
||||
object_property_set_int(OBJECT(&s->emmc), 1, "num-slots", &error_abort);
|
||||
object_property_set_int(OBJECT(&s->emmc), "num-slots", 1, &error_abort);
|
||||
|
||||
object_initialize_child(obj, "emmc-controller.sdhci", &s->emmc.slots[0],
|
||||
TYPE_SYSBUS_SDHCI);
|
||||
|
@ -241,17 +241,16 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
|
|||
|
||||
/* CPU */
|
||||
for (i = 0; i < sc->num_cpus; i++) {
|
||||
object_property_set_int(OBJECT(&s->cpu[i]), QEMU_PSCI_CONDUIT_SMC,
|
||||
"psci-conduit", &error_abort);
|
||||
object_property_set_int(OBJECT(&s->cpu[i]), "psci-conduit",
|
||||
QEMU_PSCI_CONDUIT_SMC, &error_abort);
|
||||
if (sc->num_cpus > 1) {
|
||||
object_property_set_int(OBJECT(&s->cpu[i]),
|
||||
ASPEED_A7MPCORE_ADDR,
|
||||
"reset-cbar", &error_abort);
|
||||
object_property_set_int(OBJECT(&s->cpu[i]), "reset-cbar",
|
||||
ASPEED_A7MPCORE_ADDR, &error_abort);
|
||||
}
|
||||
object_property_set_int(OBJECT(&s->cpu[i]), aspeed_calc_affinity(i),
|
||||
"mp-affinity", &error_abort);
|
||||
object_property_set_int(OBJECT(&s->cpu[i]), "mp-affinity",
|
||||
aspeed_calc_affinity(i), &error_abort);
|
||||
|
||||
object_property_set_int(OBJECT(&s->cpu[i]), 1125000000, "cntfrq",
|
||||
object_property_set_int(OBJECT(&s->cpu[i]), "cntfrq", 1125000000,
|
||||
&error_abort);
|
||||
|
||||
/*
|
||||
|
@ -259,19 +258,17 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
|
|||
* is needed when using -kernel
|
||||
*/
|
||||
|
||||
qdev_realize(DEVICE(&s->cpu[i]), NULL, &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!qdev_realize(DEVICE(&s->cpu[i]), NULL, errp)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* A7MPCORE */
|
||||
object_property_set_int(OBJECT(&s->a7mpcore), sc->num_cpus, "num-cpu",
|
||||
object_property_set_int(OBJECT(&s->a7mpcore), "num-cpu", sc->num_cpus,
|
||||
&error_abort);
|
||||
object_property_set_int(OBJECT(&s->a7mpcore),
|
||||
object_property_set_int(OBJECT(&s->a7mpcore), "num-irq",
|
||||
ASPEED_SOC_AST2600_MAX_IRQ + GIC_INTERNAL,
|
||||
"num-irq", &error_abort);
|
||||
&error_abort);
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->a7mpcore), &error_abort);
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->a7mpcore), 0, ASPEED_A7MPCORE_ADDR);
|
||||
|
@ -301,17 +298,13 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
|
|||
sc->memmap[ASPEED_SRAM], &s->sram);
|
||||
|
||||
/* SCU */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->scu), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->scu), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->scu), 0, sc->memmap[ASPEED_SCU]);
|
||||
|
||||
/* RTC */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->rtc), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->rtc), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->rtc), 0, sc->memmap[ASPEED_RTC]);
|
||||
|
@ -319,11 +312,9 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
|
|||
aspeed_soc_get_irq(s, ASPEED_RTC));
|
||||
|
||||
/* Timer */
|
||||
object_property_set_link(OBJECT(&s->timerctrl),
|
||||
OBJECT(&s->scu), "scu", &error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->timerctrl), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
object_property_set_link(OBJECT(&s->timerctrl), "scu", OBJECT(&s->scu),
|
||||
&error_abort);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->timerctrl), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->timerctrl), 0,
|
||||
|
@ -341,11 +332,9 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
|
|||
}
|
||||
|
||||
/* I2C */
|
||||
object_property_set_link(OBJECT(&s->i2c), OBJECT(s->dram_mr), "dram",
|
||||
object_property_set_link(OBJECT(&s->i2c), "dram", OBJECT(s->dram_mr),
|
||||
&error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->i2c), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->i2c), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->i2c), 0, sc->memmap[ASPEED_I2C]);
|
||||
|
@ -360,17 +349,13 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
|
|||
}
|
||||
|
||||
/* FMC, The number of CS is set at the board level */
|
||||
object_property_set_link(OBJECT(&s->fmc), OBJECT(s->dram_mr), "dram",
|
||||
object_property_set_link(OBJECT(&s->fmc), "dram", OBJECT(s->dram_mr),
|
||||
&error_abort);
|
||||
object_property_set_int(OBJECT(&s->fmc), sc->memmap[ASPEED_SDRAM],
|
||||
"sdram-base", &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_int(OBJECT(&s->fmc), "sdram-base",
|
||||
sc->memmap[ASPEED_SDRAM], errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->fmc), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->fmc), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->fmc), 0, sc->memmap[ASPEED_FMC]);
|
||||
|
@ -381,13 +366,10 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
|
|||
|
||||
/* SPI */
|
||||
for (i = 0; i < sc->spis_num; i++) {
|
||||
object_property_set_link(OBJECT(&s->spi[i]), OBJECT(s->dram_mr),
|
||||
"dram", &error_abort);
|
||||
object_property_set_int(OBJECT(&s->spi[i]), 1, "num-cs",
|
||||
&error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
object_property_set_link(OBJECT(&s->spi[i]), "dram",
|
||||
OBJECT(s->dram_mr), &error_abort);
|
||||
object_property_set_int(OBJECT(&s->spi[i]), "num-cs", 1, &error_abort);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->spi[i]), 0,
|
||||
|
@ -398,9 +380,7 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
|
|||
|
||||
/* EHCI */
|
||||
for (i = 0; i < sc->ehcis_num; i++) {
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->ehci[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->ehci[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->ehci[i]), 0,
|
||||
|
@ -410,9 +390,7 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
|
|||
}
|
||||
|
||||
/* SDMC - SDRAM Memory Controller */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->sdmc), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->sdmc), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->sdmc), 0, sc->memmap[ASPEED_SDMC]);
|
||||
|
@ -421,11 +399,9 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
|
|||
for (i = 0; i < sc->wdts_num; i++) {
|
||||
AspeedWDTClass *awc = ASPEED_WDT_GET_CLASS(&s->wdt[i]);
|
||||
|
||||
object_property_set_link(OBJECT(&s->wdt[i]),
|
||||
OBJECT(&s->scu), "scu", &error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->wdt[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
object_property_set_link(OBJECT(&s->wdt[i]), "scu", OBJECT(&s->scu),
|
||||
&error_abort);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->wdt[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt[i]), 0,
|
||||
|
@ -434,11 +410,9 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
|
|||
|
||||
/* Net */
|
||||
for (i = 0; i < sc->macs_num; i++) {
|
||||
object_property_set_bool(OBJECT(&s->ftgmac100[i]), true, "aspeed",
|
||||
object_property_set_bool(OBJECT(&s->ftgmac100[i]), "aspeed", true,
|
||||
&error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->ftgmac100[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->ftgmac100[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->ftgmac100[i]), 0,
|
||||
|
@ -446,11 +420,9 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
|
|||
sysbus_connect_irq(SYS_BUS_DEVICE(&s->ftgmac100[i]), 0,
|
||||
aspeed_soc_get_irq(s, ASPEED_ETH1 + i));
|
||||
|
||||
object_property_set_link(OBJECT(&s->mii[i]), OBJECT(&s->ftgmac100[i]),
|
||||
"nic", &error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->mii[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
object_property_set_link(OBJECT(&s->mii[i]), "nic",
|
||||
OBJECT(&s->ftgmac100[i]), &error_abort);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->mii[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -459,9 +431,7 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
|
|||
}
|
||||
|
||||
/* XDMA */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->xdma), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->xdma), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->xdma), 0,
|
||||
|
@ -470,18 +440,14 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
|
|||
aspeed_soc_get_irq(s, ASPEED_XDMA));
|
||||
|
||||
/* GPIO */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->gpio), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpio), 0, sc->memmap[ASPEED_GPIO]);
|
||||
sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpio), 0,
|
||||
aspeed_soc_get_irq(s, ASPEED_GPIO));
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->gpio_1_8v), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio_1_8v), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpio_1_8v), 0,
|
||||
|
@ -490,9 +456,7 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
|
|||
aspeed_soc_get_irq(s, ASPEED_GPIO_1_8V));
|
||||
|
||||
/* SDHCI */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->sdhci), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->sdhci), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->sdhci), 0,
|
||||
|
@ -501,9 +465,7 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
|
|||
aspeed_soc_get_irq(s, ASPEED_SDHCI));
|
||||
|
||||
/* eMMC */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->emmc), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->emmc), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->emmc), 0, sc->memmap[ASPEED_EMMC]);
|
||||
|
|
|
@ -204,7 +204,7 @@ static void aspeed_soc_init(Object *obj)
|
|||
|
||||
object_initialize_child(obj, "sdc", &s->sdhci, TYPE_ASPEED_SDHCI);
|
||||
|
||||
object_property_set_int(OBJECT(&s->sdhci), 2, "num-slots", &error_abort);
|
||||
object_property_set_int(OBJECT(&s->sdhci), "num-slots", 2, &error_abort);
|
||||
|
||||
/* Init sd card slot class here so that they're under the correct parent */
|
||||
for (i = 0; i < ASPEED_SDHCI_NUM_SLOTS; ++i) {
|
||||
|
@ -230,9 +230,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
|
|||
|
||||
/* CPU */
|
||||
for (i = 0; i < sc->num_cpus; i++) {
|
||||
qdev_realize(DEVICE(&s->cpu[i]), NULL, &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!qdev_realize(DEVICE(&s->cpu[i]), NULL, errp)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -248,17 +246,13 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
|
|||
sc->memmap[ASPEED_SRAM], &s->sram);
|
||||
|
||||
/* SCU */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->scu), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->scu), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->scu), 0, sc->memmap[ASPEED_SCU]);
|
||||
|
||||
/* VIC */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->vic), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->vic), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->vic), 0, sc->memmap[ASPEED_VIC]);
|
||||
|
@ -268,9 +262,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
|
|||
qdev_get_gpio_in(DEVICE(&s->cpu), ARM_CPU_FIQ));
|
||||
|
||||
/* RTC */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->rtc), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->rtc), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->rtc), 0, sc->memmap[ASPEED_RTC]);
|
||||
|
@ -278,11 +270,9 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
|
|||
aspeed_soc_get_irq(s, ASPEED_RTC));
|
||||
|
||||
/* Timer */
|
||||
object_property_set_link(OBJECT(&s->timerctrl),
|
||||
OBJECT(&s->scu), "scu", &error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->timerctrl), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
object_property_set_link(OBJECT(&s->timerctrl), "scu", OBJECT(&s->scu),
|
||||
&error_abort);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->timerctrl), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->timerctrl), 0,
|
||||
|
@ -300,11 +290,9 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
|
|||
}
|
||||
|
||||
/* I2C */
|
||||
object_property_set_link(OBJECT(&s->i2c), OBJECT(s->dram_mr), "dram",
|
||||
object_property_set_link(OBJECT(&s->i2c), "dram", OBJECT(s->dram_mr),
|
||||
&error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->i2c), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->i2c), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->i2c), 0, sc->memmap[ASPEED_I2C]);
|
||||
|
@ -312,17 +300,13 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
|
|||
aspeed_soc_get_irq(s, ASPEED_I2C));
|
||||
|
||||
/* FMC, The number of CS is set at the board level */
|
||||
object_property_set_link(OBJECT(&s->fmc), OBJECT(s->dram_mr), "dram",
|
||||
object_property_set_link(OBJECT(&s->fmc), "dram", OBJECT(s->dram_mr),
|
||||
&error_abort);
|
||||
object_property_set_int(OBJECT(&s->fmc), sc->memmap[ASPEED_SDRAM],
|
||||
"sdram-base", &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_int(OBJECT(&s->fmc), "sdram-base",
|
||||
sc->memmap[ASPEED_SDRAM], errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->fmc), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->fmc), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->fmc), 0, sc->memmap[ASPEED_FMC]);
|
||||
|
@ -333,11 +317,8 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
|
|||
|
||||
/* SPI */
|
||||
for (i = 0; i < sc->spis_num; i++) {
|
||||
object_property_set_int(OBJECT(&s->spi[i]), 1, "num-cs",
|
||||
&error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
object_property_set_int(OBJECT(&s->spi[i]), "num-cs", 1, &error_abort);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->spi[i]), 0,
|
||||
|
@ -348,9 +329,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
|
|||
|
||||
/* EHCI */
|
||||
for (i = 0; i < sc->ehcis_num; i++) {
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->ehci[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->ehci[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->ehci[i]), 0,
|
||||
|
@ -360,9 +339,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
|
|||
}
|
||||
|
||||
/* SDMC - SDRAM Memory Controller */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->sdmc), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->sdmc), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->sdmc), 0, sc->memmap[ASPEED_SDMC]);
|
||||
|
@ -371,11 +348,9 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
|
|||
for (i = 0; i < sc->wdts_num; i++) {
|
||||
AspeedWDTClass *awc = ASPEED_WDT_GET_CLASS(&s->wdt[i]);
|
||||
|
||||
object_property_set_link(OBJECT(&s->wdt[i]),
|
||||
OBJECT(&s->scu), "scu", &error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->wdt[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
object_property_set_link(OBJECT(&s->wdt[i]), "scu", OBJECT(&s->scu),
|
||||
&error_abort);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->wdt[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt[i]), 0,
|
||||
|
@ -384,11 +359,9 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
|
|||
|
||||
/* Net */
|
||||
for (i = 0; i < sc->macs_num; i++) {
|
||||
object_property_set_bool(OBJECT(&s->ftgmac100[i]), true, "aspeed",
|
||||
object_property_set_bool(OBJECT(&s->ftgmac100[i]), "aspeed", true,
|
||||
&error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->ftgmac100[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->ftgmac100[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->ftgmac100[i]), 0,
|
||||
|
@ -398,9 +371,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
|
|||
}
|
||||
|
||||
/* XDMA */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->xdma), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->xdma), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->xdma), 0,
|
||||
|
@ -409,9 +380,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
|
|||
aspeed_soc_get_irq(s, ASPEED_XDMA));
|
||||
|
||||
/* GPIO */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->gpio), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpio), 0, sc->memmap[ASPEED_GPIO]);
|
||||
|
@ -419,9 +388,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
|
|||
aspeed_soc_get_irq(s, ASPEED_GPIO));
|
||||
|
||||
/* SDHCI */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->sdhci), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->sdhci), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->sdhci), 0,
|
||||
|
|
|
@ -134,12 +134,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
|
|||
uint64_t ram_size, vcram_size;
|
||||
int n;
|
||||
|
||||
obj = object_property_get_link(OBJECT(dev), "ram", &err);
|
||||
if (obj == NULL) {
|
||||
error_setg(errp, "%s: required ram link not found: %s",
|
||||
__func__, error_get_pretty(err));
|
||||
return;
|
||||
}
|
||||
obj = object_property_get_link(OBJECT(dev), "ram", &error_abort);
|
||||
|
||||
ram = MEMORY_REGION(obj);
|
||||
ram_size = memory_region_size(ram);
|
||||
|
@ -161,9 +156,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
|
|||
}
|
||||
|
||||
/* Interrupt Controller */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->ic), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->ic), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -172,9 +165,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
|
|||
sysbus_pass_irq(SYS_BUS_DEVICE(s), SYS_BUS_DEVICE(&s->ic));
|
||||
|
||||
/* Sys Timer */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->systmr), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->systmr), errp)) {
|
||||
return;
|
||||
}
|
||||
memory_region_add_subregion(&s->peri_mr, ST_OFFSET,
|
||||
|
@ -185,9 +176,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
|
|||
|
||||
/* UART0 */
|
||||
qdev_prop_set_chr(DEVICE(&s->uart0), "chardev", serial_hd(0));
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->uart0), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->uart0), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -200,9 +189,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
|
|||
/* AUX / UART1 */
|
||||
qdev_prop_set_chr(DEVICE(&s->aux), "chardev", serial_hd(1));
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->aux), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->aux), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -213,9 +200,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
|
|||
INTERRUPT_AUX));
|
||||
|
||||
/* Mailboxes */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->mboxes), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->mboxes), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -232,16 +217,12 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
|
|||
return;
|
||||
}
|
||||
|
||||
object_property_set_uint(OBJECT(&s->fb), ram_size - vcram_size,
|
||||
"vcram-base", &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_uint(OBJECT(&s->fb), "vcram-base",
|
||||
ram_size - vcram_size, errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->fb), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->fb), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -251,9 +232,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
|
|||
qdev_get_gpio_in(DEVICE(&s->mboxes), MBOX_CHAN_FB));
|
||||
|
||||
/* Property channel */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->property), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->property), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -264,9 +243,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
|
|||
qdev_get_gpio_in(DEVICE(&s->mboxes), MBOX_CHAN_PROPERTY));
|
||||
|
||||
/* Random Number Generator */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->rng), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->rng), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -283,15 +260,13 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
|
|||
* For the exact details please refer to the Arasan documentation:
|
||||
* SD3.0_Host_AHB_eMMC4.4_Usersguide_ver5.9_jan11_10.pdf
|
||||
*/
|
||||
object_property_set_uint(OBJECT(&s->sdhci), 3, "sd-spec-version",
|
||||
object_property_set_uint(OBJECT(&s->sdhci), "sd-spec-version", 3,
|
||||
&error_abort);
|
||||
object_property_set_uint(OBJECT(&s->sdhci), BCM2835_SDHC_CAPAREG, "capareg",
|
||||
object_property_set_uint(OBJECT(&s->sdhci), "capareg",
|
||||
BCM2835_SDHC_CAPAREG, &error_abort);
|
||||
object_property_set_bool(OBJECT(&s->sdhci), "pending-insert-quirk", true,
|
||||
&error_abort);
|
||||
object_property_set_bool(OBJECT(&s->sdhci), true, "pending-insert-quirk",
|
||||
&error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->sdhci), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->sdhci), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -302,9 +277,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
|
|||
INTERRUPT_ARASANSDIO));
|
||||
|
||||
/* SDHOST */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->sdhost), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->sdhost), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -315,9 +288,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
|
|||
INTERRUPT_SDIO));
|
||||
|
||||
/* DMA Channels */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->dma), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->dma), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -334,18 +305,14 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
|
|||
}
|
||||
|
||||
/* THERMAL */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->thermal), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->thermal), errp)) {
|
||||
return;
|
||||
}
|
||||
memory_region_add_subregion(&s->peri_mr, THERMAL_OFFSET,
|
||||
sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->thermal), 0));
|
||||
|
||||
/* GPIO */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->gpio), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -355,9 +322,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
|
|||
object_property_add_alias(OBJECT(s), "sd-bus", OBJECT(&s->gpio), "sd-bus");
|
||||
|
||||
/* Mphi */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->mphi), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->mphi), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -368,9 +333,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
|
|||
INTERRUPT_HOSTPORT));
|
||||
|
||||
/* DWC2 */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->dwc2), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->dwc2), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -72,23 +72,15 @@ static void bcm2836_realize(DeviceState *dev, Error **errp)
|
|||
BCM283XClass *bc = BCM283X_GET_CLASS(dev);
|
||||
const BCM283XInfo *info = bc->info;
|
||||
Object *obj;
|
||||
Error *err = NULL;
|
||||
int n;
|
||||
|
||||
/* common peripherals from bcm2835 */
|
||||
|
||||
obj = object_property_get_link(OBJECT(dev), "ram", &err);
|
||||
if (obj == NULL) {
|
||||
error_setg(errp, "%s: required ram link not found: %s",
|
||||
__func__, error_get_pretty(err));
|
||||
return;
|
||||
}
|
||||
obj = object_property_get_link(OBJECT(dev), "ram", &error_abort);
|
||||
|
||||
object_property_add_const_link(OBJECT(&s->peripherals), "ram", obj);
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->peripherals), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->peripherals), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -99,9 +91,7 @@ static void bcm2836_realize(DeviceState *dev, Error **errp)
|
|||
info->peri_base, 1);
|
||||
|
||||
/* bcm2836 interrupt controller (and mailboxes, etc.) */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->control), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->control), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -117,25 +107,20 @@ static void bcm2836_realize(DeviceState *dev, Error **errp)
|
|||
s->cpu[n].core.mp_affinity = (info->clusterid << 8) | n;
|
||||
|
||||
/* set periphbase/CBAR value for CPU-local registers */
|
||||
object_property_set_int(OBJECT(&s->cpu[n].core),
|
||||
info->peri_base,
|
||||
"reset-cbar", &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_int(OBJECT(&s->cpu[n].core), "reset-cbar",
|
||||
info->peri_base, errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* start powered off if not enabled */
|
||||
object_property_set_bool(OBJECT(&s->cpu[n].core), n >= s->enabled_cpus,
|
||||
"start-powered-off", &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_bool(OBJECT(&s->cpu[n].core),
|
||||
"start-powered-off",
|
||||
n >= s->enabled_cpus,
|
||||
errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
qdev_realize(DEVICE(&s->cpu[n].core), NULL, &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!qdev_realize(DEVICE(&s->cpu[n].core), NULL, errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -62,26 +62,24 @@ static void cubieboard_init(MachineState *machine)
|
|||
object_property_add_child(OBJECT(machine), "soc", OBJECT(a10));
|
||||
object_unref(OBJECT(a10));
|
||||
|
||||
object_property_set_int(OBJECT(&a10->emac), 1, "phy-addr", &err);
|
||||
if (err != NULL) {
|
||||
if (!object_property_set_int(OBJECT(&a10->emac), "phy-addr", 1, &err)) {
|
||||
error_reportf_err(err, "Couldn't set phy address: ");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
object_property_set_int(OBJECT(&a10->timer), 32768, "clk0-freq", &err);
|
||||
if (err != NULL) {
|
||||
if (!object_property_set_int(OBJECT(&a10->timer), "clk0-freq", 32768,
|
||||
&err)) {
|
||||
error_reportf_err(err, "Couldn't set clk0 frequency: ");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
object_property_set_int(OBJECT(&a10->timer), 24000000, "clk1-freq", &err);
|
||||
if (err != NULL) {
|
||||
if (!object_property_set_int(OBJECT(&a10->timer), "clk1-freq", 24000000,
|
||||
&err)) {
|
||||
error_reportf_err(err, "Couldn't set clk1 frequency: ");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
qdev_realize(DEVICE(a10), NULL, &err);
|
||||
if (err != NULL) {
|
||||
if (!qdev_realize(DEVICE(a10), NULL, &err)) {
|
||||
error_reportf_err(err, "Couldn't realize Allwinner A10: ");
|
||||
exit(1);
|
||||
}
|
||||
|
|
|
@ -52,26 +52,20 @@ static void digic_init(Object *obj)
|
|||
static void digic_realize(DeviceState *dev, Error **errp)
|
||||
{
|
||||
DigicState *s = DIGIC(dev);
|
||||
Error *err = NULL;
|
||||
SysBusDevice *sbd;
|
||||
int i;
|
||||
|
||||
object_property_set_bool(OBJECT(&s->cpu), true, "reset-hivecs", &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_bool(OBJECT(&s->cpu), "reset-hivecs", true,
|
||||
errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
qdev_realize(DEVICE(&s->cpu), NULL, &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!qdev_realize(DEVICE(&s->cpu), NULL, errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < DIGIC4_NB_TIMERS; i++) {
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->timer[i]), &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->timer[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -80,9 +74,7 @@ static void digic_realize(DeviceState *dev, Error **errp)
|
|||
}
|
||||
|
||||
qdev_prop_set_chr(DEVICE(&s->uart), "chardev", serial_hd(0));
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->uart), &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->uart), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -62,8 +62,7 @@ static void digic4_board_init(MachineState *machine, DigicBoard *board)
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
qdev_realize(DEVICE(s), NULL, &err);
|
||||
if (err != NULL) {
|
||||
if (!qdev_realize(DEVICE(s), NULL, &err)) {
|
||||
error_reportf_err(err, "Couldn't realize DIGIC SoC: ");
|
||||
exit(1);
|
||||
}
|
||||
|
|
|
@ -188,7 +188,7 @@ static DeviceState *pl330_create(uint32_t base, qemu_or_irq *orgate,
|
|||
sysbus_realize_and_unref(busdev, &error_fatal);
|
||||
sysbus_mmio_map(busdev, 0, base);
|
||||
|
||||
object_property_set_int(OBJECT(orgate), nevents + 1, "num-lines",
|
||||
object_property_set_int(OBJECT(orgate), "num-lines", nevents + 1,
|
||||
&error_abort);
|
||||
qdev_realize(DEVICE(orgate), NULL, &error_abort);
|
||||
|
||||
|
@ -215,14 +215,15 @@ static void exynos4210_realize(DeviceState *socdev, Error **errp)
|
|||
* support EL3 so the CPU EL3 property is disabled before realization.
|
||||
*/
|
||||
if (object_property_find(cpuobj, "has_el3", NULL)) {
|
||||
object_property_set_bool(cpuobj, false, "has_el3", &error_fatal);
|
||||
object_property_set_bool(cpuobj, "has_el3", false, &error_fatal);
|
||||
}
|
||||
|
||||
s->cpu[n] = ARM_CPU(cpuobj);
|
||||
object_property_set_int(cpuobj, exynos4210_calc_affinity(n),
|
||||
"mp-affinity", &error_abort);
|
||||
object_property_set_int(cpuobj, EXYNOS4210_SMP_PRIVATE_BASE_ADDR,
|
||||
"reset-cbar", &error_abort);
|
||||
object_property_set_int(cpuobj, "mp-affinity",
|
||||
exynos4210_calc_affinity(n), &error_abort);
|
||||
object_property_set_int(cpuobj, "reset-cbar",
|
||||
EXYNOS4210_SMP_PRIVATE_BASE_ADDR,
|
||||
&error_abort);
|
||||
qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
|
||||
}
|
||||
|
||||
|
|
|
@ -85,15 +85,11 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
|
|||
uint8_t i;
|
||||
Error *err = NULL;
|
||||
|
||||
qdev_realize(DEVICE(&s->cpu), NULL, &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!qdev_realize(DEVICE(&s->cpu), NULL, errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->avic), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->avic), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->avic), 0, FSL_IMX25_AVIC_ADDR);
|
||||
|
@ -102,9 +98,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
|
|||
sysbus_connect_irq(SYS_BUS_DEVICE(&s->avic), 1,
|
||||
qdev_get_gpio_in(DEVICE(&s->cpu), ARM_CPU_FIQ));
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->ccm), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->ccm), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->ccm), 0, FSL_IMX25_CCM_ADDR);
|
||||
|
@ -124,9 +118,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
|
|||
|
||||
qdev_prop_set_chr(DEVICE(&s->uart[i]), "chardev", serial_hd(i));
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->uart[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->uart[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->uart[i]), 0, serial_table[i].addr);
|
||||
|
@ -149,9 +141,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
|
|||
|
||||
s->gpt[i].ccm = IMX_CCM(&s->ccm);
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->gpt[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpt[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpt[i]), 0, gpt_table[i].addr);
|
||||
|
@ -172,9 +162,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
|
|||
|
||||
s->epit[i].ccm = IMX_CCM(&s->ccm);
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->epit[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->epit[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->epit[i]), 0, epit_table[i].addr);
|
||||
|
@ -185,18 +173,14 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
|
|||
|
||||
qdev_set_nic_properties(DEVICE(&s->fec), &nd_table[0]);
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->fec), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->fec), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->fec), 0, FSL_IMX25_FEC_ADDR);
|
||||
sysbus_connect_irq(SYS_BUS_DEVICE(&s->fec), 0,
|
||||
qdev_get_gpio_in(DEVICE(&s->avic), FSL_IMX25_FEC_IRQ));
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->rngc), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->rngc), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->rngc), 0, FSL_IMX25_RNGC_ADDR);
|
||||
|
@ -214,9 +198,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
|
|||
{ FSL_IMX25_I2C3_ADDR, FSL_IMX25_I2C3_IRQ }
|
||||
};
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->i2c[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->i2c[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->i2c[i]), 0, i2c_table[i].addr);
|
||||
|
@ -237,9 +219,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
|
|||
{ FSL_IMX25_GPIO4_ADDR, FSL_IMX25_GPIO4_IRQ }
|
||||
};
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->gpio[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpio[i]), 0, gpio_table[i].addr);
|
||||
|
@ -259,17 +239,13 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
|
|||
{ FSL_IMX25_ESDHC2_ADDR, FSL_IMX25_ESDHC2_IRQ },
|
||||
};
|
||||
|
||||
object_property_set_uint(OBJECT(&s->esdhc[i]), 2, "sd-spec-version",
|
||||
object_property_set_uint(OBJECT(&s->esdhc[i]), "sd-spec-version", 2,
|
||||
&error_abort);
|
||||
object_property_set_uint(OBJECT(&s->esdhc[i]), IMX25_ESDHC_CAPABILITIES,
|
||||
"capareg",
|
||||
&error_abort);
|
||||
object_property_set_uint(OBJECT(&s->esdhc[i]), SDHCI_VENDOR_IMX,
|
||||
"vendor",
|
||||
&error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->esdhc[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
object_property_set_uint(OBJECT(&s->esdhc[i]), "capareg",
|
||||
IMX25_ESDHC_CAPABILITIES, &error_abort);
|
||||
object_property_set_uint(OBJECT(&s->esdhc[i]), "vendor",
|
||||
SDHCI_VENDOR_IMX, &error_abort);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->esdhc[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->esdhc[i]), 0, esdhc_table[i].addr);
|
||||
|
@ -296,7 +272,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
|
|||
}
|
||||
|
||||
/* Watchdog */
|
||||
object_property_set_bool(OBJECT(&s->wdt), true, "pretimeout-support",
|
||||
object_property_set_bool(OBJECT(&s->wdt), "pretimeout-support", true,
|
||||
&error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->wdt), &error_abort);
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt), 0, FSL_IMX25_WDT_ADDR);
|
||||
|
|
|
@ -66,15 +66,11 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
|
|||
uint16_t i;
|
||||
Error *err = NULL;
|
||||
|
||||
qdev_realize(DEVICE(&s->cpu), NULL, &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!qdev_realize(DEVICE(&s->cpu), NULL, errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->avic), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->avic), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->avic), 0, FSL_IMX31_AVIC_ADDR);
|
||||
|
@ -83,9 +79,7 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
|
|||
sysbus_connect_irq(SYS_BUS_DEVICE(&s->avic), 1,
|
||||
qdev_get_gpio_in(DEVICE(&s->cpu), ARM_CPU_FIQ));
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->ccm), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->ccm), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->ccm), 0, FSL_IMX31_CCM_ADDR);
|
||||
|
@ -102,9 +96,7 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
|
|||
|
||||
qdev_prop_set_chr(DEVICE(&s->uart[i]), "chardev", serial_hd(i));
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->uart[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->uart[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -116,9 +108,7 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
|
|||
|
||||
s->gpt.ccm = IMX_CCM(&s->ccm);
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->gpt), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpt), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -138,9 +128,7 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
|
|||
|
||||
s->epit[i].ccm = IMX_CCM(&s->ccm);
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->epit[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->epit[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -162,9 +150,7 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
|
|||
};
|
||||
|
||||
/* Initialize the I2C */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->i2c[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->i2c[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
/* Map I2C memory */
|
||||
|
@ -186,11 +172,9 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
|
|||
{ FSL_IMX31_GPIO3_ADDR, FSL_IMX31_GPIO3_IRQ }
|
||||
};
|
||||
|
||||
object_property_set_bool(OBJECT(&s->gpio[i]), false, "has-edge-sel",
|
||||
object_property_set_bool(OBJECT(&s->gpio[i]), "has-edge-sel", false,
|
||||
&error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->gpio[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpio[i]), 0, gpio_table[i].addr);
|
||||
|
|
|
@ -120,33 +120,28 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
|
|||
|
||||
/* On uniprocessor, the CBAR is set to 0 */
|
||||
if (smp_cpus > 1) {
|
||||
object_property_set_int(OBJECT(&s->cpu[i]), FSL_IMX6_A9MPCORE_ADDR,
|
||||
"reset-cbar", &error_abort);
|
||||
object_property_set_int(OBJECT(&s->cpu[i]), "reset-cbar",
|
||||
FSL_IMX6_A9MPCORE_ADDR, &error_abort);
|
||||
}
|
||||
|
||||
/* All CPU but CPU 0 start in power off mode */
|
||||
if (i) {
|
||||
object_property_set_bool(OBJECT(&s->cpu[i]), true,
|
||||
"start-powered-off", &error_abort);
|
||||
object_property_set_bool(OBJECT(&s->cpu[i]), "start-powered-off",
|
||||
true, &error_abort);
|
||||
}
|
||||
|
||||
qdev_realize(DEVICE(&s->cpu[i]), NULL, &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!qdev_realize(DEVICE(&s->cpu[i]), NULL, errp)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
object_property_set_int(OBJECT(&s->a9mpcore), smp_cpus, "num-cpu",
|
||||
object_property_set_int(OBJECT(&s->a9mpcore), "num-cpu", smp_cpus,
|
||||
&error_abort);
|
||||
|
||||
object_property_set_int(OBJECT(&s->a9mpcore),
|
||||
FSL_IMX6_MAX_IRQ + GIC_INTERNAL, "num-irq",
|
||||
&error_abort);
|
||||
object_property_set_int(OBJECT(&s->a9mpcore), "num-irq",
|
||||
FSL_IMX6_MAX_IRQ + GIC_INTERNAL, &error_abort);
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->a9mpcore), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->a9mpcore), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->a9mpcore), 0, FSL_IMX6_A9MPCORE_ADDR);
|
||||
|
@ -158,16 +153,12 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
|
|||
qdev_get_gpio_in(DEVICE(&s->cpu[i]), ARM_CPU_FIQ));
|
||||
}
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->ccm), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->ccm), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->ccm), 0, FSL_IMX6_CCM_ADDR);
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->src), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->src), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->src), 0, FSL_IMX6_SRC_ADDR);
|
||||
|
@ -187,9 +178,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
|
|||
|
||||
qdev_prop_set_chr(DEVICE(&s->uart[i]), "chardev", serial_hd(i));
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->uart[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->uart[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -201,9 +190,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
|
|||
|
||||
s->gpt.ccm = IMX_CCM(&s->ccm);
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->gpt), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpt), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -224,9 +211,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
|
|||
|
||||
s->epit[i].ccm = IMX_CCM(&s->ccm);
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->epit[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->epit[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -247,9 +232,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
|
|||
{ FSL_IMX6_I2C3_ADDR, FSL_IMX6_I2C3_IRQ }
|
||||
};
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->i2c[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->i2c[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -303,13 +286,11 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
|
|||
},
|
||||
};
|
||||
|
||||
object_property_set_bool(OBJECT(&s->gpio[i]), true, "has-edge-sel",
|
||||
object_property_set_bool(OBJECT(&s->gpio[i]), "has-edge-sel", true,
|
||||
&error_abort);
|
||||
object_property_set_bool(OBJECT(&s->gpio[i]), true, "has-upper-pin-irq",
|
||||
&error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->gpio[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
object_property_set_bool(OBJECT(&s->gpio[i]), "has-upper-pin-irq",
|
||||
true, &error_abort);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -335,17 +316,13 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
|
|||
};
|
||||
|
||||
/* UHS-I SDIO3.0 SDR104 1.8V ADMA */
|
||||
object_property_set_uint(OBJECT(&s->esdhc[i]), 3, "sd-spec-version",
|
||||
object_property_set_uint(OBJECT(&s->esdhc[i]), "sd-spec-version", 3,
|
||||
&error_abort);
|
||||
object_property_set_uint(OBJECT(&s->esdhc[i]), IMX6_ESDHC_CAPABILITIES,
|
||||
"capareg",
|
||||
&error_abort);
|
||||
object_property_set_uint(OBJECT(&s->esdhc[i]), SDHCI_VENDOR_IMX,
|
||||
"vendor",
|
||||
&error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->esdhc[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
object_property_set_uint(OBJECT(&s->esdhc[i]), "capareg",
|
||||
IMX6_ESDHC_CAPABILITIES, &error_abort);
|
||||
object_property_set_uint(OBJECT(&s->esdhc[i]), "vendor",
|
||||
SDHCI_VENDOR_IMX, &error_abort);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->esdhc[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->esdhc[i]), 0, esdhc_table[i].addr);
|
||||
|
@ -390,9 +367,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
|
|||
};
|
||||
|
||||
/* Initialize the SPI */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -403,9 +378,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
|
|||
}
|
||||
|
||||
qdev_set_nic_properties(DEVICE(&s->eth), &nd_table[0]);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->eth), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->eth), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->eth), 0, FSL_IMX6_ENET_ADDR);
|
||||
|
@ -429,8 +402,8 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
|
|||
FSL_IMX6_WDOG2_IRQ,
|
||||
};
|
||||
|
||||
object_property_set_bool(OBJECT(&s->wdt[i]), true, "pretimeout-support",
|
||||
&error_abort);
|
||||
object_property_set_bool(OBJECT(&s->wdt[i]), "pretimeout-support",
|
||||
true, &error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->wdt[i]), &error_abort);
|
||||
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt[i]), 0, FSL_IMX6_WDOGn_ADDR[i]);
|
||||
|
|
|
@ -166,17 +166,16 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
|
|||
return;
|
||||
}
|
||||
|
||||
object_property_set_int(OBJECT(&s->cpu), QEMU_PSCI_CONDUIT_SMC,
|
||||
"psci-conduit", &error_abort);
|
||||
object_property_set_int(OBJECT(&s->cpu), "psci-conduit",
|
||||
QEMU_PSCI_CONDUIT_SMC, &error_abort);
|
||||
qdev_realize(DEVICE(&s->cpu), NULL, &error_abort);
|
||||
|
||||
/*
|
||||
* A7MPCORE
|
||||
*/
|
||||
object_property_set_int(OBJECT(&s->a7mpcore), 1, "num-cpu", &error_abort);
|
||||
object_property_set_int(OBJECT(&s->a7mpcore),
|
||||
FSL_IMX6UL_MAX_IRQ + GIC_INTERNAL,
|
||||
"num-irq", &error_abort);
|
||||
object_property_set_int(OBJECT(&s->a7mpcore), "num-cpu", 1, &error_abort);
|
||||
object_property_set_int(OBJECT(&s->a7mpcore), "num-irq",
|
||||
FSL_IMX6UL_MAX_IRQ + GIC_INTERNAL, &error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->a7mpcore), &error_abort);
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->a7mpcore), 0, FSL_IMX6UL_A7MPCORE_ADDR);
|
||||
|
||||
|
@ -427,12 +426,10 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
|
|||
FSL_IMX6UL_ENET2_TIMER_IRQ,
|
||||
};
|
||||
|
||||
object_property_set_uint(OBJECT(&s->eth[i]),
|
||||
s->phy_num[i],
|
||||
"phy-num", &error_abort);
|
||||
object_property_set_uint(OBJECT(&s->eth[i]),
|
||||
FSL_IMX6UL_ETH_NUM_TX_RINGS,
|
||||
"tx-ring-num", &error_abort);
|
||||
object_property_set_uint(OBJECT(&s->eth[i]), "phy-num",
|
||||
s->phy_num[i], &error_abort);
|
||||
object_property_set_uint(OBJECT(&s->eth[i]), "tx-ring-num",
|
||||
FSL_IMX6UL_ETH_NUM_TX_RINGS, &error_abort);
|
||||
qdev_set_nic_properties(DEVICE(&s->eth[i]), &nd_table[i]);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->eth[i]), &error_abort);
|
||||
|
||||
|
@ -482,8 +479,8 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
|
|||
FSL_IMX6UL_USDHC2_IRQ,
|
||||
};
|
||||
|
||||
object_property_set_uint(OBJECT(&s->usdhc[i]), SDHCI_VENDOR_IMX,
|
||||
"vendor", &error_abort);
|
||||
object_property_set_uint(OBJECT(&s->usdhc[i]), "vendor",
|
||||
SDHCI_VENDOR_IMX, &error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->usdhc[i]), &error_abort);
|
||||
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->usdhc[i]), 0,
|
||||
|
@ -515,8 +512,8 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
|
|||
FSL_IMX6UL_WDOG3_IRQ,
|
||||
};
|
||||
|
||||
object_property_set_bool(OBJECT(&s->wdt[i]), true, "pretimeout-support",
|
||||
&error_abort);
|
||||
object_property_set_bool(OBJECT(&s->wdt[i]), "pretimeout-support",
|
||||
true, &error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->wdt[i]), &error_abort);
|
||||
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt[i]), 0,
|
||||
|
|
|
@ -159,19 +159,19 @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
|
|||
for (i = 0; i < smp_cpus; i++) {
|
||||
o = OBJECT(&s->cpu[i]);
|
||||
|
||||
object_property_set_int(o, QEMU_PSCI_CONDUIT_SMC,
|
||||
"psci-conduit", &error_abort);
|
||||
object_property_set_int(o, "psci-conduit", QEMU_PSCI_CONDUIT_SMC,
|
||||
&error_abort);
|
||||
|
||||
/* On uniprocessor, the CBAR is set to 0 */
|
||||
if (smp_cpus > 1) {
|
||||
object_property_set_int(o, FSL_IMX7_A7MPCORE_ADDR,
|
||||
"reset-cbar", &error_abort);
|
||||
object_property_set_int(o, "reset-cbar", FSL_IMX7_A7MPCORE_ADDR,
|
||||
&error_abort);
|
||||
}
|
||||
|
||||
if (i) {
|
||||
/* Secondary CPUs start in PSCI powered-down state */
|
||||
object_property_set_bool(o, true,
|
||||
"start-powered-off", &error_abort);
|
||||
object_property_set_bool(o, "start-powered-off", true,
|
||||
&error_abort);
|
||||
}
|
||||
|
||||
qdev_realize(DEVICE(o), NULL, &error_abort);
|
||||
|
@ -180,11 +180,10 @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
|
|||
/*
|
||||
* A7MPCORE
|
||||
*/
|
||||
object_property_set_int(OBJECT(&s->a7mpcore), smp_cpus, "num-cpu",
|
||||
object_property_set_int(OBJECT(&s->a7mpcore), "num-cpu", smp_cpus,
|
||||
&error_abort);
|
||||
object_property_set_int(OBJECT(&s->a7mpcore),
|
||||
FSL_IMX7_MAX_IRQ + GIC_INTERNAL,
|
||||
"num-irq", &error_abort);
|
||||
object_property_set_int(OBJECT(&s->a7mpcore), "num-irq",
|
||||
FSL_IMX7_MAX_IRQ + GIC_INTERNAL, &error_abort);
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->a7mpcore), &error_abort);
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->a7mpcore), 0, FSL_IMX7_A7MPCORE_ADDR);
|
||||
|
@ -364,8 +363,8 @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
|
|||
FSL_IMX7_ENET2_ADDR,
|
||||
};
|
||||
|
||||
object_property_set_uint(OBJECT(&s->eth[i]), FSL_IMX7_ETH_NUM_TX_RINGS,
|
||||
"tx-ring-num", &error_abort);
|
||||
object_property_set_uint(OBJECT(&s->eth[i]), "tx-ring-num",
|
||||
FSL_IMX7_ETH_NUM_TX_RINGS, &error_abort);
|
||||
qdev_set_nic_properties(DEVICE(&s->eth[i]), &nd_table[i]);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->eth[i]), &error_abort);
|
||||
|
||||
|
@ -393,8 +392,8 @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
|
|||
FSL_IMX7_USDHC3_IRQ,
|
||||
};
|
||||
|
||||
object_property_set_uint(OBJECT(&s->usdhc[i]), SDHCI_VENDOR_IMX,
|
||||
"vendor", &error_abort);
|
||||
object_property_set_uint(OBJECT(&s->usdhc[i]), "vendor",
|
||||
SDHCI_VENDOR_IMX, &error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->usdhc[i]), &error_abort);
|
||||
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->usdhc[i]), 0,
|
||||
|
@ -432,8 +431,8 @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
|
|||
FSL_IMX7_WDOG4_IRQ,
|
||||
};
|
||||
|
||||
object_property_set_bool(OBJECT(&s->wdt[i]), true, "pretimeout-support",
|
||||
&error_abort);
|
||||
object_property_set_bool(OBJECT(&s->wdt[i]), "pretimeout-support",
|
||||
true, &error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->wdt[i]), &error_abort);
|
||||
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt[i]), 0, FSL_IMX7_WDOGn_ADDR[i]);
|
||||
|
|
|
@ -267,18 +267,18 @@ static void calxeda_init(MachineState *machine, enum cxmachines machine_id)
|
|||
cpuobj = object_new(machine->cpu_type);
|
||||
cpu = ARM_CPU(cpuobj);
|
||||
|
||||
object_property_set_int(cpuobj, QEMU_PSCI_CONDUIT_SMC,
|
||||
"psci-conduit", &error_abort);
|
||||
object_property_set_int(cpuobj, "psci-conduit", QEMU_PSCI_CONDUIT_SMC,
|
||||
&error_abort);
|
||||
|
||||
if (n) {
|
||||
/* Secondary CPUs start in PSCI powered-down state */
|
||||
object_property_set_bool(cpuobj, true,
|
||||
"start-powered-off", &error_abort);
|
||||
object_property_set_bool(cpuobj, "start-powered-off", true,
|
||||
&error_abort);
|
||||
}
|
||||
|
||||
if (object_property_find(cpuobj, "reset-cbar", NULL)) {
|
||||
object_property_set_int(cpuobj, MPCORE_PERIPHBASE,
|
||||
"reset-cbar", &error_abort);
|
||||
object_property_set_int(cpuobj, "reset-cbar", MPCORE_PERIPHBASE,
|
||||
&error_abort);
|
||||
}
|
||||
qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
|
||||
cpu_irq[n] = qdev_get_gpio_in(DEVICE(cpu), ARM_CPU_IRQ);
|
||||
|
|
|
@ -604,7 +604,7 @@ static void integratorcp_init(MachineState *machine)
|
|||
* realization.
|
||||
*/
|
||||
if (object_property_find(cpuobj, "has_el3", NULL)) {
|
||||
object_property_set_bool(cpuobj, false, "has_el3", &error_fatal);
|
||||
object_property_set_bool(cpuobj, "has_el3", false, &error_fatal);
|
||||
}
|
||||
|
||||
qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
|
||||
|
|
|
@ -40,8 +40,8 @@ static void mcimx6ul_evk_init(MachineState *machine)
|
|||
|
||||
s = FSL_IMX6UL(object_new(TYPE_FSL_IMX6UL));
|
||||
object_property_add_child(OBJECT(machine), "soc", OBJECT(s));
|
||||
object_property_set_uint(OBJECT(s), 2, "fec1-phy-num", &error_fatal);
|
||||
object_property_set_uint(OBJECT(s), 1, "fec2-phy-num", &error_fatal);
|
||||
object_property_set_uint(OBJECT(s), "fec1-phy-num", 2, &error_fatal);
|
||||
object_property_set_uint(OBJECT(s), "fec2-phy-num", 1, &error_fatal);
|
||||
qdev_realize(DEVICE(s), NULL, &error_fatal);
|
||||
|
||||
memory_region_add_subregion(get_system_memory(), FSL_IMX6UL_MMDC_ADDR,
|
||||
|
|
|
@ -40,8 +40,8 @@ static void microbit_init(MachineState *machine)
|
|||
object_initialize_child(OBJECT(machine), "nrf51", &s->nrf51,
|
||||
TYPE_NRF51_SOC);
|
||||
qdev_prop_set_chr(DEVICE(&s->nrf51), "serial0", serial_hd(0));
|
||||
object_property_set_link(OBJECT(&s->nrf51), OBJECT(system_memory),
|
||||
"memory", &error_fatal);
|
||||
object_property_set_link(OBJECT(&s->nrf51), "memory",
|
||||
OBJECT(system_memory), &error_fatal);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->nrf51), &error_fatal);
|
||||
|
||||
/*
|
||||
|
|
|
@ -265,8 +265,8 @@ static MemoryRegion *make_mpc(MPS2TZMachineState *mms, void *opaque,
|
|||
memory_region_init_ram(ssram, NULL, name, ramsize[i], &error_fatal);
|
||||
|
||||
object_initialize_child(OBJECT(mms), mpcname, mpc, TYPE_TZ_MPC);
|
||||
object_property_set_link(OBJECT(mpc), OBJECT(ssram),
|
||||
"downstream", &error_fatal);
|
||||
object_property_set_link(OBJECT(mpc), "downstream", OBJECT(ssram),
|
||||
&error_fatal);
|
||||
sysbus_realize(SYS_BUS_DEVICE(mpc), &error_fatal);
|
||||
/* Map the upstream end of the MPC into system memory */
|
||||
upstream = sysbus_mmio_get_region(SYS_BUS_DEVICE(mpc), 1);
|
||||
|
@ -308,10 +308,9 @@ static MemoryRegion *make_dma(MPS2TZMachineState *mms, void *opaque,
|
|||
*/
|
||||
object_initialize_child(OBJECT(mms), mscname, msc, TYPE_TZ_MSC);
|
||||
msc_downstream = sysbus_mmio_get_region(SYS_BUS_DEVICE(&mms->iotkit), 0);
|
||||
object_property_set_link(OBJECT(msc), OBJECT(msc_downstream),
|
||||
"downstream", &error_fatal);
|
||||
object_property_set_link(OBJECT(msc), OBJECT(mms),
|
||||
"idau", &error_fatal);
|
||||
object_property_set_link(OBJECT(msc), "downstream",
|
||||
OBJECT(msc_downstream), &error_fatal);
|
||||
object_property_set_link(OBJECT(msc), "idau", OBJECT(mms), &error_fatal);
|
||||
sysbus_realize(SYS_BUS_DEVICE(msc), &error_fatal);
|
||||
|
||||
qdev_connect_gpio_out_named(DEVICE(msc), "irq", 0,
|
||||
|
@ -330,8 +329,8 @@ static MemoryRegion *make_dma(MPS2TZMachineState *mms, void *opaque,
|
|||
msc_upstream = sysbus_mmio_get_region(SYS_BUS_DEVICE(msc), 0);
|
||||
|
||||
object_initialize_child(OBJECT(mms), name, dma, TYPE_PL081);
|
||||
object_property_set_link(OBJECT(dma), OBJECT(msc_upstream),
|
||||
"downstream", &error_fatal);
|
||||
object_property_set_link(OBJECT(dma), "downstream", OBJECT(msc_upstream),
|
||||
&error_fatal);
|
||||
sysbus_realize(SYS_BUS_DEVICE(dma), &error_fatal);
|
||||
|
||||
s = SYS_BUS_DEVICE(dma);
|
||||
|
@ -404,8 +403,8 @@ static void mps2tz_common_init(MachineState *machine)
|
|||
object_initialize_child(OBJECT(machine), TYPE_IOTKIT, &mms->iotkit,
|
||||
mmc->armsse_type);
|
||||
iotkitdev = DEVICE(&mms->iotkit);
|
||||
object_property_set_link(OBJECT(&mms->iotkit), OBJECT(system_memory),
|
||||
"memory", &error_abort);
|
||||
object_property_set_link(OBJECT(&mms->iotkit), "memory",
|
||||
OBJECT(system_memory), &error_abort);
|
||||
qdev_prop_set_uint32(iotkitdev, "EXP_NUMIRQ", MPS2TZ_NUMIRQ);
|
||||
qdev_prop_set_uint32(iotkitdev, "MAINCLK", SYSCLK_FRQ);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&mms->iotkit), &error_fatal);
|
||||
|
@ -425,7 +424,7 @@ static void mps2tz_common_init(MachineState *machine)
|
|||
NULL);
|
||||
g_free(name);
|
||||
|
||||
object_property_set_int(OBJECT(splitter), 2, "num-lines",
|
||||
object_property_set_int(OBJECT(splitter), "num-lines", 2,
|
||||
&error_fatal);
|
||||
qdev_realize(DEVICE(splitter), NULL, &error_fatal);
|
||||
qdev_connect_gpio_out(DEVICE(splitter), 0,
|
||||
|
@ -442,9 +441,9 @@ static void mps2tz_common_init(MachineState *machine)
|
|||
*/
|
||||
object_initialize_child(OBJECT(machine), "sec-resp-splitter",
|
||||
&mms->sec_resp_splitter, TYPE_SPLIT_IRQ);
|
||||
object_property_set_int(OBJECT(&mms->sec_resp_splitter),
|
||||
object_property_set_int(OBJECT(&mms->sec_resp_splitter), "num-lines",
|
||||
ARRAY_SIZE(mms->ppc) + ARRAY_SIZE(mms->msc),
|
||||
"num-lines", &error_fatal);
|
||||
&error_fatal);
|
||||
qdev_realize(DEVICE(&mms->sec_resp_splitter), NULL, &error_fatal);
|
||||
dev_splitter = DEVICE(&mms->sec_resp_splitter);
|
||||
qdev_connect_gpio_out_named(iotkitdev, "sec_resp_cfg", 0,
|
||||
|
@ -475,7 +474,7 @@ static void mps2tz_common_init(MachineState *machine)
|
|||
*/
|
||||
object_initialize_child(OBJECT(mms), "uart-irq-orgate",
|
||||
&mms->uart_irq_orgate, TYPE_OR_IRQ);
|
||||
object_property_set_int(OBJECT(&mms->uart_irq_orgate), 10, "num-lines",
|
||||
object_property_set_int(OBJECT(&mms->uart_irq_orgate), "num-lines", 10,
|
||||
&error_fatal);
|
||||
qdev_realize(DEVICE(&mms->uart_irq_orgate), NULL, &error_fatal);
|
||||
qdev_connect_gpio_out(DEVICE(&mms->uart_irq_orgate), 0,
|
||||
|
@ -568,8 +567,8 @@ static void mps2tz_common_init(MachineState *machine)
|
|||
|
||||
mr = pinfo->devfn(mms, pinfo->opaque, pinfo->name, pinfo->size);
|
||||
portname = g_strdup_printf("port[%d]", port);
|
||||
object_property_set_link(OBJECT(ppc), OBJECT(mr),
|
||||
portname, &error_fatal);
|
||||
object_property_set_link(OBJECT(ppc), portname, OBJECT(mr),
|
||||
&error_fatal);
|
||||
g_free(portname);
|
||||
}
|
||||
|
||||
|
|
|
@ -203,8 +203,8 @@ static void mps2_common_init(MachineState *machine)
|
|||
}
|
||||
qdev_prop_set_string(armv7m, "cpu-type", machine->cpu_type);
|
||||
qdev_prop_set_bit(armv7m, "enable-bitband", true);
|
||||
object_property_set_link(OBJECT(&mms->armv7m), OBJECT(system_memory),
|
||||
"memory", &error_abort);
|
||||
object_property_set_link(OBJECT(&mms->armv7m), "memory",
|
||||
OBJECT(system_memory), &error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&mms->armv7m), &error_fatal);
|
||||
|
||||
create_unimplemented_device("zbtsmram mirror", 0x00400000, 0x00400000);
|
||||
|
@ -237,7 +237,7 @@ static void mps2_common_init(MachineState *machine)
|
|||
DeviceState *orgate_dev;
|
||||
|
||||
orgate = object_new(TYPE_OR_IRQ);
|
||||
object_property_set_int(orgate, 6, "num-lines", &error_fatal);
|
||||
object_property_set_int(orgate, "num-lines", 6, &error_fatal);
|
||||
qdev_realize(DEVICE(orgate), NULL, &error_fatal);
|
||||
orgate_dev = DEVICE(orgate);
|
||||
qdev_connect_gpio_out(orgate_dev, 0, qdev_get_gpio_in(armv7m, 12));
|
||||
|
@ -273,7 +273,7 @@ static void mps2_common_init(MachineState *machine)
|
|||
DeviceState *orgate_dev;
|
||||
|
||||
orgate = object_new(TYPE_OR_IRQ);
|
||||
object_property_set_int(orgate, 10, "num-lines", &error_fatal);
|
||||
object_property_set_int(orgate, "num-lines", 10, &error_fatal);
|
||||
qdev_realize(DEVICE(orgate), NULL, &error_fatal);
|
||||
orgate_dev = DEVICE(orgate);
|
||||
qdev_connect_gpio_out(orgate_dev, 0, qdev_get_gpio_in(armv7m, 12));
|
||||
|
@ -288,7 +288,7 @@ static void mps2_common_init(MachineState *machine)
|
|||
DeviceState *txrx_orgate_dev;
|
||||
|
||||
txrx_orgate = object_new(TYPE_OR_IRQ);
|
||||
object_property_set_int(txrx_orgate, 2, "num-lines", &error_fatal);
|
||||
object_property_set_int(txrx_orgate, "num-lines", 2, &error_fatal);
|
||||
qdev_realize(DEVICE(txrx_orgate), NULL, &error_fatal);
|
||||
txrx_orgate_dev = DEVICE(txrx_orgate);
|
||||
qdev_connect_gpio_out(txrx_orgate_dev, 0,
|
||||
|
@ -356,7 +356,7 @@ static void mps2_common_init(MachineState *machine)
|
|||
int j;
|
||||
|
||||
orgate = object_new(TYPE_OR_IRQ);
|
||||
object_property_set_int(orgate, 2, "num-lines", &error_fatal);
|
||||
object_property_set_int(orgate, "num-lines", 2, &error_fatal);
|
||||
orgate_dev = DEVICE(orgate);
|
||||
qdev_realize(orgate_dev, NULL, &error_fatal);
|
||||
qdev_connect_gpio_out(orgate_dev, 0,
|
||||
|
|
|
@ -93,7 +93,6 @@ static void m2sxxx_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
MSF2State *s = MSF2_SOC(dev_soc);
|
||||
DeviceState *dev, *armv7m;
|
||||
SysBusDevice *busdev;
|
||||
Error *err = NULL;
|
||||
int i;
|
||||
|
||||
MemoryRegion *system_memory = get_system_memory();
|
||||
|
@ -123,11 +122,9 @@ static void m2sxxx_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
qdev_prop_set_uint32(armv7m, "num-irq", 81);
|
||||
qdev_prop_set_string(armv7m, "cpu-type", s->cpu_type);
|
||||
qdev_prop_set_bit(armv7m, "enable-bitband", true);
|
||||
object_property_set_link(OBJECT(&s->armv7m), OBJECT(get_system_memory()),
|
||||
"memory", &error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->armv7m), &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
object_property_set_link(OBJECT(&s->armv7m), "memory",
|
||||
OBJECT(get_system_memory()), &error_abort);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->armv7m), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -153,9 +150,7 @@ static void m2sxxx_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
dev = DEVICE(&s->timer);
|
||||
/* APB0 clock is the timer input clock */
|
||||
qdev_prop_set_uint32(dev, "clock-frequency", s->m3clk / s->apb0div);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->timer), &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->timer), errp)) {
|
||||
return;
|
||||
}
|
||||
busdev = SYS_BUS_DEVICE(dev);
|
||||
|
@ -168,9 +163,7 @@ static void m2sxxx_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
dev = DEVICE(&s->sysreg);
|
||||
qdev_prop_set_uint32(dev, "apb0divisor", s->apb0div);
|
||||
qdev_prop_set_uint32(dev, "apb1divisor", s->apb1div);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->sysreg), &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->sysreg), errp)) {
|
||||
return;
|
||||
}
|
||||
busdev = SYS_BUS_DEVICE(dev);
|
||||
|
@ -179,9 +172,7 @@ static void m2sxxx_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
for (i = 0; i < MSF2_NUM_SPIS; i++) {
|
||||
gchar *bus_name;
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -197,11 +188,9 @@ static void m2sxxx_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
}
|
||||
|
||||
dev = DEVICE(&s->emac);
|
||||
object_property_set_link(OBJECT(&s->emac), OBJECT(get_system_memory()),
|
||||
"ahb-bus", &error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->emac), &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
object_property_set_link(OBJECT(&s->emac), "ahb-bus",
|
||||
OBJECT(get_system_memory()), &error_abort);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->emac), errp)) {
|
||||
return;
|
||||
}
|
||||
busdev = SYS_BUS_DEVICE(dev);
|
||||
|
|
|
@ -256,8 +256,8 @@ static MemoryRegion *make_mpc(MuscaMachineState *mms, void *opaque,
|
|||
}
|
||||
|
||||
object_initialize_child(OBJECT(mms), mpcname, mpc, TYPE_TZ_MPC);
|
||||
object_property_set_link(OBJECT(mpc), OBJECT(downstream),
|
||||
"downstream", &error_fatal);
|
||||
object_property_set_link(OBJECT(mpc), "downstream", OBJECT(downstream),
|
||||
&error_fatal);
|
||||
sysbus_realize(SYS_BUS_DEVICE(mpc), &error_fatal);
|
||||
/* Map the upstream end of the MPC into system memory */
|
||||
upstream = sysbus_mmio_get_region(SYS_BUS_DEVICE(mpc), 1);
|
||||
|
@ -374,8 +374,8 @@ static void musca_init(MachineState *machine)
|
|||
object_initialize_child(OBJECT(machine), "sse-200", &mms->sse,
|
||||
TYPE_SSE200);
|
||||
ssedev = DEVICE(&mms->sse);
|
||||
object_property_set_link(OBJECT(&mms->sse), OBJECT(system_memory),
|
||||
"memory", &error_fatal);
|
||||
object_property_set_link(OBJECT(&mms->sse), "memory",
|
||||
OBJECT(system_memory), &error_fatal);
|
||||
qdev_prop_set_uint32(ssedev, "EXP_NUMIRQ", mmc->num_irqs);
|
||||
qdev_prop_set_uint32(ssedev, "init-svtor", mmc->init_svtor);
|
||||
qdev_prop_set_uint32(ssedev, "SRAM_ADDR_WIDTH", mmc->sram_addr_width);
|
||||
|
@ -403,7 +403,7 @@ static void musca_init(MachineState *machine)
|
|||
&error_fatal, NULL);
|
||||
g_free(name);
|
||||
|
||||
object_property_set_int(OBJECT(splitter), 2, "num-lines",
|
||||
object_property_set_int(OBJECT(splitter), "num-lines", 2,
|
||||
&error_fatal);
|
||||
qdev_realize(DEVICE(splitter), NULL, &error_fatal);
|
||||
qdev_connect_gpio_out(DEVICE(splitter), 0,
|
||||
|
@ -422,8 +422,8 @@ static void musca_init(MachineState *machine)
|
|||
sizeof(mms->sec_resp_splitter),
|
||||
TYPE_SPLIT_IRQ, &error_fatal, NULL);
|
||||
|
||||
object_property_set_int(OBJECT(&mms->sec_resp_splitter),
|
||||
ARRAY_SIZE(mms->ppc), "num-lines", &error_fatal);
|
||||
object_property_set_int(OBJECT(&mms->sec_resp_splitter), "num-lines",
|
||||
ARRAY_SIZE(mms->ppc), &error_fatal);
|
||||
qdev_realize(DEVICE(&mms->sec_resp_splitter), NULL, &error_fatal);
|
||||
dev_splitter = DEVICE(&mms->sec_resp_splitter);
|
||||
qdev_connect_gpio_out_named(ssedev, "sec_resp_cfg", 0,
|
||||
|
@ -541,8 +541,8 @@ static void musca_init(MachineState *machine)
|
|||
|
||||
mr = pinfo->devfn(mms, pinfo->opaque, pinfo->name, pinfo->size);
|
||||
portname = g_strdup_printf("port[%d]", port);
|
||||
object_property_set_link(OBJECT(ppc), OBJECT(mr),
|
||||
portname, &error_fatal);
|
||||
object_property_set_link(OBJECT(ppc), portname, OBJECT(mr),
|
||||
&error_fatal);
|
||||
g_free(portname);
|
||||
}
|
||||
|
||||
|
|
|
@ -1690,8 +1690,8 @@ static void musicpal_init(MachineState *machine)
|
|||
wm8750_dev = i2c_create_slave(i2c, TYPE_WM8750, MP_WM_ADDR);
|
||||
dev = qdev_new(TYPE_MV88W8618_AUDIO);
|
||||
s = SYS_BUS_DEVICE(dev);
|
||||
object_property_set_link(OBJECT(dev), OBJECT(wm8750_dev),
|
||||
"wm8750", NULL);
|
||||
object_property_set_link(OBJECT(dev), "wm8750", OBJECT(wm8750_dev),
|
||||
NULL);
|
||||
sysbus_realize_and_unref(s, &error_fatal);
|
||||
sysbus_mmio_map(s, 0, MP_AUDIO_BASE);
|
||||
sysbus_connect_irq(s, 0, pic[MP_AUDIO_IRQ]);
|
||||
|
|
|
@ -65,11 +65,9 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
return;
|
||||
}
|
||||
|
||||
object_property_set_link(OBJECT(&s->cpu), OBJECT(&s->container), "memory",
|
||||
object_property_set_link(OBJECT(&s->cpu), "memory", OBJECT(&s->container),
|
||||
&error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->cpu), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->cpu), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -84,9 +82,7 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
memory_region_add_subregion(&s->container, NRF51_SRAM_BASE, &s->sram);
|
||||
|
||||
/* UART */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->uart), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->uart), errp)) {
|
||||
return;
|
||||
}
|
||||
mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->uart), 0);
|
||||
|
@ -96,9 +92,7 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
BASE_TO_IRQ(NRF51_UART_BASE)));
|
||||
|
||||
/* RNG */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->rng), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->rng), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -109,16 +103,12 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
BASE_TO_IRQ(NRF51_RNG_BASE)));
|
||||
|
||||
/* UICR, FICR, NVMC, FLASH */
|
||||
object_property_set_uint(OBJECT(&s->nvm), s->flash_size, "flash-size",
|
||||
&err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_uint(OBJECT(&s->nvm), "flash-size",
|
||||
s->flash_size, errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->nvm), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->nvm), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -132,9 +122,7 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
memory_region_add_subregion_overlap(&s->container, NRF51_FLASH_BASE, mr, 0);
|
||||
|
||||
/* GPIO */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->gpio), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -146,14 +134,10 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
|
||||
/* TIMER */
|
||||
for (i = 0; i < NRF51_NUM_TIMERS; i++) {
|
||||
object_property_set_uint(OBJECT(&s->timer[i]), i, "id", &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_uint(OBJECT(&s->timer[i]), "id", i, errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->timer[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->timer[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -63,9 +63,8 @@ static void orangepi_init(MachineState *machine)
|
|||
object_unref(OBJECT(h3));
|
||||
|
||||
/* Setup timer properties */
|
||||
object_property_set_int(OBJECT(h3), 32768, "clk0-freq",
|
||||
&error_abort);
|
||||
object_property_set_int(OBJECT(h3), 24 * 1000 * 1000, "clk1-freq",
|
||||
object_property_set_int(OBJECT(h3), "clk0-freq", 32768, &error_abort);
|
||||
object_property_set_int(OBJECT(h3), "clk1-freq", 24 * 1000 * 1000,
|
||||
&error_abort);
|
||||
|
||||
/* Setup SID properties. Currently using a default fixed SID identifier. */
|
||||
|
@ -77,12 +76,12 @@ static void orangepi_init(MachineState *machine)
|
|||
}
|
||||
|
||||
/* Setup EMAC properties */
|
||||
object_property_set_int(OBJECT(&h3->emac), 1, "phy-addr", &error_abort);
|
||||
object_property_set_int(OBJECT(&h3->emac), "phy-addr", 1, &error_abort);
|
||||
|
||||
/* DRAMC */
|
||||
object_property_set_uint(OBJECT(h3), h3->memmap[AW_H3_SDRAM],
|
||||
"ram-addr", &error_abort);
|
||||
object_property_set_int(OBJECT(h3), machine->ram_size / MiB, "ram-size",
|
||||
object_property_set_uint(OBJECT(h3), "ram-addr", h3->memmap[AW_H3_SDRAM],
|
||||
&error_abort);
|
||||
object_property_set_int(OBJECT(h3), "ram-size", machine->ram_size / MiB,
|
||||
&error_abort);
|
||||
|
||||
/* Mark H3 object realized */
|
||||
|
|
|
@ -285,7 +285,7 @@ static void raspi_machine_init(MachineState *machine)
|
|||
object_initialize_child(OBJECT(machine), "soc", &s->soc,
|
||||
board_soc_type(board_rev));
|
||||
object_property_add_const_link(OBJECT(&s->soc), "ram", OBJECT(machine->ram));
|
||||
object_property_set_int(OBJECT(&s->soc), board_rev, "board-rev",
|
||||
object_property_set_int(OBJECT(&s->soc), "board-rev", board_rev,
|
||||
&error_abort);
|
||||
qdev_realize(DEVICE(&s->soc), NULL, &error_abort);
|
||||
|
||||
|
|
|
@ -107,11 +107,11 @@ static void realview_init(MachineState *machine,
|
|||
* before realization.
|
||||
*/
|
||||
if (object_property_find(cpuobj, "has_el3", NULL)) {
|
||||
object_property_set_bool(cpuobj, false, "has_el3", &error_fatal);
|
||||
object_property_set_bool(cpuobj, "has_el3", false, &error_fatal);
|
||||
}
|
||||
|
||||
if (is_pb && is_mpcore) {
|
||||
object_property_set_int(cpuobj, periphbase, "reset-cbar",
|
||||
object_property_set_int(cpuobj, "reset-cbar", periphbase,
|
||||
&error_fatal);
|
||||
}
|
||||
|
||||
|
@ -205,7 +205,7 @@ static void realview_init(MachineState *machine,
|
|||
|
||||
/* DMA controller is optional, apparently. */
|
||||
dev = qdev_new("pl081");
|
||||
object_property_set_link(OBJECT(dev), OBJECT(sysmem), "downstream",
|
||||
object_property_set_link(OBJECT(dev), "downstream", OBJECT(sysmem),
|
||||
&error_fatal);
|
||||
busdev = SYS_BUS_DEVICE(dev);
|
||||
sysbus_realize_and_unref(busdev, &error_fatal);
|
||||
|
|
|
@ -499,7 +499,7 @@ static void create_smmu(const SBSAMachineState *sms, PCIBus *bus)
|
|||
|
||||
dev = qdev_new("arm-smmuv3");
|
||||
|
||||
object_property_set_link(OBJECT(dev), OBJECT(bus), "primary-bus",
|
||||
object_property_set_link(OBJECT(dev), "primary-bus", OBJECT(bus),
|
||||
&error_abort);
|
||||
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
|
||||
|
@ -659,8 +659,8 @@ static void sbsa_ref_init(MachineState *machine)
|
|||
}
|
||||
|
||||
cpuobj = object_new(possible_cpus->cpus[n].type);
|
||||
object_property_set_int(cpuobj, possible_cpus->cpus[n].arch_id,
|
||||
"mp-affinity", NULL);
|
||||
object_property_set_int(cpuobj, "mp-affinity",
|
||||
possible_cpus->cpus[n].arch_id, NULL);
|
||||
|
||||
cs = CPU(cpuobj);
|
||||
cs->cpu_index = n;
|
||||
|
@ -669,16 +669,16 @@ static void sbsa_ref_init(MachineState *machine)
|
|||
&error_fatal);
|
||||
|
||||
if (object_property_find(cpuobj, "reset-cbar", NULL)) {
|
||||
object_property_set_int(cpuobj,
|
||||
object_property_set_int(cpuobj, "reset-cbar",
|
||||
sbsa_ref_memmap[SBSA_CPUPERIPHS].base,
|
||||
"reset-cbar", &error_abort);
|
||||
&error_abort);
|
||||
}
|
||||
|
||||
object_property_set_link(cpuobj, OBJECT(sysmem), "memory",
|
||||
object_property_set_link(cpuobj, "memory", OBJECT(sysmem),
|
||||
&error_abort);
|
||||
|
||||
object_property_set_link(cpuobj, OBJECT(secure_sysmem),
|
||||
"secure-memory", &error_abort);
|
||||
object_property_set_link(cpuobj, "secure-memory",
|
||||
OBJECT(secure_sysmem), &error_abort);
|
||||
|
||||
qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
|
||||
object_unref(cpuobj);
|
||||
|
|
|
@ -1312,8 +1312,8 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board)
|
|||
qdev_prop_set_uint32(nvic, "num-irq", NUM_IRQ_LINES);
|
||||
qdev_prop_set_string(nvic, "cpu-type", ms->cpu_type);
|
||||
qdev_prop_set_bit(nvic, "enable-bitband", true);
|
||||
object_property_set_link(OBJECT(nvic), OBJECT(get_system_memory()),
|
||||
"memory", &error_abort);
|
||||
object_property_set_link(OBJECT(nvic), "memory",
|
||||
OBJECT(get_system_memory()), &error_abort);
|
||||
/* This will exit with an error if the user passed us a bad cpu_type */
|
||||
sysbus_realize_and_unref(SYS_BUS_DEVICE(nvic), &error_fatal);
|
||||
|
||||
|
|
|
@ -81,7 +81,6 @@ static void stm32f205_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
STM32F205State *s = STM32F205_SOC(dev_soc);
|
||||
DeviceState *dev, *armv7m;
|
||||
SysBusDevice *busdev;
|
||||
Error *err = NULL;
|
||||
int i;
|
||||
|
||||
MemoryRegion *system_memory = get_system_memory();
|
||||
|
@ -105,19 +104,15 @@ static void stm32f205_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
qdev_prop_set_uint32(armv7m, "num-irq", 96);
|
||||
qdev_prop_set_string(armv7m, "cpu-type", s->cpu_type);
|
||||
qdev_prop_set_bit(armv7m, "enable-bitband", true);
|
||||
object_property_set_link(OBJECT(&s->armv7m), OBJECT(get_system_memory()),
|
||||
"memory", &error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->armv7m), &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
object_property_set_link(OBJECT(&s->armv7m), "memory",
|
||||
OBJECT(get_system_memory()), &error_abort);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->armv7m), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* System configuration controller */
|
||||
dev = DEVICE(&s->syscfg);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->syscfg), &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->syscfg), errp)) {
|
||||
return;
|
||||
}
|
||||
busdev = SYS_BUS_DEVICE(dev);
|
||||
|
@ -128,9 +123,7 @@ static void stm32f205_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
for (i = 0; i < STM_NUM_USARTS; i++) {
|
||||
dev = DEVICE(&(s->usart[i]));
|
||||
qdev_prop_set_chr(dev, "chardev", serial_hd(i));
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->usart[i]), &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->usart[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
busdev = SYS_BUS_DEVICE(dev);
|
||||
|
@ -142,9 +135,7 @@ static void stm32f205_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
for (i = 0; i < STM_NUM_TIMERS; i++) {
|
||||
dev = DEVICE(&(s->timer[i]));
|
||||
qdev_prop_set_uint64(dev, "clock-frequency", 1000000000);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->timer[i]), &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->timer[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
busdev = SYS_BUS_DEVICE(dev);
|
||||
|
@ -153,11 +144,9 @@ static void stm32f205_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
}
|
||||
|
||||
/* ADC 1 to 3 */
|
||||
object_property_set_int(OBJECT(s->adc_irqs), STM_NUM_ADCS,
|
||||
"num-lines", &error_abort);
|
||||
qdev_realize(DEVICE(s->adc_irqs), NULL, &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
object_property_set_int(OBJECT(s->adc_irqs), "num-lines", STM_NUM_ADCS,
|
||||
&error_abort);
|
||||
if (!qdev_realize(DEVICE(s->adc_irqs), NULL, errp)) {
|
||||
return;
|
||||
}
|
||||
qdev_connect_gpio_out(DEVICE(s->adc_irqs), 0,
|
||||
|
@ -165,9 +154,7 @@ static void stm32f205_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
|
||||
for (i = 0; i < STM_NUM_ADCS; i++) {
|
||||
dev = DEVICE(&(s->adc[i]));
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->adc[i]), &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->adc[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
busdev = SYS_BUS_DEVICE(dev);
|
||||
|
@ -179,9 +166,7 @@ static void stm32f205_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
/* SPI 1 and 2 */
|
||||
for (i = 0; i < STM_NUM_SPIS; i++) {
|
||||
dev = DEVICE(&(s->spi[i]));
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
busdev = SYS_BUS_DEVICE(dev);
|
||||
|
|
|
@ -116,19 +116,15 @@ static void stm32f405_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
qdev_prop_set_uint32(armv7m, "num-irq", 96);
|
||||
qdev_prop_set_string(armv7m, "cpu-type", s->cpu_type);
|
||||
qdev_prop_set_bit(armv7m, "enable-bitband", true);
|
||||
object_property_set_link(OBJECT(&s->armv7m), OBJECT(system_memory),
|
||||
"memory", &error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->armv7m), &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
object_property_set_link(OBJECT(&s->armv7m), "memory",
|
||||
OBJECT(system_memory), &error_abort);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->armv7m), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* System configuration controller */
|
||||
dev = DEVICE(&s->syscfg);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->syscfg), &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->syscfg), errp)) {
|
||||
return;
|
||||
}
|
||||
busdev = SYS_BUS_DEVICE(dev);
|
||||
|
@ -139,9 +135,7 @@ static void stm32f405_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
for (i = 0; i < STM_NUM_USARTS; i++) {
|
||||
dev = DEVICE(&(s->usart[i]));
|
||||
qdev_prop_set_chr(dev, "chardev", serial_hd(i));
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->usart[i]), &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->usart[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
busdev = SYS_BUS_DEVICE(dev);
|
||||
|
@ -153,9 +147,7 @@ static void stm32f405_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
for (i = 0; i < STM_NUM_TIMERS; i++) {
|
||||
dev = DEVICE(&(s->timer[i]));
|
||||
qdev_prop_set_uint64(dev, "clock-frequency", 1000000000);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->timer[i]), &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->timer[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
busdev = SYS_BUS_DEVICE(dev);
|
||||
|
@ -164,18 +156,14 @@ static void stm32f405_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
}
|
||||
|
||||
/* ADC device, the IRQs are ORed together */
|
||||
object_initialize_child_with_props(OBJECT(s), "adc-orirq", &s->adc_irqs,
|
||||
sizeof(s->adc_irqs), TYPE_OR_IRQ, &err,
|
||||
NULL);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_initialize_child_with_props(OBJECT(s), "adc-orirq",
|
||||
&s->adc_irqs, sizeof(s->adc_irqs),
|
||||
TYPE_OR_IRQ, errp, NULL)) {
|
||||
return;
|
||||
}
|
||||
object_property_set_int(OBJECT(&s->adc_irqs), STM_NUM_ADCS,
|
||||
"num-lines", &error_abort);
|
||||
qdev_realize(DEVICE(&s->adc_irqs), NULL, &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
object_property_set_int(OBJECT(&s->adc_irqs), "num-lines", STM_NUM_ADCS,
|
||||
&error_abort);
|
||||
if (!qdev_realize(DEVICE(&s->adc_irqs), NULL, errp)) {
|
||||
return;
|
||||
}
|
||||
qdev_connect_gpio_out(DEVICE(&s->adc_irqs), 0,
|
||||
|
@ -183,9 +171,7 @@ static void stm32f405_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
|
||||
for (i = 0; i < STM_NUM_ADCS; i++) {
|
||||
dev = DEVICE(&(s->adc[i]));
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->adc[i]), &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->adc[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
busdev = SYS_BUS_DEVICE(dev);
|
||||
|
@ -197,9 +183,7 @@ static void stm32f405_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
/* SPI devices */
|
||||
for (i = 0; i < STM_NUM_SPIS; i++) {
|
||||
dev = DEVICE(&(s->spi[i]));
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
busdev = SYS_BUS_DEVICE(dev);
|
||||
|
@ -209,9 +193,7 @@ static void stm32f405_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
|
||||
/* EXTI device */
|
||||
dev = DEVICE(&s->exti);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->exti), &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->exti), errp)) {
|
||||
return;
|
||||
}
|
||||
busdev = SYS_BUS_DEVICE(dev);
|
||||
|
|
|
@ -213,7 +213,7 @@ static void versatile_init(MachineState *machine, int board_id)
|
|||
* realization.
|
||||
*/
|
||||
if (object_property_find(cpuobj, "has_el3", NULL)) {
|
||||
object_property_set_bool(cpuobj, false, "has_el3", &error_fatal);
|
||||
object_property_set_bool(cpuobj, "has_el3", false, &error_fatal);
|
||||
}
|
||||
|
||||
qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
|
||||
|
@ -288,7 +288,7 @@ static void versatile_init(MachineState *machine, int board_id)
|
|||
pl011_create(0x10009000, sic[6], serial_hd(3));
|
||||
|
||||
dev = qdev_new("pl080");
|
||||
object_property_set_link(OBJECT(dev), OBJECT(sysmem), "downstream",
|
||||
object_property_set_link(OBJECT(dev), "downstream", OBJECT(sysmem),
|
||||
&error_fatal);
|
||||
busdev = SYS_BUS_DEVICE(dev);
|
||||
sysbus_realize_and_unref(busdev, &error_fatal);
|
||||
|
|
|
@ -218,17 +218,17 @@ static void init_cpus(MachineState *ms, const char *cpu_type,
|
|||
Object *cpuobj = object_new(cpu_type);
|
||||
|
||||
if (!secure) {
|
||||
object_property_set_bool(cpuobj, false, "has_el3", NULL);
|
||||
object_property_set_bool(cpuobj, "has_el3", false, NULL);
|
||||
}
|
||||
if (!virt) {
|
||||
if (object_property_find(cpuobj, "has_el2", NULL)) {
|
||||
object_property_set_bool(cpuobj, false, "has_el2", NULL);
|
||||
object_property_set_bool(cpuobj, "has_el2", false, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (object_property_find(cpuobj, "reset-cbar", NULL)) {
|
||||
object_property_set_int(cpuobj, periphbase,
|
||||
"reset-cbar", &error_abort);
|
||||
object_property_set_int(cpuobj, "reset-cbar", periphbase,
|
||||
&error_abort);
|
||||
}
|
||||
qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
|
||||
}
|
||||
|
|
|
@ -594,7 +594,7 @@ static void create_its(VirtMachineState *vms)
|
|||
|
||||
dev = qdev_new(itsclass);
|
||||
|
||||
object_property_set_link(OBJECT(dev), OBJECT(vms->gic), "parent-gicv3",
|
||||
object_property_set_link(OBJECT(dev), "parent-gicv3", OBJECT(vms->gic),
|
||||
&error_abort);
|
||||
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, vms->memmap[VIRT_GIC_ITS].base);
|
||||
|
@ -1175,7 +1175,7 @@ static void create_smmu(const VirtMachineState *vms,
|
|||
|
||||
dev = qdev_new("arm-smmuv3");
|
||||
|
||||
object_property_set_link(OBJECT(dev), OBJECT(bus), "primary-bus",
|
||||
object_property_set_link(OBJECT(dev), "primary-bus", OBJECT(bus),
|
||||
&error_abort);
|
||||
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
|
||||
|
@ -1785,8 +1785,8 @@ static void machvirt_init(MachineState *machine)
|
|||
}
|
||||
|
||||
cpuobj = object_new(possible_cpus->cpus[n].type);
|
||||
object_property_set_int(cpuobj, possible_cpus->cpus[n].arch_id,
|
||||
"mp-affinity", NULL);
|
||||
object_property_set_int(cpuobj, "mp-affinity",
|
||||
possible_cpus->cpus[n].arch_id, NULL);
|
||||
|
||||
cs = CPU(cpuobj);
|
||||
cs->cpu_index = n;
|
||||
|
@ -1797,43 +1797,44 @@ static void machvirt_init(MachineState *machine)
|
|||
aarch64 &= object_property_get_bool(cpuobj, "aarch64", NULL);
|
||||
|
||||
if (!vms->secure) {
|
||||
object_property_set_bool(cpuobj, false, "has_el3", NULL);
|
||||
object_property_set_bool(cpuobj, "has_el3", false, NULL);
|
||||
}
|
||||
|
||||
if (!vms->virt && object_property_find(cpuobj, "has_el2", NULL)) {
|
||||
object_property_set_bool(cpuobj, false, "has_el2", NULL);
|
||||
object_property_set_bool(cpuobj, "has_el2", false, NULL);
|
||||
}
|
||||
|
||||
if (vms->psci_conduit != QEMU_PSCI_CONDUIT_DISABLED) {
|
||||
object_property_set_int(cpuobj, vms->psci_conduit,
|
||||
"psci-conduit", NULL);
|
||||
object_property_set_int(cpuobj, "psci-conduit", vms->psci_conduit,
|
||||
NULL);
|
||||
|
||||
/* Secondary CPUs start in PSCI powered-down state */
|
||||
if (n > 0) {
|
||||
object_property_set_bool(cpuobj, true,
|
||||
"start-powered-off", NULL);
|
||||
object_property_set_bool(cpuobj, "start-powered-off", true,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (vmc->kvm_no_adjvtime &&
|
||||
object_property_find(cpuobj, "kvm-no-adjvtime", NULL)) {
|
||||
object_property_set_bool(cpuobj, true, "kvm-no-adjvtime", NULL);
|
||||
object_property_set_bool(cpuobj, "kvm-no-adjvtime", true, NULL);
|
||||
}
|
||||
|
||||
if (vmc->no_pmu && object_property_find(cpuobj, "pmu", NULL)) {
|
||||
object_property_set_bool(cpuobj, false, "pmu", NULL);
|
||||
object_property_set_bool(cpuobj, "pmu", false, NULL);
|
||||
}
|
||||
|
||||
if (object_property_find(cpuobj, "reset-cbar", NULL)) {
|
||||
object_property_set_int(cpuobj, vms->memmap[VIRT_CPUPERIPHS].base,
|
||||
"reset-cbar", &error_abort);
|
||||
object_property_set_int(cpuobj, "reset-cbar",
|
||||
vms->memmap[VIRT_CPUPERIPHS].base,
|
||||
&error_abort);
|
||||
}
|
||||
|
||||
object_property_set_link(cpuobj, OBJECT(sysmem), "memory",
|
||||
object_property_set_link(cpuobj, "memory", OBJECT(sysmem),
|
||||
&error_abort);
|
||||
if (vms->secure) {
|
||||
object_property_set_link(cpuobj, OBJECT(secure_sysmem),
|
||||
"secure-memory", &error_abort);
|
||||
object_property_set_link(cpuobj, "secure-memory",
|
||||
OBJECT(secure_sysmem), &error_abort);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1857,11 +1858,12 @@ static void machvirt_init(MachineState *machine)
|
|||
}
|
||||
}
|
||||
|
||||
object_property_set_link(cpuobj, OBJECT(tag_sysmem),
|
||||
"tag-memory", &error_abort);
|
||||
object_property_set_link(cpuobj, "tag-memory", OBJECT(tag_sysmem),
|
||||
&error_abort);
|
||||
if (vms->secure) {
|
||||
object_property_set_link(cpuobj, OBJECT(secure_tag_sysmem),
|
||||
"secure-tag-memory", &error_abort);
|
||||
object_property_set_link(cpuobj, "secure-tag-memory",
|
||||
OBJECT(secure_tag_sysmem),
|
||||
&error_abort);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -196,12 +196,12 @@ static void zynq_init(MachineState *machine)
|
|||
* realization.
|
||||
*/
|
||||
if (object_property_find(OBJECT(cpu), "has_el3", NULL)) {
|
||||
object_property_set_bool(OBJECT(cpu), false, "has_el3", &error_fatal);
|
||||
object_property_set_bool(OBJECT(cpu), "has_el3", false, &error_fatal);
|
||||
}
|
||||
|
||||
object_property_set_int(OBJECT(cpu), ZYNQ_BOARD_MIDR, "midr",
|
||||
object_property_set_int(OBJECT(cpu), "midr", ZYNQ_BOARD_MIDR,
|
||||
&error_fatal);
|
||||
object_property_set_int(OBJECT(cpu), MPCORE_PERIPHBASE, "reset-cbar",
|
||||
object_property_set_int(OBJECT(cpu), "reset-cbar", MPCORE_PERIPHBASE,
|
||||
&error_fatal);
|
||||
qdev_realize(DEVICE(cpu), NULL, &error_fatal);
|
||||
|
||||
|
|
|
@ -502,10 +502,10 @@ static void versal_virt_init(MachineState *machine)
|
|||
|
||||
object_initialize_child(OBJECT(machine), "xlnx-versal", &s->soc,
|
||||
TYPE_XLNX_VERSAL);
|
||||
object_property_set_link(OBJECT(&s->soc), OBJECT(machine->ram),
|
||||
"ddr", &error_abort);
|
||||
object_property_set_int(OBJECT(&s->soc), psci_conduit,
|
||||
"psci-conduit", &error_abort);
|
||||
object_property_set_link(OBJECT(&s->soc), "ddr", OBJECT(machine->ram),
|
||||
&error_abort);
|
||||
object_property_set_int(OBJECT(&s->soc), "psci-conduit", psci_conduit,
|
||||
&error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->soc), &error_fatal);
|
||||
|
||||
fdt_create(s);
|
||||
|
|
|
@ -35,17 +35,17 @@ static void versal_create_apu_cpus(Versal *s)
|
|||
object_initialize_child(OBJECT(s), "apu-cpu[*]", &s->fpd.apu.cpu[i],
|
||||
XLNX_VERSAL_ACPU_TYPE);
|
||||
obj = OBJECT(&s->fpd.apu.cpu[i]);
|
||||
object_property_set_int(obj, s->cfg.psci_conduit,
|
||||
"psci-conduit", &error_abort);
|
||||
object_property_set_int(obj, "psci-conduit", s->cfg.psci_conduit,
|
||||
&error_abort);
|
||||
if (i) {
|
||||
/* Secondary CPUs start in PSCI powered-down state */
|
||||
object_property_set_bool(obj, true,
|
||||
"start-powered-off", &error_abort);
|
||||
object_property_set_bool(obj, "start-powered-off", true,
|
||||
&error_abort);
|
||||
}
|
||||
|
||||
object_property_set_int(obj, ARRAY_SIZE(s->fpd.apu.cpu),
|
||||
"core-count", &error_abort);
|
||||
object_property_set_link(obj, OBJECT(&s->fpd.apu.mr), "memory",
|
||||
object_property_set_int(obj, "core-count", ARRAY_SIZE(s->fpd.apu.cpu),
|
||||
&error_abort);
|
||||
object_property_set_link(obj, "memory", OBJECT(&s->fpd.apu.mr),
|
||||
&error_abort);
|
||||
qdev_realize(DEVICE(obj), NULL, &error_fatal);
|
||||
}
|
||||
|
@ -164,11 +164,9 @@ static void versal_create_gems(Versal *s, qemu_irq *pic)
|
|||
qemu_check_nic_model(nd, "cadence_gem");
|
||||
qdev_set_nic_properties(dev, nd);
|
||||
}
|
||||
object_property_set_int(OBJECT(dev),
|
||||
2, "num-priority-queues",
|
||||
object_property_set_int(OBJECT(dev), "num-priority-queues", 2,
|
||||
&error_abort);
|
||||
object_property_set_link(OBJECT(dev),
|
||||
OBJECT(&s->mr_ps), "dma",
|
||||
object_property_set_link(OBJECT(dev), "dma", OBJECT(&s->mr_ps),
|
||||
&error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(dev), &error_fatal);
|
||||
|
||||
|
@ -192,7 +190,7 @@ static void versal_create_admas(Versal *s, qemu_irq *pic)
|
|||
object_initialize_child(OBJECT(s), name, &s->lpd.iou.adma[i],
|
||||
TYPE_XLNX_ZDMA);
|
||||
dev = DEVICE(&s->lpd.iou.adma[i]);
|
||||
object_property_set_int(OBJECT(dev), 128, "bus-width", &error_abort);
|
||||
object_property_set_int(OBJECT(dev), "bus-width", 128, &error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(dev), &error_fatal);
|
||||
|
||||
mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0);
|
||||
|
@ -217,11 +215,11 @@ static void versal_create_sds(Versal *s, qemu_irq *pic)
|
|||
TYPE_SYSBUS_SDHCI);
|
||||
dev = DEVICE(&s->pmc.iou.sd[i]);
|
||||
|
||||
object_property_set_uint(OBJECT(dev),
|
||||
3, "sd-spec-version", &error_fatal);
|
||||
object_property_set_uint(OBJECT(dev), SDHCI_CAPABILITIES, "capareg",
|
||||
object_property_set_uint(OBJECT(dev), "sd-spec-version", 3,
|
||||
&error_fatal);
|
||||
object_property_set_uint(OBJECT(dev), UHS_I, "uhs", &error_fatal);
|
||||
object_property_set_uint(OBJECT(dev), "capareg", SDHCI_CAPABILITIES,
|
||||
&error_fatal);
|
||||
object_property_set_uint(OBJECT(dev), "uhs", UHS_I, &error_fatal);
|
||||
sysbus_realize(SYS_BUS_DEVICE(dev), &error_fatal);
|
||||
|
||||
mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0);
|
||||
|
|
|
@ -118,11 +118,11 @@ static void xlnx_zcu102_init(MachineState *machine)
|
|||
|
||||
object_initialize_child(OBJECT(machine), "soc", &s->soc, TYPE_XLNX_ZYNQMP);
|
||||
|
||||
object_property_set_link(OBJECT(&s->soc), OBJECT(machine->ram),
|
||||
"ddr-ram", &error_abort);
|
||||
object_property_set_bool(OBJECT(&s->soc), s->secure, "secure",
|
||||
object_property_set_link(OBJECT(&s->soc), "ddr-ram", OBJECT(machine->ram),
|
||||
&error_abort);
|
||||
object_property_set_bool(OBJECT(&s->soc), "secure", s->secure,
|
||||
&error_fatal);
|
||||
object_property_set_bool(OBJECT(&s->soc), s->virt, "virtualization",
|
||||
object_property_set_bool(OBJECT(&s->soc), "virtualization", s->virt,
|
||||
&error_fatal);
|
||||
|
||||
qdev_realize(DEVICE(&s->soc), NULL, &error_fatal);
|
||||
|
|
|
@ -176,7 +176,6 @@ static inline int arm_gic_ppi_index(int cpu_nr, int ppi_index)
|
|||
static void xlnx_zynqmp_create_rpu(MachineState *ms, XlnxZynqMPState *s,
|
||||
const char *boot_cpu, Error **errp)
|
||||
{
|
||||
Error *err = NULL;
|
||||
int i;
|
||||
int num_rpus = MIN(ms->smp.cpus - XLNX_ZYNQMP_NUM_APU_CPUS,
|
||||
XLNX_ZYNQMP_NUM_RPU_CPUS);
|
||||
|
@ -200,18 +199,16 @@ static void xlnx_zynqmp_create_rpu(MachineState *ms, XlnxZynqMPState *s,
|
|||
name = object_get_canonical_path_component(OBJECT(&s->rpu_cpu[i]));
|
||||
if (strcmp(name, boot_cpu)) {
|
||||
/* Secondary CPUs start in PSCI powered-down state */
|
||||
object_property_set_bool(OBJECT(&s->rpu_cpu[i]), true,
|
||||
"start-powered-off", &error_abort);
|
||||
object_property_set_bool(OBJECT(&s->rpu_cpu[i]),
|
||||
"start-powered-off", true, &error_abort);
|
||||
} else {
|
||||
s->boot_cpu_ptr = &s->rpu_cpu[i];
|
||||
}
|
||||
g_free(name);
|
||||
|
||||
object_property_set_bool(OBJECT(&s->rpu_cpu[i]), true, "reset-hivecs",
|
||||
object_property_set_bool(OBJECT(&s->rpu_cpu[i]), "reset-hivecs", true,
|
||||
&error_abort);
|
||||
qdev_realize(DEVICE(&s->rpu_cpu[i]), NULL, &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!qdev_realize(DEVICE(&s->rpu_cpu[i]), NULL, errp)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -346,37 +343,33 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
|
|||
for (i = 0; i < num_apus; i++) {
|
||||
char *name;
|
||||
|
||||
object_property_set_int(OBJECT(&s->apu_cpu[i]), QEMU_PSCI_CONDUIT_SMC,
|
||||
"psci-conduit", &error_abort);
|
||||
object_property_set_int(OBJECT(&s->apu_cpu[i]), "psci-conduit",
|
||||
QEMU_PSCI_CONDUIT_SMC, &error_abort);
|
||||
|
||||
name = object_get_canonical_path_component(OBJECT(&s->apu_cpu[i]));
|
||||
if (strcmp(name, boot_cpu)) {
|
||||
/* Secondary CPUs start in PSCI powered-down state */
|
||||
object_property_set_bool(OBJECT(&s->apu_cpu[i]), true,
|
||||
"start-powered-off", &error_abort);
|
||||
object_property_set_bool(OBJECT(&s->apu_cpu[i]),
|
||||
"start-powered-off", true, &error_abort);
|
||||
} else {
|
||||
s->boot_cpu_ptr = &s->apu_cpu[i];
|
||||
}
|
||||
g_free(name);
|
||||
|
||||
object_property_set_bool(OBJECT(&s->apu_cpu[i]),
|
||||
s->secure, "has_el3", NULL);
|
||||
object_property_set_bool(OBJECT(&s->apu_cpu[i]),
|
||||
s->virt, "has_el2", NULL);
|
||||
object_property_set_int(OBJECT(&s->apu_cpu[i]), GIC_BASE_ADDR,
|
||||
"reset-cbar", &error_abort);
|
||||
object_property_set_int(OBJECT(&s->apu_cpu[i]), num_apus,
|
||||
"core-count", &error_abort);
|
||||
qdev_realize(DEVICE(&s->apu_cpu[i]), NULL, &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
object_property_set_bool(OBJECT(&s->apu_cpu[i]), "has_el3", s->secure,
|
||||
NULL);
|
||||
object_property_set_bool(OBJECT(&s->apu_cpu[i]), "has_el2", s->virt,
|
||||
NULL);
|
||||
object_property_set_int(OBJECT(&s->apu_cpu[i]), "reset-cbar",
|
||||
GIC_BASE_ADDR, &error_abort);
|
||||
object_property_set_int(OBJECT(&s->apu_cpu[i]), "core-count",
|
||||
num_apus, &error_abort);
|
||||
if (!qdev_realize(DEVICE(&s->apu_cpu[i]), NULL, errp)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->gic), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->gic), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -466,13 +459,11 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
|
|||
qemu_check_nic_model(nd, TYPE_CADENCE_GEM);
|
||||
qdev_set_nic_properties(DEVICE(&s->gem[i]), nd);
|
||||
}
|
||||
object_property_set_int(OBJECT(&s->gem[i]), GEM_REVISION, "revision",
|
||||
object_property_set_int(OBJECT(&s->gem[i]), "revision", GEM_REVISION,
|
||||
&error_abort);
|
||||
object_property_set_int(OBJECT(&s->gem[i]), 2, "num-priority-queues",
|
||||
object_property_set_int(OBJECT(&s->gem[i]), "num-priority-queues", 2,
|
||||
&error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->gem[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->gem[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->gem[i]), 0, gem_addr[i]);
|
||||
|
@ -482,9 +473,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
|
|||
|
||||
for (i = 0; i < XLNX_ZYNQMP_NUM_UARTS; i++) {
|
||||
qdev_prop_set_chr(DEVICE(&s->uart[i]), "chardev", serial_hd(i));
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->uart[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->uart[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->uart[i]), 0, uart_addr[i]);
|
||||
|
@ -492,11 +481,9 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
|
|||
gic_spi[uart_intr[i]]);
|
||||
}
|
||||
|
||||
object_property_set_int(OBJECT(&s->sata), SATA_NUM_PORTS, "num-ports",
|
||||
object_property_set_int(OBJECT(&s->sata), "num-ports", SATA_NUM_PORTS,
|
||||
&error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->sata), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->sata), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -513,24 +500,17 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
|
|||
* - SDIO Specification Version 3.0
|
||||
* - eMMC Specification Version 4.51
|
||||
*/
|
||||
object_property_set_uint(sdhci, 3, "sd-spec-version", &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_uint(sdhci, "sd-spec-version", 3, errp)) {
|
||||
return;
|
||||
}
|
||||
object_property_set_uint(sdhci, SDHCI_CAPABILITIES, "capareg", &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_uint(sdhci, "capareg", SDHCI_CAPABILITIES,
|
||||
errp)) {
|
||||
return;
|
||||
}
|
||||
object_property_set_uint(sdhci, UHS_I, "uhs", &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_uint(sdhci, "uhs", UHS_I, errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_realize(SYS_BUS_DEVICE(sdhci), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(sdhci), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(sbd, 0, sdhci_addr[i]);
|
||||
|
@ -545,9 +525,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
|
|||
for (i = 0; i < XLNX_ZYNQMP_NUM_SPIS; i++) {
|
||||
gchar *bus_name;
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -562,9 +540,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
|
|||
g_free(bus_name);
|
||||
}
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->qspi), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->qspi), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->qspi), 0, QSPI_ADDR);
|
||||
|
@ -584,49 +560,38 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
|
|||
g_free(target_bus);
|
||||
}
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->dp), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->dp), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->dp), 0, DP_ADDR);
|
||||
sysbus_connect_irq(SYS_BUS_DEVICE(&s->dp), 0, gic_spi[DP_IRQ]);
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->dpdma), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->dpdma), errp)) {
|
||||
return;
|
||||
}
|
||||
object_property_set_link(OBJECT(&s->dp), OBJECT(&s->dpdma), "dpdma",
|
||||
object_property_set_link(OBJECT(&s->dp), "dpdma", OBJECT(&s->dpdma),
|
||||
&error_abort);
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->dpdma), 0, DPDMA_ADDR);
|
||||
sysbus_connect_irq(SYS_BUS_DEVICE(&s->dpdma), 0, gic_spi[DPDMA_IRQ]);
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->ipi), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->ipi), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->ipi), 0, IPI_ADDR);
|
||||
sysbus_connect_irq(SYS_BUS_DEVICE(&s->ipi), 0, gic_spi[IPI_IRQ]);
|
||||
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->rtc), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->rtc), errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->rtc), 0, RTC_ADDR);
|
||||
sysbus_connect_irq(SYS_BUS_DEVICE(&s->rtc), 0, gic_spi[RTC_IRQ]);
|
||||
|
||||
for (i = 0; i < XLNX_ZYNQMP_NUM_GDMA_CH; i++) {
|
||||
object_property_set_uint(OBJECT(&s->gdma[i]), 128, "bus-width", &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!object_property_set_uint(OBJECT(&s->gdma[i]), "bus-width", 128,
|
||||
errp)) {
|
||||
return;
|
||||
}
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->gdma[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->gdma[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -636,9 +601,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
|
|||
}
|
||||
|
||||
for (i = 0; i < XLNX_ZYNQMP_NUM_ADMA_CH; i++) {
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->adma[i]), &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->adma[i]), errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue