提交 0765691e 编写于 作者: M Markus Armbruster

cpus hw target: Use warn_report() & friends to report warnings

Calling error_report() in a function that takes an Error ** argument
is suspicious.  Convert a few that are actually warnings to
warn_report().

While there, split a warning consisting of multiple sentences to
conform to conventions spelled out in warn_report()'s contract.

Cc: Alex Bennée <alex.bennee@linaro.org>
Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Fam Zheng <famz@redhat.com>
Cc: Wei Huang <wei@redhat.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Acked-by: NDavid Gibson <david@gibson.dropbear.id.au>
Reviewed-by: NAlex Bennée <alex.bennee@linaro.org>
Message-Id: <20181017082702.5581-5-armbru@redhat.com>
上级 5197f445
...@@ -211,12 +211,12 @@ void qemu_tcg_configure(QemuOpts *opts, Error **errp) ...@@ -211,12 +211,12 @@ void qemu_tcg_configure(QemuOpts *opts, Error **errp)
error_setg(errp, "No MTTCG when icount is enabled"); error_setg(errp, "No MTTCG when icount is enabled");
} else { } else {
#ifndef TARGET_SUPPORTS_MTTCG #ifndef TARGET_SUPPORTS_MTTCG
error_report("Guest not yet converted to MTTCG - " warn_report("Guest not yet converted to MTTCG - "
"you may get unexpected results"); "you may get unexpected results");
#endif #endif
if (!check_tcg_memory_orders_compatible()) { if (!check_tcg_memory_orders_compatible()) {
error_report("Guest expects a stronger memory ordering " warn_report("Guest expects a stronger memory ordering "
"than the host provides"); "than the host provides");
error_printf("This may cause strange/hard to debug errors\n"); error_printf("This may cause strange/hard to debug errors\n");
} }
mttcg_enabled = true; mttcg_enabled = true;
......
...@@ -307,7 +307,7 @@ static void cg3_realizefn(DeviceState *dev, Error **errp) ...@@ -307,7 +307,7 @@ static void cg3_realizefn(DeviceState *dev, Error **errp)
ret = load_image_mr(fcode_filename, &s->rom); ret = load_image_mr(fcode_filename, &s->rom);
g_free(fcode_filename); g_free(fcode_filename);
if (ret < 0 || ret > FCODE_MAX_ROM_SIZE) { if (ret < 0 || ret > FCODE_MAX_ROM_SIZE) {
error_report("cg3: could not load prom '%s'", CG3_ROM_FILE); warn_report("cg3: could not load prom '%s'", CG3_ROM_FILE);
} }
} }
......
...@@ -823,7 +823,7 @@ static void tcx_realizefn(DeviceState *dev, Error **errp) ...@@ -823,7 +823,7 @@ static void tcx_realizefn(DeviceState *dev, Error **errp)
ret = load_image_mr(fcode_filename, &s->rom); ret = load_image_mr(fcode_filename, &s->rom);
g_free(fcode_filename); g_free(fcode_filename);
if (ret < 0 || ret > FCODE_MAX_ROM_SIZE) { if (ret < 0 || ret > FCODE_MAX_ROM_SIZE) {
error_report("tcx: could not load prom '%s'", TCX_ROM_FILE); warn_report("tcx: could not load prom '%s'", TCX_ROM_FILE);
} }
} }
......
...@@ -1288,8 +1288,8 @@ static void ivshmem_realize(PCIDevice *dev, Error **errp) ...@@ -1288,8 +1288,8 @@ static void ivshmem_realize(PCIDevice *dev, Error **errp)
IVShmemState *s = IVSHMEM_COMMON(dev); IVShmemState *s = IVSHMEM_COMMON(dev);
if (!qtest_enabled()) { if (!qtest_enabled()) {
error_report("ivshmem is deprecated, please use ivshmem-plain" warn_report("ivshmem is deprecated, please use ivshmem-plain"
" or ivshmem-doorbell instead"); " or ivshmem-doorbell instead");
} }
if (qemu_chr_fe_backend_connected(&s->server_chr) + !!s->shmobj != 1) { if (qemu_chr_fe_backend_connected(&s->server_chr) + !!s->shmobj != 1) {
......
...@@ -2020,10 +2020,10 @@ static void virtio_net_device_realize(DeviceState *dev, Error **errp) ...@@ -2020,10 +2020,10 @@ static void virtio_net_device_realize(DeviceState *dev, Error **errp)
if (n->net_conf.tx && strcmp(n->net_conf.tx, "timer") if (n->net_conf.tx && strcmp(n->net_conf.tx, "timer")
&& strcmp(n->net_conf.tx, "bh")) { && strcmp(n->net_conf.tx, "bh")) {
error_report("virtio-net: " warn_report("virtio-net: "
"Unknown option tx=%s, valid options: \"timer\" \"bh\"", "Unknown option tx=%s, valid options: \"timer\" \"bh\"",
n->net_conf.tx); n->net_conf.tx);
error_report("Defaulting to \"bh\""); error_printf("Defaulting to \"bh\"");
} }
n->net_conf.tx_queue_size = MIN(virtio_net_max_tx_queue_size(n), n->net_conf.tx_queue_size = MIN(virtio_net_max_tx_queue_size(n),
......
...@@ -1683,8 +1683,8 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp) ...@@ -1683,8 +1683,8 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp)
if (err) { if (err) {
/* Notice when a system that supports MSIx can't initialize it */ /* Notice when a system that supports MSIx can't initialize it */
if (err != -ENOTSUP) { if (err != -ENOTSUP) {
error_report("unable to init msix vectors to %" PRIu32, warn_report("unable to init msix vectors to %" PRIu32,
proxy->nvectors); proxy->nvectors);
} }
proxy->nvectors = 0; proxy->nvectors = 0;
} }
......
...@@ -5123,14 +5123,15 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp) ...@@ -5123,14 +5123,15 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
* NOTE: the following code has to follow qemu_init_vcpu(). Otherwise * NOTE: the following code has to follow qemu_init_vcpu(). Otherwise
* cs->nr_threads hasn't be populated yet and the checking is incorrect. * cs->nr_threads hasn't be populated yet and the checking is incorrect.
*/ */
if (IS_AMD_CPU(env) && if (IS_AMD_CPU(env) &&
!(env->features[FEAT_8000_0001_ECX] & CPUID_EXT3_TOPOEXT) && !(env->features[FEAT_8000_0001_ECX] & CPUID_EXT3_TOPOEXT) &&
cs->nr_threads > 1 && !ht_warned) { cs->nr_threads > 1 && !ht_warned) {
error_report("This family of AMD CPU doesn't support " warn_report("This family of AMD CPU doesn't support "
"hyperthreading(%d). Please configure -smp " "hyperthreading(%d)",
"options properly or try enabling topoext feature.", cs->nr_threads);
cs->nr_threads); error_printf("Please configure -smp options properly"
ht_warned = true; " or try enabling topoext feature.\n");
ht_warned = true;
} }
x86_cpu_apic_realize(cpu, &local_err); x86_cpu_apic_realize(cpu, &local_err);
......
...@@ -8381,8 +8381,8 @@ static void getset_compat_deprecated(Object *obj, Visitor *v, const char *name, ...@@ -8381,8 +8381,8 @@ static void getset_compat_deprecated(Object *obj, Visitor *v, const char *name,
QNull *null = NULL; QNull *null = NULL;
if (!qtest_enabled()) { if (!qtest_enabled()) {
error_report("CPU 'compat' property is deprecated and has no effect; " warn_report("CPU 'compat' property is deprecated and has no effect; "
"use max-cpu-compat machine property instead"); "use max-cpu-compat machine property instead");
} }
visit_type_null(v, name, &null, NULL); visit_type_null(v, name, &null, NULL);
qobject_unref(null); qobject_unref(null);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册