* [Qemu-devel] [PULL for-2.0 00/11] Trivial patches for 2014-04-08
@ 2014-04-08 7:04 ` Michael Tokarev
0 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 7:04 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev
This is the last-minute trivial-patches tree. We're very close to
release now, and here are mostly doc/comment/identation fixes which
are safe even at this stage of the release process. There's also
addition of the coverity model which does not affect code in any way.
And there's a series of 3 patches by Peter Maydell which adds casts
to uint* in a few places. Those are also quite simple and safe, even
with quite some disagreement about whenever this is necessary to
start with -- I mean the int128 change, the other changes are good.
At least this way we make it consistent with other parts of the code.
Please consider pulling/applying.
Thanks,
/mjt
The following changes since commit 466e6e9d13d56bbb6da1d2396d7d6347df483af0:
target-i386: reorder fields in cpu/msr_hyperv_hypercall subsection (2014-04-05 10:49:05 +0100)
are available in the git repository at:
git://git.corpit.ru/qemu.git tags/trivial-patches-2014-04-08
for you to fetch changes up to cd791dd1090680dba795940fe5ef80699102ae0b:
Fix grammar in comment (2014-04-08 10:56:10 +0400)
----------------------------------------------------------------
trivial patches for 2014-04-08
----------------------------------------------------------------
Amos Kong (1):
qga: trivial fix for unclear documentation of guest-set-time
Chen Gang (1):
vl: Report accelerator not supported for target more nicely
Hani Benhabiles (1):
net: Report error when device / hub combo is not found.
Michael Tokarev (1):
doc: grammify "allows to"
Paolo Bonzini (1):
scripts: add sample model file for Coverity Scan
Peter Maydell (4):
configure: Fix indentation of help for --enable/disable-debug-info
hw/ide/ahci.c: Avoid shift left into sign bit
int128.h: Avoid undefined behaviours involving signed arithmetic
xbzrle.c: Avoid undefined behaviour with signed arithmetic
Stefan Weil (2):
configure: Remove redundant message for -Werror
Fix grammar in comment
configure | 5 +-
hw/i2c/smbus_eeprom.c | 2 +-
hw/ide/ahci.c | 4 +-
include/qemu/int128.h | 4 +-
net/net.c | 4 +-
qemu-doc.texi | 2 +-
qemu-options.hx | 5 +-
qga/commands-posix.c | 2 +-
qga/qapi-schema.json | 14 ++--
scripts/coverity-model.c | 183 ++++++++++++++++++++++++++++++++++++++++++++++
vl.c | 2 +-
xbzrle.c | 8 +-
12 files changed, 211 insertions(+), 24 deletions(-)
create mode 100644 scripts/coverity-model.c
^ permalink raw reply [flat|nested] 36+ messages in thread* [Qemu-trivial] [PULL 01/11] vl: Report accelerator not supported for target more nicely
2014-04-08 7:04 ` [Qemu-devel] " Michael Tokarev
@ 2014-04-08 7:04 ` Michael Tokarev
-1 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 7:04 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Chen Gang
From: Chen Gang <gang.chen.5i5j@gmail.com>
When you ask for an accelerator not supported for your target, you get
a bogus "accelerator does not exist" message:
$ qemu-system-arm -machine none,accel=kvm
KVM not supported for this target
"kvm" accelerator does not exist.
No accelerator found!
Suppress it.
Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
vl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vl.c b/vl.c
index 9975e5a..db9ea90 100644
--- a/vl.c
+++ b/vl.c
@@ -2740,7 +2740,7 @@ static int configure_accelerator(QEMUMachine *machine)
if (!accel_list[i].available()) {
printf("%s not supported for this target\n",
accel_list[i].name);
- continue;
+ break;
}
*(accel_list[i].allowed) = true;
ret = accel_list[i].init(machine);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 36+ messages in thread* [Qemu-devel] [PULL 01/11] vl: Report accelerator not supported for target more nicely
@ 2014-04-08 7:04 ` Michael Tokarev
0 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 7:04 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Chen Gang
From: Chen Gang <gang.chen.5i5j@gmail.com>
When you ask for an accelerator not supported for your target, you get
a bogus "accelerator does not exist" message:
$ qemu-system-arm -machine none,accel=kvm
KVM not supported for this target
"kvm" accelerator does not exist.
No accelerator found!
Suppress it.
Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
vl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vl.c b/vl.c
index 9975e5a..db9ea90 100644
--- a/vl.c
+++ b/vl.c
@@ -2740,7 +2740,7 @@ static int configure_accelerator(QEMUMachine *machine)
if (!accel_list[i].available()) {
printf("%s not supported for this target\n",
accel_list[i].name);
- continue;
+ break;
}
*(accel_list[i].allowed) = true;
ret = accel_list[i].init(machine);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 36+ messages in thread* Re: [Qemu-trivial] [PULL 01/11] vl: Report accelerator not supported for target more nicely
2014-04-08 7:04 ` [Qemu-devel] " Michael Tokarev
@ 2014-04-08 7:18 ` Chen Gang
-1 siblings, 0 replies; 36+ messages in thread
From: Chen Gang @ 2014-04-08 7:18 UTC (permalink / raw)
To: Michael Tokarev, qemu-devel; +Cc: qemu-trivial
Thanks, and I will/should finish the left trivial patches within this
week (2014-04-13)
On 04/08/2014 03:04 PM, Michael Tokarev wrote:
> From: Chen Gang <gang.chen.5i5j@gmail.com>
>
> When you ask for an accelerator not supported for your target, you get
> a bogus "accelerator does not exist" message:
>
> $ qemu-system-arm -machine none,accel=kvm
> KVM not supported for this target
> "kvm" accelerator does not exist.
> No accelerator found!
>
> Suppress it.
>
> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
> ---
> vl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/vl.c b/vl.c
> index 9975e5a..db9ea90 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -2740,7 +2740,7 @@ static int configure_accelerator(QEMUMachine *machine)
> if (!accel_list[i].available()) {
> printf("%s not supported for this target\n",
> accel_list[i].name);
> - continue;
> + break;
> }
> *(accel_list[i].allowed) = true;
> ret = accel_list[i].init(machine);
>
--
Chen Gang
Open, share, and attitude like air, water, and life which God blessed
^ permalink raw reply [flat|nested] 36+ messages in thread* Re: [Qemu-devel] [PULL 01/11] vl: Report accelerator not supported for target more nicely
@ 2014-04-08 7:18 ` Chen Gang
0 siblings, 0 replies; 36+ messages in thread
From: Chen Gang @ 2014-04-08 7:18 UTC (permalink / raw)
To: Michael Tokarev, qemu-devel; +Cc: qemu-trivial
Thanks, and I will/should finish the left trivial patches within this
week (2014-04-13)
On 04/08/2014 03:04 PM, Michael Tokarev wrote:
> From: Chen Gang <gang.chen.5i5j@gmail.com>
>
> When you ask for an accelerator not supported for your target, you get
> a bogus "accelerator does not exist" message:
>
> $ qemu-system-arm -machine none,accel=kvm
> KVM not supported for this target
> "kvm" accelerator does not exist.
> No accelerator found!
>
> Suppress it.
>
> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
> ---
> vl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/vl.c b/vl.c
> index 9975e5a..db9ea90 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -2740,7 +2740,7 @@ static int configure_accelerator(QEMUMachine *machine)
> if (!accel_list[i].available()) {
> printf("%s not supported for this target\n",
> accel_list[i].name);
> - continue;
> + break;
> }
> *(accel_list[i].allowed) = true;
> ret = accel_list[i].init(machine);
>
--
Chen Gang
Open, share, and attitude like air, water, and life which God blessed
^ permalink raw reply [flat|nested] 36+ messages in thread
* [Qemu-trivial] [PULL 02/11] qga: trivial fix for unclear documentation of guest-set-time
2014-04-08 7:04 ` [Qemu-devel] " Michael Tokarev
@ 2014-04-08 7:04 ` Michael Tokarev
-1 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 7:04 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev
From: Amos Kong <akong@redhat.com>
We mixed the use of "guest time", "system time", "hardware time",
"RTC" in documentation, it's unclear.
This patch just added two remarks of RTC and replace two "guest time"
by "guest's system time".
Signed-off-by: Amos Kong <akong@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
qga/commands-posix.c | 2 +-
qga/qapi-schema.json | 14 +++++++-------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 6b5f11f..935a4ec 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -171,7 +171,7 @@ void qmp_guest_set_time(bool has_time, int64_t time_ns, Error **errp)
/* Now, if user has passed a time to set and the system time is set, we
* just need to synchronize the hardware clock. However, if no time was
* passed, user is requesting the opposite: set the system time from the
- * hardware clock. */
+ * hardware clock (RTC). */
pid = fork();
if (pid == 0) {
setsid();
diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
index 80edca1..a8cdcb3 100644
--- a/qga/qapi-schema.json
+++ b/qga/qapi-schema.json
@@ -96,8 +96,8 @@
##
# @guest-get-time:
#
-# Get the information about guest time relative to the Epoch
-# of 1970-01-01 in UTC.
+# Get the information about guest's System Time relative to
+# the Epoch of 1970-01-01 in UTC.
#
# Returns: Time in nanoseconds.
#
@@ -117,11 +117,11 @@
# gap was, NTP might not be able to resynchronize the
# guest.
#
-# This command tries to set guest time to the given value,
-# then sets the Hardware Clock to the current System Time.
-# This will make it easier for a guest to resynchronize
-# without waiting for NTP. If no @time is specified, then
-# the time to set is read from RTC.
+# This command tries to set guest's System Time to the
+# given value, then sets the Hardware Clock (RTC) to the
+# current System Time. This will make it easier for a guest
+# to resynchronize without waiting for NTP. If no @time is
+# specified, then the time to set is read from RTC.
#
# @time: #optional time of nanoseconds, relative to the Epoch
# of 1970-01-01 in UTC.
--
1.7.10.4
^ permalink raw reply related [flat|nested] 36+ messages in thread* [Qemu-devel] [PULL 02/11] qga: trivial fix for unclear documentation of guest-set-time
@ 2014-04-08 7:04 ` Michael Tokarev
0 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 7:04 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Amos Kong, Michael Tokarev
From: Amos Kong <akong@redhat.com>
We mixed the use of "guest time", "system time", "hardware time",
"RTC" in documentation, it's unclear.
This patch just added two remarks of RTC and replace two "guest time"
by "guest's system time".
Signed-off-by: Amos Kong <akong@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
qga/commands-posix.c | 2 +-
qga/qapi-schema.json | 14 +++++++-------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 6b5f11f..935a4ec 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -171,7 +171,7 @@ void qmp_guest_set_time(bool has_time, int64_t time_ns, Error **errp)
/* Now, if user has passed a time to set and the system time is set, we
* just need to synchronize the hardware clock. However, if no time was
* passed, user is requesting the opposite: set the system time from the
- * hardware clock. */
+ * hardware clock (RTC). */
pid = fork();
if (pid == 0) {
setsid();
diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
index 80edca1..a8cdcb3 100644
--- a/qga/qapi-schema.json
+++ b/qga/qapi-schema.json
@@ -96,8 +96,8 @@
##
# @guest-get-time:
#
-# Get the information about guest time relative to the Epoch
-# of 1970-01-01 in UTC.
+# Get the information about guest's System Time relative to
+# the Epoch of 1970-01-01 in UTC.
#
# Returns: Time in nanoseconds.
#
@@ -117,11 +117,11 @@
# gap was, NTP might not be able to resynchronize the
# guest.
#
-# This command tries to set guest time to the given value,
-# then sets the Hardware Clock to the current System Time.
-# This will make it easier for a guest to resynchronize
-# without waiting for NTP. If no @time is specified, then
-# the time to set is read from RTC.
+# This command tries to set guest's System Time to the
+# given value, then sets the Hardware Clock (RTC) to the
+# current System Time. This will make it easier for a guest
+# to resynchronize without waiting for NTP. If no @time is
+# specified, then the time to set is read from RTC.
#
# @time: #optional time of nanoseconds, relative to the Epoch
# of 1970-01-01 in UTC.
--
1.7.10.4
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [Qemu-trivial] [PULL 03/11] configure: Fix indentation of help for --enable/disable-debug-info
2014-04-08 7:04 ` [Qemu-devel] " Michael Tokarev
@ 2014-04-08 7:04 ` Michael Tokarev
-1 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 7:04 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Peter Maydell, Michael Tokarev
From: Peter Maydell <peter.maydell@linaro.org>
The help text for the --enable-debug-info and --disable-debug-info
command line options was misindented: delete the stray extra space
and bring it in to line with everything else.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
configure | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index eb0e7bb..31fd3ad 100755
--- a/configure
+++ b/configure
@@ -1217,8 +1217,8 @@ Advanced options (experts only):
--enable-modules enable modules support
--enable-debug-tcg enable TCG debugging
--disable-debug-tcg disable TCG debugging (default)
- --enable-debug-info enable debugging information (default)
- --disable-debug-info disable debugging information
+ --enable-debug-info enable debugging information (default)
+ --disable-debug-info disable debugging information
--enable-debug enable common debug build options
--enable-sparse enable sparse checker
--disable-sparse disable sparse checker (default)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [Qemu-devel] [PULL 03/11] configure: Fix indentation of help for --enable/disable-debug-info
@ 2014-04-08 7:04 ` Michael Tokarev
0 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 7:04 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Peter Maydell, Michael Tokarev
From: Peter Maydell <peter.maydell@linaro.org>
The help text for the --enable-debug-info and --disable-debug-info
command line options was misindented: delete the stray extra space
and bring it in to line with everything else.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
configure | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index eb0e7bb..31fd3ad 100755
--- a/configure
+++ b/configure
@@ -1217,8 +1217,8 @@ Advanced options (experts only):
--enable-modules enable modules support
--enable-debug-tcg enable TCG debugging
--disable-debug-tcg disable TCG debugging (default)
- --enable-debug-info enable debugging information (default)
- --disable-debug-info disable debugging information
+ --enable-debug-info enable debugging information (default)
+ --disable-debug-info disable debugging information
--enable-debug enable common debug build options
--enable-sparse enable sparse checker
--disable-sparse disable sparse checker (default)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [Qemu-trivial] [PULL 04/11] net: Report error when device / hub combo is not found.
2014-04-08 7:04 ` [Qemu-devel] " Michael Tokarev
@ 2014-04-08 7:04 ` Michael Tokarev
-1 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 7:04 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-trivial, Hani Benhabiles, Michael Tokarev, Hani Benhabiles
From: Hani Benhabiles <kroosec@gmail.com>
Also convert nearby monitor_printf() call to error_report().
Signed-off-by: Hani Benhabiles <hani@linux.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
net/net.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/net.c b/net/net.c
index e3ef1e4..a4aadff 100644
--- a/net/net.c
+++ b/net/net.c
@@ -952,10 +952,12 @@ void net_host_device_remove(Monitor *mon, const QDict *qdict)
nc = net_hub_find_client_by_name(vlan_id, device);
if (!nc) {
+ error_report("Host network device '%s' on hub '%d' not found",
+ device, vlan_id);
return;
}
if (!net_host_check_device(nc->model)) {
- monitor_printf(mon, "invalid host network device %s\n", device);
+ error_report("invalid host network device '%s'", device);
return;
}
qemu_del_net_client(nc);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 36+ messages in thread* [Qemu-devel] [PULL 04/11] net: Report error when device / hub combo is not found.
@ 2014-04-08 7:04 ` Michael Tokarev
0 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 7:04 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-trivial, Hani Benhabiles, Michael Tokarev, Hani Benhabiles
From: Hani Benhabiles <kroosec@gmail.com>
Also convert nearby monitor_printf() call to error_report().
Signed-off-by: Hani Benhabiles <hani@linux.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
net/net.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/net.c b/net/net.c
index e3ef1e4..a4aadff 100644
--- a/net/net.c
+++ b/net/net.c
@@ -952,10 +952,12 @@ void net_host_device_remove(Monitor *mon, const QDict *qdict)
nc = net_hub_find_client_by_name(vlan_id, device);
if (!nc) {
+ error_report("Host network device '%s' on hub '%d' not found",
+ device, vlan_id);
return;
}
if (!net_host_check_device(nc->model)) {
- monitor_printf(mon, "invalid host network device %s\n", device);
+ error_report("invalid host network device '%s'", device);
return;
}
qemu_del_net_client(nc);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [Qemu-trivial] [PULL 05/11] hw/ide/ahci.c: Avoid shift left into sign bit
2014-04-08 7:04 ` [Qemu-devel] " Michael Tokarev
@ 2014-04-08 7:04 ` Michael Tokarev
-1 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 7:04 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Peter Maydell, Michael Tokarev
From: Peter Maydell <peter.maydell@linaro.org>
Add U suffix to avoid shifting left into the sign bit, which
is undefined behaviour.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/ide/ahci.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index bfe633f..50327ff 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -438,9 +438,9 @@ static void check_cmd(AHCIState *s, int port)
if ((pr->cmd & PORT_CMD_START) && pr->cmd_issue) {
for (slot = 0; (slot < 32) && pr->cmd_issue; slot++) {
- if ((pr->cmd_issue & (1 << slot)) &&
+ if ((pr->cmd_issue & (1U << slot)) &&
!handle_cmd(s, port, slot)) {
- pr->cmd_issue &= ~(1 << slot);
+ pr->cmd_issue &= ~(1U << slot);
}
}
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 36+ messages in thread* [Qemu-devel] [PULL 05/11] hw/ide/ahci.c: Avoid shift left into sign bit
@ 2014-04-08 7:04 ` Michael Tokarev
0 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 7:04 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Peter Maydell, Michael Tokarev
From: Peter Maydell <peter.maydell@linaro.org>
Add U suffix to avoid shifting left into the sign bit, which
is undefined behaviour.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/ide/ahci.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index bfe633f..50327ff 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -438,9 +438,9 @@ static void check_cmd(AHCIState *s, int port)
if ((pr->cmd & PORT_CMD_START) && pr->cmd_issue) {
for (slot = 0; (slot < 32) && pr->cmd_issue; slot++) {
- if ((pr->cmd_issue & (1 << slot)) &&
+ if ((pr->cmd_issue & (1U << slot)) &&
!handle_cmd(s, port, slot)) {
- pr->cmd_issue &= ~(1 << slot);
+ pr->cmd_issue &= ~(1U << slot);
}
}
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [Qemu-trivial] [PULL 06/11] int128.h: Avoid undefined behaviours involving signed arithmetic
2014-04-08 7:04 ` [Qemu-devel] " Michael Tokarev
@ 2014-04-08 7:04 ` Michael Tokarev
-1 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 7:04 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Peter Maydell, Michael Tokarev
From: Peter Maydell <peter.maydell@linaro.org>
Add casts when we're performing arithmetic on the .hi parts of an
Int128, to avoid undefined behaviour.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
include/qemu/int128.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/qemu/int128.h b/include/qemu/int128.h
index 9ed47aa..f597031 100644
--- a/include/qemu/int128.h
+++ b/include/qemu/int128.h
@@ -53,7 +53,7 @@ static inline Int128 int128_rshift(Int128 a, int n)
if (n >= 64) {
return (Int128) { h, h >> 63 };
} else {
- return (Int128) { (a.lo >> n) | (a.hi << (64 - n)), h };
+ return (Int128) { (a.lo >> n) | ((uint64_t)a.hi << (64 - n)), h };
}
}
@@ -78,7 +78,7 @@ static inline Int128 int128_neg(Int128 a)
static inline Int128 int128_sub(Int128 a, Int128 b)
{
- return (Int128){ a.lo - b.lo, a.hi - b.hi - (a.lo < b.lo) };
+ return (Int128){ a.lo - b.lo, (uint64_t)a.hi - b.hi - (a.lo < b.lo) };
}
static inline bool int128_nonneg(Int128 a)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 36+ messages in thread* [Qemu-devel] [PULL 06/11] int128.h: Avoid undefined behaviours involving signed arithmetic
@ 2014-04-08 7:04 ` Michael Tokarev
0 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 7:04 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Peter Maydell, Michael Tokarev
From: Peter Maydell <peter.maydell@linaro.org>
Add casts when we're performing arithmetic on the .hi parts of an
Int128, to avoid undefined behaviour.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
include/qemu/int128.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/qemu/int128.h b/include/qemu/int128.h
index 9ed47aa..f597031 100644
--- a/include/qemu/int128.h
+++ b/include/qemu/int128.h
@@ -53,7 +53,7 @@ static inline Int128 int128_rshift(Int128 a, int n)
if (n >= 64) {
return (Int128) { h, h >> 63 };
} else {
- return (Int128) { (a.lo >> n) | (a.hi << (64 - n)), h };
+ return (Int128) { (a.lo >> n) | ((uint64_t)a.hi << (64 - n)), h };
}
}
@@ -78,7 +78,7 @@ static inline Int128 int128_neg(Int128 a)
static inline Int128 int128_sub(Int128 a, Int128 b)
{
- return (Int128){ a.lo - b.lo, a.hi - b.hi - (a.lo < b.lo) };
+ return (Int128){ a.lo - b.lo, (uint64_t)a.hi - b.hi - (a.lo < b.lo) };
}
static inline bool int128_nonneg(Int128 a)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [Qemu-trivial] [PULL 07/11] xbzrle.c: Avoid undefined behaviour with signed arithmetic
2014-04-08 7:04 ` [Qemu-devel] " Michael Tokarev
@ 2014-04-08 7:04 ` Michael Tokarev
-1 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 7:04 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Peter Maydell, Michael Tokarev
From: Peter Maydell <peter.maydell@linaro.org>
Use unsigned types for doing bitwise arithmetic in the xzbrle
calculations, to avoid undefined behaviour:
xbzrle.c:99:49: runtime error: left shift of 72340172838076673
by 7 places cannot be represented in type 'long'
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
xbzrle.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/xbzrle.c b/xbzrle.c
index fbcb35d..8e220bf 100644
--- a/xbzrle.c
+++ b/xbzrle.c
@@ -28,7 +28,7 @@ int xbzrle_encode_buffer(uint8_t *old_buf, uint8_t *new_buf, int slen,
{
uint32_t zrun_len = 0, nzrun_len = 0;
int d = 0, i = 0;
- long res, xor;
+ long res;
uint8_t *nzrun_start = NULL;
g_assert(!(((uintptr_t)old_buf | (uintptr_t)new_buf | slen) %
@@ -93,9 +93,11 @@ int xbzrle_encode_buffer(uint8_t *old_buf, uint8_t *new_buf, int slen,
/* word at a time for speed, use of 32-bit long okay */
if (!res) {
/* truncation to 32-bit long okay */
- long mask = (long)0x0101010101010101ULL;
+ unsigned long mask = (unsigned long)0x0101010101010101ULL;
while (i < slen) {
- xor = *(long *)(old_buf + i) ^ *(long *)(new_buf + i);
+ unsigned long xor;
+ xor = *(unsigned long *)(old_buf + i)
+ ^ *(unsigned long *)(new_buf + i);
if ((xor - mask) & ~xor & (mask << 7)) {
/* found the end of an nzrun within the current long */
while (old_buf[i] != new_buf[i]) {
--
1.7.10.4
^ permalink raw reply related [flat|nested] 36+ messages in thread* [Qemu-devel] [PULL 07/11] xbzrle.c: Avoid undefined behaviour with signed arithmetic
@ 2014-04-08 7:04 ` Michael Tokarev
0 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 7:04 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Peter Maydell, Michael Tokarev
From: Peter Maydell <peter.maydell@linaro.org>
Use unsigned types for doing bitwise arithmetic in the xzbrle
calculations, to avoid undefined behaviour:
xbzrle.c:99:49: runtime error: left shift of 72340172838076673
by 7 places cannot be represented in type 'long'
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
xbzrle.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/xbzrle.c b/xbzrle.c
index fbcb35d..8e220bf 100644
--- a/xbzrle.c
+++ b/xbzrle.c
@@ -28,7 +28,7 @@ int xbzrle_encode_buffer(uint8_t *old_buf, uint8_t *new_buf, int slen,
{
uint32_t zrun_len = 0, nzrun_len = 0;
int d = 0, i = 0;
- long res, xor;
+ long res;
uint8_t *nzrun_start = NULL;
g_assert(!(((uintptr_t)old_buf | (uintptr_t)new_buf | slen) %
@@ -93,9 +93,11 @@ int xbzrle_encode_buffer(uint8_t *old_buf, uint8_t *new_buf, int slen,
/* word at a time for speed, use of 32-bit long okay */
if (!res) {
/* truncation to 32-bit long okay */
- long mask = (long)0x0101010101010101ULL;
+ unsigned long mask = (unsigned long)0x0101010101010101ULL;
while (i < slen) {
- xor = *(long *)(old_buf + i) ^ *(long *)(new_buf + i);
+ unsigned long xor;
+ xor = *(unsigned long *)(old_buf + i)
+ ^ *(unsigned long *)(new_buf + i);
if ((xor - mask) & ~xor & (mask << 7)) {
/* found the end of an nzrun within the current long */
while (old_buf[i] != new_buf[i]) {
--
1.7.10.4
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [Qemu-trivial] [PULL 08/11] scripts: add sample model file for Coverity Scan
2014-04-08 7:04 ` [Qemu-devel] " Michael Tokarev
@ 2014-04-08 7:04 ` Michael Tokarev
-1 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 7:04 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-trivial, Paolo Bonzini, Michael Tokarev, Markus Armbruster
From: Paolo Bonzini <pbonzini@redhat.com>
This is the model file that is being used for the QEMU project's scans
on scan.coverity.com. It fixed about 30 false positives (10% of the
total) and exposed about 60 new memory leaks.
The file is not automatically used; changes to it must be propagated
to the website manually by an admin (right now Markus, Peter and me
are admins).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
scripts/coverity-model.c | 183 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 183 insertions(+)
create mode 100644 scripts/coverity-model.c
diff --git a/scripts/coverity-model.c b/scripts/coverity-model.c
new file mode 100644
index 0000000..4c99a85
--- /dev/null
+++ b/scripts/coverity-model.c
@@ -0,0 +1,183 @@
+/* Coverity Scan model
+ *
+ * Copyright (C) 2014 Red Hat, Inc.
+ *
+ * Authors:
+ * Markus Armbruster <armbru@redhat.com>
+ * Paolo Bonzini <pbonzini@redhat.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or, at your
+ * option, any later version. See the COPYING file in the top-level directory.
+ */
+
+
+/*
+ * This is the source code for our Coverity user model file. The
+ * purpose of user models is to increase scanning accuracy by explaining
+ * code Coverity can't see (out of tree libraries) or doesn't
+ * sufficiently understand. Better accuracy means both fewer false
+ * positives and more true defects. Memory leaks in particular.
+ *
+ * - A model file can't import any header files. Some built-in primitives are
+ * available but not wchar_t, NULL etc.
+ * - Modeling doesn't need full structs and typedefs. Rudimentary structs
+ * and similar types are sufficient.
+ * - An uninitialized local variable signifies that the variable could be
+ * any value.
+ *
+ * The model file must be uploaded by an admin in the analysis settings of
+ * http://scan.coverity.com/projects/378
+ */
+
+#define NULL ((void *)0)
+
+typedef unsigned char uint8_t;
+typedef char int8_t;
+typedef unsigned int uint32_t;
+typedef int int32_t;
+typedef long ssize_t;
+typedef unsigned long long uint64_t;
+typedef long long int64_t;
+typedef _Bool bool;
+
+/* exec.c */
+
+typedef struct AddressSpace AddressSpace;
+typedef uint64_t hwaddr;
+
+static void __write(uint8_t *buf, ssize_t len)
+{
+ int first, last;
+ __coverity_negative_sink__(len);
+ if (len == 0) return;
+ buf[0] = first;
+ buf[len-1] = last;
+ __coverity_writeall__(buf);
+}
+
+static void __read(uint8_t *buf, ssize_t len)
+{
+ __coverity_negative_sink__(len);
+ if (len == 0) return;
+ int first = buf[0];
+ int last = buf[len-1];
+}
+
+bool address_space_rw(AddressSpace *as, hwaddr addr, uint8_t *buf,
+ int len, bool is_write)
+{
+ bool result;
+
+ // TODO: investigate impact of treating reads as producing
+ // tainted data, with __coverity_tainted_data_argument__(buf).
+ if (is_write) __write(buf, len); else __read(buf, len);
+
+ return result;
+}
+
+/* Tainting */
+
+typedef struct {} name2keysym_t;
+static int get_keysym(const name2keysym_t *table,
+ const char *name)
+{
+ int result;
+ if (result > 0) {
+ __coverity_tainted_string_sanitize_content__(name);
+ return result;
+ } else {
+ return 0;
+ }
+}
+
+/* glib memory allocation functions.
+ *
+ * Note that we ignore the fact that g_malloc of 0 bytes returns NULL,
+ * and g_realloc of 0 bytes frees the pointer.
+ *
+ * Modeling this would result in Coverity flagging a lot of memory
+ * allocations as potentially returning NULL, and asking us to check
+ * whether the result of the allocation is NULL or not. However, the
+ * resulting pointer should never be dereferenced anyway, and in fact
+ * it is not in the vast majority of cases.
+ *
+ * If a dereference did happen, this would suppress a defect report
+ * for an actual null pointer dereference. But it's too unlikely to
+ * be worth wading through the false positives, and with some luck
+ * we'll get a buffer overflow reported anyway.
+ */
+
+void *malloc(size_t);
+void *calloc(size_t, size_t);
+void *realloc(void *, size_t);
+void free(void *);
+
+void *
+g_malloc(size_t n_bytes)
+{
+ void *mem;
+ __coverity_negative_sink__(n_bytes);
+ mem = malloc(n_bytes == 0 ? 1 : n_bytes);
+ if (!mem) __coverity_panic__();
+ return mem;
+}
+
+void *
+g_malloc0(size_t n_bytes)
+{
+ void *mem;
+ __coverity_negative_sink__(n_bytes);
+ mem = calloc(1, n_bytes == 0 ? 1 : n_bytes);
+ if (!mem) __coverity_panic__();
+ return mem;
+}
+
+void g_free(void *mem)
+{
+ free(mem);
+}
+
+void *g_realloc(void * mem, size_t n_bytes)
+{
+ __coverity_negative_sink__(n_bytes);
+ mem = realloc(mem, n_bytes == 0 ? 1 : n_bytes);
+ if (!mem) __coverity_panic__();
+ return mem;
+}
+
+void *g_try_malloc(size_t n_bytes)
+{
+ __coverity_negative_sink__(n_bytes);
+ return malloc(n_bytes == 0 ? 1 : n_bytes);
+}
+
+void *g_try_malloc0(size_t n_bytes)
+{
+ __coverity_negative_sink__(n_bytes);
+ return calloc(1, n_bytes == 0 ? 1 : n_bytes);
+}
+
+void *g_try_realloc(void *mem, size_t n_bytes)
+{
+ __coverity_negative_sink__(n_bytes);
+ return realloc(mem, n_bytes == 0 ? 1 : n_bytes);
+}
+
+/* Other glib functions */
+
+typedef struct _GIOChannel GIOChannel;
+GIOChannel *g_io_channel_unix_new(int fd)
+{
+ GIOChannel *c = g_malloc0(sizeof(GIOChannel));
+ __coverity_escape__(fd);
+ return c;
+}
+
+void g_assertion_message_expr(const char *domain,
+ const char *file,
+ int line,
+ const char *func,
+ const char *expr)
+{
+ __coverity_panic__();
+}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 36+ messages in thread* [Qemu-devel] [PULL 08/11] scripts: add sample model file for Coverity Scan
@ 2014-04-08 7:04 ` Michael Tokarev
0 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 7:04 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-trivial, Paolo Bonzini, Michael Tokarev, Markus Armbruster
From: Paolo Bonzini <pbonzini@redhat.com>
This is the model file that is being used for the QEMU project's scans
on scan.coverity.com. It fixed about 30 false positives (10% of the
total) and exposed about 60 new memory leaks.
The file is not automatically used; changes to it must be propagated
to the website manually by an admin (right now Markus, Peter and me
are admins).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
scripts/coverity-model.c | 183 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 183 insertions(+)
create mode 100644 scripts/coverity-model.c
diff --git a/scripts/coverity-model.c b/scripts/coverity-model.c
new file mode 100644
index 0000000..4c99a85
--- /dev/null
+++ b/scripts/coverity-model.c
@@ -0,0 +1,183 @@
+/* Coverity Scan model
+ *
+ * Copyright (C) 2014 Red Hat, Inc.
+ *
+ * Authors:
+ * Markus Armbruster <armbru@redhat.com>
+ * Paolo Bonzini <pbonzini@redhat.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or, at your
+ * option, any later version. See the COPYING file in the top-level directory.
+ */
+
+
+/*
+ * This is the source code for our Coverity user model file. The
+ * purpose of user models is to increase scanning accuracy by explaining
+ * code Coverity can't see (out of tree libraries) or doesn't
+ * sufficiently understand. Better accuracy means both fewer false
+ * positives and more true defects. Memory leaks in particular.
+ *
+ * - A model file can't import any header files. Some built-in primitives are
+ * available but not wchar_t, NULL etc.
+ * - Modeling doesn't need full structs and typedefs. Rudimentary structs
+ * and similar types are sufficient.
+ * - An uninitialized local variable signifies that the variable could be
+ * any value.
+ *
+ * The model file must be uploaded by an admin in the analysis settings of
+ * http://scan.coverity.com/projects/378
+ */
+
+#define NULL ((void *)0)
+
+typedef unsigned char uint8_t;
+typedef char int8_t;
+typedef unsigned int uint32_t;
+typedef int int32_t;
+typedef long ssize_t;
+typedef unsigned long long uint64_t;
+typedef long long int64_t;
+typedef _Bool bool;
+
+/* exec.c */
+
+typedef struct AddressSpace AddressSpace;
+typedef uint64_t hwaddr;
+
+static void __write(uint8_t *buf, ssize_t len)
+{
+ int first, last;
+ __coverity_negative_sink__(len);
+ if (len == 0) return;
+ buf[0] = first;
+ buf[len-1] = last;
+ __coverity_writeall__(buf);
+}
+
+static void __read(uint8_t *buf, ssize_t len)
+{
+ __coverity_negative_sink__(len);
+ if (len == 0) return;
+ int first = buf[0];
+ int last = buf[len-1];
+}
+
+bool address_space_rw(AddressSpace *as, hwaddr addr, uint8_t *buf,
+ int len, bool is_write)
+{
+ bool result;
+
+ // TODO: investigate impact of treating reads as producing
+ // tainted data, with __coverity_tainted_data_argument__(buf).
+ if (is_write) __write(buf, len); else __read(buf, len);
+
+ return result;
+}
+
+/* Tainting */
+
+typedef struct {} name2keysym_t;
+static int get_keysym(const name2keysym_t *table,
+ const char *name)
+{
+ int result;
+ if (result > 0) {
+ __coverity_tainted_string_sanitize_content__(name);
+ return result;
+ } else {
+ return 0;
+ }
+}
+
+/* glib memory allocation functions.
+ *
+ * Note that we ignore the fact that g_malloc of 0 bytes returns NULL,
+ * and g_realloc of 0 bytes frees the pointer.
+ *
+ * Modeling this would result in Coverity flagging a lot of memory
+ * allocations as potentially returning NULL, and asking us to check
+ * whether the result of the allocation is NULL or not. However, the
+ * resulting pointer should never be dereferenced anyway, and in fact
+ * it is not in the vast majority of cases.
+ *
+ * If a dereference did happen, this would suppress a defect report
+ * for an actual null pointer dereference. But it's too unlikely to
+ * be worth wading through the false positives, and with some luck
+ * we'll get a buffer overflow reported anyway.
+ */
+
+void *malloc(size_t);
+void *calloc(size_t, size_t);
+void *realloc(void *, size_t);
+void free(void *);
+
+void *
+g_malloc(size_t n_bytes)
+{
+ void *mem;
+ __coverity_negative_sink__(n_bytes);
+ mem = malloc(n_bytes == 0 ? 1 : n_bytes);
+ if (!mem) __coverity_panic__();
+ return mem;
+}
+
+void *
+g_malloc0(size_t n_bytes)
+{
+ void *mem;
+ __coverity_negative_sink__(n_bytes);
+ mem = calloc(1, n_bytes == 0 ? 1 : n_bytes);
+ if (!mem) __coverity_panic__();
+ return mem;
+}
+
+void g_free(void *mem)
+{
+ free(mem);
+}
+
+void *g_realloc(void * mem, size_t n_bytes)
+{
+ __coverity_negative_sink__(n_bytes);
+ mem = realloc(mem, n_bytes == 0 ? 1 : n_bytes);
+ if (!mem) __coverity_panic__();
+ return mem;
+}
+
+void *g_try_malloc(size_t n_bytes)
+{
+ __coverity_negative_sink__(n_bytes);
+ return malloc(n_bytes == 0 ? 1 : n_bytes);
+}
+
+void *g_try_malloc0(size_t n_bytes)
+{
+ __coverity_negative_sink__(n_bytes);
+ return calloc(1, n_bytes == 0 ? 1 : n_bytes);
+}
+
+void *g_try_realloc(void *mem, size_t n_bytes)
+{
+ __coverity_negative_sink__(n_bytes);
+ return realloc(mem, n_bytes == 0 ? 1 : n_bytes);
+}
+
+/* Other glib functions */
+
+typedef struct _GIOChannel GIOChannel;
+GIOChannel *g_io_channel_unix_new(int fd)
+{
+ GIOChannel *c = g_malloc0(sizeof(GIOChannel));
+ __coverity_escape__(fd);
+ return c;
+}
+
+void g_assertion_message_expr(const char *domain,
+ const char *file,
+ int line,
+ const char *func,
+ const char *expr)
+{
+ __coverity_panic__();
+}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [Qemu-trivial] [PULL 09/11] configure: Remove redundant message for -Werror
2014-04-08 7:04 ` [Qemu-devel] " Michael Tokarev
@ 2014-04-08 7:04 ` Michael Tokarev
-1 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 7:04 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Stefan Weil, Michael Tokarev
From: Stefan Weil <sw@weilnetz.de>
The compiler flag -Werror is printed (or not printed) as any other
compiler flag which is part of QEMU_CFLAGS.
Therefore an extra output line for -Werror is redundant and can be removed.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
configure | 1 -
1 file changed, 1 deletion(-)
diff --git a/configure b/configure
index 31fd3ad..1e73117 100755
--- a/configure
+++ b/configure
@@ -4092,7 +4092,6 @@ echo "sparse enabled $sparse"
echo "strip binaries $strip_opt"
echo "profiler $profiler"
echo "static build $static"
-echo "-Werror enabled $werror"
if test "$darwin" = "yes" ; then
echo "Cocoa support $cocoa"
fi
--
1.7.10.4
^ permalink raw reply related [flat|nested] 36+ messages in thread* [Qemu-devel] [PULL 09/11] configure: Remove redundant message for -Werror
@ 2014-04-08 7:04 ` Michael Tokarev
0 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 7:04 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Stefan Weil, Michael Tokarev
From: Stefan Weil <sw@weilnetz.de>
The compiler flag -Werror is printed (or not printed) as any other
compiler flag which is part of QEMU_CFLAGS.
Therefore an extra output line for -Werror is redundant and can be removed.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
configure | 1 -
1 file changed, 1 deletion(-)
diff --git a/configure b/configure
index 31fd3ad..1e73117 100755
--- a/configure
+++ b/configure
@@ -4092,7 +4092,6 @@ echo "sparse enabled $sparse"
echo "strip binaries $strip_opt"
echo "profiler $profiler"
echo "static build $static"
-echo "-Werror enabled $werror"
if test "$darwin" = "yes" ; then
echo "Cocoa support $cocoa"
fi
--
1.7.10.4
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [Qemu-trivial] [PULL 10/11] doc: grammify "allows to"
2014-04-08 7:04 ` [Qemu-devel] " Michael Tokarev
@ 2014-04-08 7:04 ` Michael Tokarev
-1 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 7:04 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev
English language grammar does not allow usage
of the word "allows" directly followed by an
infinitive, declaring constructs like "something
allows to do somestuff" un-grammatical. Often
it is possible to just insert "one" between "allows"
and "to" to make the construct grammatical, but
usually it is better to re-phrase the statement.
This patch tries to fix 3 examples of "allows to"
usage in qemu doc, but does not address comments
in the code with similar constructs. It also adds
missing "the" in the same line.
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
qemu-doc.texi | 2 +-
qemu-options.hx | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/qemu-doc.texi b/qemu-doc.texi
index e6e20eb..88ec9bb 100644
--- a/qemu-doc.texi
+++ b/qemu-doc.texi
@@ -823,7 +823,7 @@ In this case, the block device must be exported using qemu-nbd:
qemu-nbd --socket=/tmp/my_socket my_disk.qcow2
@end example
-The use of qemu-nbd allows to share a disk between several guests:
+The use of qemu-nbd allows sharing of a disk between several guests:
@example
qemu-nbd --socket=/tmp/my_socket --share=2 my_disk.qcow2
@end example
diff --git a/qemu-options.hx b/qemu-options.hx
index 2d33815..3a7cc8f 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -444,7 +444,8 @@ This option defines the type of the media: disk or cdrom.
@item cyls=@var{c},heads=@var{h},secs=@var{s}[,trans=@var{t}]
These options have the same definition as they have in @option{-hdachs}.
@item snapshot=@var{snapshot}
-@var{snapshot} is "on" or "off" and allows to enable snapshot for given drive (see @option{-snapshot}).
+@var{snapshot} is "on" or "off" and controls snapshot mode for the given drive
+(see @option{-snapshot}).
@item cache=@var{cache}
@var{cache} is "none", "writeback", "unsafe", "directsync" or "writethrough" and controls how the host cache is used to access block data.
@item aio=@var{aio}
@@ -1242,7 +1243,7 @@ Disable adaptive encodings. Adaptive encodings are enabled by default.
An adaptive encoding will try to detect frequently updated screen regions,
and send updates in these regions using a lossy encoding (like JPEG).
This can be really helpful to save bandwidth when playing videos. Disabling
-adaptive encodings allows to restore the original static behavior of encodings
+adaptive encodings restores the original static behavior of encodings
like Tight.
@item share=[allow-exclusive|force-shared|ignore]
--
1.7.10.4
^ permalink raw reply related [flat|nested] 36+ messages in thread* [Qemu-devel] [PULL 10/11] doc: grammify "allows to"
@ 2014-04-08 7:04 ` Michael Tokarev
0 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 7:04 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev
English language grammar does not allow usage
of the word "allows" directly followed by an
infinitive, declaring constructs like "something
allows to do somestuff" un-grammatical. Often
it is possible to just insert "one" between "allows"
and "to" to make the construct grammatical, but
usually it is better to re-phrase the statement.
This patch tries to fix 3 examples of "allows to"
usage in qemu doc, but does not address comments
in the code with similar constructs. It also adds
missing "the" in the same line.
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
qemu-doc.texi | 2 +-
qemu-options.hx | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/qemu-doc.texi b/qemu-doc.texi
index e6e20eb..88ec9bb 100644
--- a/qemu-doc.texi
+++ b/qemu-doc.texi
@@ -823,7 +823,7 @@ In this case, the block device must be exported using qemu-nbd:
qemu-nbd --socket=/tmp/my_socket my_disk.qcow2
@end example
-The use of qemu-nbd allows to share a disk between several guests:
+The use of qemu-nbd allows sharing of a disk between several guests:
@example
qemu-nbd --socket=/tmp/my_socket --share=2 my_disk.qcow2
@end example
diff --git a/qemu-options.hx b/qemu-options.hx
index 2d33815..3a7cc8f 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -444,7 +444,8 @@ This option defines the type of the media: disk or cdrom.
@item cyls=@var{c},heads=@var{h},secs=@var{s}[,trans=@var{t}]
These options have the same definition as they have in @option{-hdachs}.
@item snapshot=@var{snapshot}
-@var{snapshot} is "on" or "off" and allows to enable snapshot for given drive (see @option{-snapshot}).
+@var{snapshot} is "on" or "off" and controls snapshot mode for the given drive
+(see @option{-snapshot}).
@item cache=@var{cache}
@var{cache} is "none", "writeback", "unsafe", "directsync" or "writethrough" and controls how the host cache is used to access block data.
@item aio=@var{aio}
@@ -1242,7 +1243,7 @@ Disable adaptive encodings. Adaptive encodings are enabled by default.
An adaptive encoding will try to detect frequently updated screen regions,
and send updates in these regions using a lossy encoding (like JPEG).
This can be really helpful to save bandwidth when playing videos. Disabling
-adaptive encodings allows to restore the original static behavior of encodings
+adaptive encodings restores the original static behavior of encodings
like Tight.
@item share=[allow-exclusive|force-shared|ignore]
--
1.7.10.4
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [Qemu-trivial] [PULL 11/11] Fix grammar in comment
2014-04-08 7:04 ` [Qemu-devel] " Michael Tokarev
@ 2014-04-08 7:04 ` Michael Tokarev
-1 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 7:04 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Stefan Weil, Michael Tokarev
From: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/i2c/smbus_eeprom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/i2c/smbus_eeprom.c b/hw/i2c/smbus_eeprom.c
index 86f35c1..72c09cb 100644
--- a/hw/i2c/smbus_eeprom.c
+++ b/hw/i2c/smbus_eeprom.c
@@ -71,7 +71,7 @@ static void eeprom_write_data(SMBusDevice *dev, uint8_t cmd, uint8_t *buf, int l
printf("eeprom_write_byte: addr=0x%02x cmd=0x%02x val=0x%02x\n",
dev->i2c.address, cmd, buf[0]);
#endif
- /* An page write operation is not a valid SMBus command.
+ /* A page write operation is not a valid SMBus command.
It is a block write without a length byte. Fortunately we
get the full block anyway. */
/* TODO: Should this set the current location? */
--
1.7.10.4
^ permalink raw reply related [flat|nested] 36+ messages in thread* [Qemu-devel] [PULL 11/11] Fix grammar in comment
@ 2014-04-08 7:04 ` Michael Tokarev
0 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 7:04 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Stefan Weil, Michael Tokarev
From: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/i2c/smbus_eeprom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/i2c/smbus_eeprom.c b/hw/i2c/smbus_eeprom.c
index 86f35c1..72c09cb 100644
--- a/hw/i2c/smbus_eeprom.c
+++ b/hw/i2c/smbus_eeprom.c
@@ -71,7 +71,7 @@ static void eeprom_write_data(SMBusDevice *dev, uint8_t cmd, uint8_t *buf, int l
printf("eeprom_write_byte: addr=0x%02x cmd=0x%02x val=0x%02x\n",
dev->i2c.address, cmd, buf[0]);
#endif
- /* An page write operation is not a valid SMBus command.
+ /* A page write operation is not a valid SMBus command.
It is a block write without a length byte. Fortunately we
get the full block anyway. */
/* TODO: Should this set the current location? */
--
1.7.10.4
^ permalink raw reply related [flat|nested] 36+ messages in thread
* Re: [Qemu-trivial] [Qemu-devel] [PULL for-2.0 00/11] Trivial patches for 2014-04-08
2014-04-08 7:04 ` [Qemu-devel] " Michael Tokarev
@ 2014-04-08 8:10 ` Peter Maydell
-1 siblings, 0 replies; 36+ messages in thread
From: Peter Maydell @ 2014-04-08 8:10 UTC (permalink / raw)
To: Michael Tokarev; +Cc: QEMU Trivial, QEMU Developers
On 8 April 2014 08:04, Michael Tokarev <mjt@tls.msk.ru> wrote:
> And there's a series of 3 patches by Peter Maydell which adds casts
> to uint* in a few places. Those are also quite simple and safe, even
> with quite some disagreement about whenever this is necessary to
> start with -- I mean the int128 change, the other changes are good.
> At least this way we make it consistent with other parts of the code.
I was not expecting those to go in for 2.0...
thanks
-- PMM
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [Qemu-devel] [PULL for-2.0 00/11] Trivial patches for 2014-04-08
@ 2014-04-08 8:10 ` Peter Maydell
0 siblings, 0 replies; 36+ messages in thread
From: Peter Maydell @ 2014-04-08 8:10 UTC (permalink / raw)
To: Michael Tokarev; +Cc: QEMU Trivial, QEMU Developers
On 8 April 2014 08:04, Michael Tokarev <mjt@tls.msk.ru> wrote:
> And there's a series of 3 patches by Peter Maydell which adds casts
> to uint* in a few places. Those are also quite simple and safe, even
> with quite some disagreement about whenever this is necessary to
> start with -- I mean the int128 change, the other changes are good.
> At least this way we make it consistent with other parts of the code.
I was not expecting those to go in for 2.0...
thanks
-- PMM
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [Qemu-trivial] [Qemu-devel] [PULL for-2.0 00/11] Trivial patches for 2014-04-08
2014-04-08 8:10 ` Peter Maydell
@ 2014-04-08 8:52 ` Michael Tokarev
-1 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 8:52 UTC (permalink / raw)
To: Peter Maydell; +Cc: QEMU Trivial, QEMU Developers
08.04.2014 12:10, Peter Maydell wrote:
> On 8 April 2014 08:04, Michael Tokarev <mjt@tls.msk.ru> wrote:
>> And there's a series of 3 patches by Peter Maydell which adds casts
>> to uint* in a few places. Those are also quite simple and safe, even
>> with quite some disagreement about whenever this is necessary to
>> start with -- I mean the int128 change, the other changes are good.
>> At least this way we make it consistent with other parts of the code.
>
> I was not expecting those to go in for 2.0...
Well. At least one of them is entirely safe (hw/ide/ahci.c).
Another - xbzrle.c - looks okay, and even maybe fixing a bug.
And this int128 thing is okay too, except that the whole thing
is questionable as has been mentioned in that thread.
I can prepare another pull request without xbzrle and int128 changes,
or even without ahci change too, but I'm not sure it is worth the
effort - I think everything is okay to go. I'll take your word for this.
Thanks,
/mjt
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [Qemu-devel] [PULL for-2.0 00/11] Trivial patches for 2014-04-08
@ 2014-04-08 8:52 ` Michael Tokarev
0 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 8:52 UTC (permalink / raw)
To: Peter Maydell; +Cc: QEMU Trivial, QEMU Developers
08.04.2014 12:10, Peter Maydell wrote:
> On 8 April 2014 08:04, Michael Tokarev <mjt@tls.msk.ru> wrote:
>> And there's a series of 3 patches by Peter Maydell which adds casts
>> to uint* in a few places. Those are also quite simple and safe, even
>> with quite some disagreement about whenever this is necessary to
>> start with -- I mean the int128 change, the other changes are good.
>> At least this way we make it consistent with other parts of the code.
>
> I was not expecting those to go in for 2.0...
Well. At least one of them is entirely safe (hw/ide/ahci.c).
Another - xbzrle.c - looks okay, and even maybe fixing a bug.
And this int128 thing is okay too, except that the whole thing
is questionable as has been mentioned in that thread.
I can prepare another pull request without xbzrle and int128 changes,
or even without ahci change too, but I'm not sure it is worth the
effort - I think everything is okay to go. I'll take your word for this.
Thanks,
/mjt
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [Qemu-trivial] [Qemu-devel] [PULL for-2.0 00/11] Trivial patches for 2014-04-08
2014-04-08 8:52 ` Michael Tokarev
@ 2014-04-08 9:41 ` Peter Maydell
-1 siblings, 0 replies; 36+ messages in thread
From: Peter Maydell @ 2014-04-08 9:41 UTC (permalink / raw)
To: Michael Tokarev; +Cc: QEMU Trivial, QEMU Developers
On 8 April 2014 09:52, Michael Tokarev <mjt@tls.msk.ru> wrote:
> Well. At least one of them is entirely safe (hw/ide/ahci.c).
> Another - xbzrle.c - looks okay, and even maybe fixing a bug.
> And this int128 thing is okay too, except that the whole thing
> is questionable as has been mentioned in that thread.
>
> I can prepare another pull request without xbzrle and int128 changes,
> or even without ahci change too, but I'm not sure it is worth the
> effort - I think everything is okay to go. I'll take your word for this.
Well, anything that goes in today is going to get at best two
days of being tested before the release. To me that argues
fairly strongly for not putting anything in unless it is
fixing a genuine bug.
thanks
-- PMM
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [Qemu-devel] [PULL for-2.0 00/11] Trivial patches for 2014-04-08
@ 2014-04-08 9:41 ` Peter Maydell
0 siblings, 0 replies; 36+ messages in thread
From: Peter Maydell @ 2014-04-08 9:41 UTC (permalink / raw)
To: Michael Tokarev; +Cc: QEMU Trivial, QEMU Developers
On 8 April 2014 09:52, Michael Tokarev <mjt@tls.msk.ru> wrote:
> Well. At least one of them is entirely safe (hw/ide/ahci.c).
> Another - xbzrle.c - looks okay, and even maybe fixing a bug.
> And this int128 thing is okay too, except that the whole thing
> is questionable as has been mentioned in that thread.
>
> I can prepare another pull request without xbzrle and int128 changes,
> or even without ahci change too, but I'm not sure it is worth the
> effort - I think everything is okay to go. I'll take your word for this.
Well, anything that goes in today is going to get at best two
days of being tested before the release. To me that argues
fairly strongly for not putting anything in unless it is
fixing a genuine bug.
thanks
-- PMM
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [Qemu-trivial] [Qemu-devel] [PULL for-2.0 00/11] Trivial patches for 2014-04-08
2014-04-08 9:41 ` Peter Maydell
@ 2014-04-08 10:57 ` Markus Armbruster
-1 siblings, 0 replies; 36+ messages in thread
From: Markus Armbruster @ 2014-04-08 10:57 UTC (permalink / raw)
To: Peter Maydell; +Cc: QEMU Trivial, Michael Tokarev, QEMU Developers
Peter Maydell <peter.maydell@linaro.org> writes:
> On 8 April 2014 09:52, Michael Tokarev <mjt@tls.msk.ru> wrote:
>> Well. At least one of them is entirely safe (hw/ide/ahci.c).
>> Another - xbzrle.c - looks okay, and even maybe fixing a bug.
>> And this int128 thing is okay too, except that the whole thing
>> is questionable as has been mentioned in that thread.
>>
>> I can prepare another pull request without xbzrle and int128 changes,
>> or even without ahci change too, but I'm not sure it is worth the
>> effort - I think everything is okay to go. I'll take your word for this.
>
> Well, anything that goes in today is going to get at best two
> days of being tested before the release. To me that argues
> fairly strongly for not putting anything in unless it is
> fixing a genuine bug.
Seconded.
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [Qemu-devel] [PULL for-2.0 00/11] Trivial patches for 2014-04-08
@ 2014-04-08 10:57 ` Markus Armbruster
0 siblings, 0 replies; 36+ messages in thread
From: Markus Armbruster @ 2014-04-08 10:57 UTC (permalink / raw)
To: Peter Maydell; +Cc: QEMU Trivial, Michael Tokarev, QEMU Developers
Peter Maydell <peter.maydell@linaro.org> writes:
> On 8 April 2014 09:52, Michael Tokarev <mjt@tls.msk.ru> wrote:
>> Well. At least one of them is entirely safe (hw/ide/ahci.c).
>> Another - xbzrle.c - looks okay, and even maybe fixing a bug.
>> And this int128 thing is okay too, except that the whole thing
>> is questionable as has been mentioned in that thread.
>>
>> I can prepare another pull request without xbzrle and int128 changes,
>> or even without ahci change too, but I'm not sure it is worth the
>> effort - I think everything is okay to go. I'll take your word for this.
>
> Well, anything that goes in today is going to get at best two
> days of being tested before the release. To me that argues
> fairly strongly for not putting anything in unless it is
> fixing a genuine bug.
Seconded.
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [Qemu-trivial] [Qemu-devel] [PULL for-2.0 00/11] Trivial patches for 2014-04-08
2014-04-08 10:57 ` Markus Armbruster
@ 2014-04-08 11:58 ` Michael Tokarev
-1 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 11:58 UTC (permalink / raw)
To: Markus Armbruster; +Cc: QEMU Trivial, Peter Maydell, QEMU Developers
08.04.2014 14:57, Markus Armbruster wrote:
> Peter Maydell <peter.maydell@linaro.org> writes:
>
>> On 8 April 2014 09:52, Michael Tokarev <mjt@tls.msk.ru> wrote:
>>> Well. At least one of them is entirely safe (hw/ide/ahci.c).
>>> Another - xbzrle.c - looks okay, and even maybe fixing a bug.
>>> And this int128 thing is okay too, except that the whole thing
>>> is questionable as has been mentioned in that thread.
>>>
>>> I can prepare another pull request without xbzrle and int128 changes,
>>> or even without ahci change too, but I'm not sure it is worth the
>>> effort - I think everything is okay to go. I'll take your word for this.
>>
>> Well, anything that goes in today is going to get at best two
>> days of being tested before the release. To me that argues
>> fairly strongly for not putting anything in unless it is
>> fixing a genuine bug.
>
> Seconded.
-trivial does not fix bugs. Only documentation bugs, which does
not met the above definition.
So no -trivial patches for 2.0 anymore.
Thanks,
/mjt
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [Qemu-devel] [PULL for-2.0 00/11] Trivial patches for 2014-04-08
@ 2014-04-08 11:58 ` Michael Tokarev
0 siblings, 0 replies; 36+ messages in thread
From: Michael Tokarev @ 2014-04-08 11:58 UTC (permalink / raw)
To: Markus Armbruster; +Cc: QEMU Trivial, Peter Maydell, QEMU Developers
08.04.2014 14:57, Markus Armbruster wrote:
> Peter Maydell <peter.maydell@linaro.org> writes:
>
>> On 8 April 2014 09:52, Michael Tokarev <mjt@tls.msk.ru> wrote:
>>> Well. At least one of them is entirely safe (hw/ide/ahci.c).
>>> Another - xbzrle.c - looks okay, and even maybe fixing a bug.
>>> And this int128 thing is okay too, except that the whole thing
>>> is questionable as has been mentioned in that thread.
>>>
>>> I can prepare another pull request without xbzrle and int128 changes,
>>> or even without ahci change too, but I'm not sure it is worth the
>>> effort - I think everything is okay to go. I'll take your word for this.
>>
>> Well, anything that goes in today is going to get at best two
>> days of being tested before the release. To me that argues
>> fairly strongly for not putting anything in unless it is
>> fixing a genuine bug.
>
> Seconded.
-trivial does not fix bugs. Only documentation bugs, which does
not met the above definition.
So no -trivial patches for 2.0 anymore.
Thanks,
/mjt
^ permalink raw reply [flat|nested] 36+ messages in thread