[Qemu-devel] [PATCH] fix some common typos

2012-05-09 Thread Jim Meyering
ictly!explicitly!' qemu-ga.c sed -i '490s!preceeding!preceding!' qga/commands-posix.c sed -i '792s!addres!address!' qga/commands-posix.c sed -i '6s!beeing!being!' tests/tcg/test-mmap.c Signed-off-by: Jim Meyering --- Changelog | 2 +- coroutine

[Qemu-devel] [PATCH 20/22] hw/r2d: add comment: this strncpy use is ok

2012-05-09 Thread Jim Meyering
From: Jim Meyering Signed-off-by: Jim Meyering --- hw/r2d.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/r2d.c b/hw/r2d.c index c55de01..ed841c5 100644 --- a/hw/r2d.c +++ b/hw/r2d.c @@ -328,6 +328,8 @@ static void r2d_init(ram_addr_t ram_size, } if (kernel_cmdline

[Qemu-devel] [PATCH 22/22] doc: update HACKING wrt strncpy/pstrcpy

2012-05-09 Thread Jim Meyering
From: Jim Meyering Reword the section on strncpy: its NUL-filling is important in some cases. Mention that pstrcpy's signature is different. Signed-off-by: Jim Meyering --- HACKING | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/HACKING b/HACKING index 47

[Qemu-devel] strncpy: best avoided

2012-05-09 Thread Jim Meyering
[Hmm... This was supposed to be the first in the series] Given qemu's HACKING comments, I'm sure many here have read "man strncpy", where it indicates it is often not the best function to use. However, many of the uses of strncpy in qemu mistakenly fail to ensure that the destination buffer is N

[Qemu-devel] strncpy: best avoided (resend)

2012-05-09 Thread Jim Meyering
[Argh. First attempt omitted the most important address: qemu-devel. Sorry to all who get two copies. ] Given qemu's HACKING comments, I'm sure many here have read "man strncpy", where it indicates it is often not the best function to use. However, many of the uses of strncpy in qemu mistakenly

[Qemu-devel] [PATCH 21/22] scsi: mark an strncpy use as valid

2012-05-09 Thread Jim Meyering
From: Jim Meyering Signed-off-by: Jim Meyering --- hw/scsi-bus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index dbdb99c..916f425 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -402,6 +402,7 @@ static bool scsi_target_emulate_inquiry(SCSITargetReq *r

[Qemu-devel] [PATCH 05/22] lm32: avoid buffer overrun

2012-05-09 Thread Jim Meyering
From: Jim Meyering Actually do what the comment says, using pstrcpy to NUL-terminate: strncpy does not always do that. Signed-off-by: Jim Meyering --- hw/lm32_hwsetup.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/lm32_hwsetup.h b/hw/lm32_hwsetup.h index 8fc285e

[Qemu-devel] [PATCH 15/22] target-i386: use pstrcpy, not strncpy

2012-05-09 Thread Jim Meyering
From: Jim Meyering Use pstrcpy rather than strncpy in one more case (in cpudef_setfield). This makes our handling of ->model_id consistent with another pstrcpy-vs-model_id use below. Signed-off-by: Jim Meyering --- target-i386/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) d

[Qemu-devel] [PATCHv2] fix some common typos

2012-05-09 Thread Jim Meyering
plicitly!' qemu-ga.c sed -i '490s!preceeding!preceding!' qga/commands-posix.c sed -i '792s!addres!address!' qga/commands-posix.c sed -i '6s!beeing!being!' tests/tcg/test-mmap.c Also, manually fix "arithmentic", spotted by Peter Maydell:

Re: [Qemu-devel] get_maintainer.pl prints invalid Cc: [Re: Fwd: Undelivered Mail Returned to Sender

2012-05-09 Thread Jim Meyering
Andreas Färber wrote: > Am 09.05.2012 14:38, schrieb Jim Meyering: >> Alexander Graf wrote: >>> Hrm :) >> >> That appears to be due to scripts/get_maintainer.pl not sanitizing >> its output addresses. E.g., using my 06/22 patch, I get this bogus Cc: >&g

Re: [Qemu-devel] strncpy: best avoided (resend)

2012-05-10 Thread Jim Meyering
Kevin Wolf wrote: > Am 09.05.2012 11:23, schrieb Jim Meyering: >> [Argh. First attempt omitted the most important address: qemu-devel. >> Sorry to all who get two copies. ] >> >> Given qemu's HACKING comments, I'm sure many here have read "man strncpy&q

[Qemu-devel] [PATCH 0/2] memset/sizeof abuse

2012-05-10 Thread Jim Meyering
From: Jim Meyering I ran coverity on all of qemu and have begun going through the results. A couple problems jumped out as obvious and easy to fix: Jim Meyering (2): kvm/apic: correct short memset cadence_gem: avoid stack-writing buffer-overrun hw/cadence_gem.c | 2 +- hw/kvm/apic.c

[Qemu-devel] [PATCH 2/2] cadence_gem: avoid stack-writing buffer-overrun

2012-05-10 Thread Jim Meyering
From: Jim Meyering Use sizeof(rxbuf)-size (not sizeof(rxbuf-size)) as the number of bytes to clear. The latter would always clear 4 or 8 bytes, possibly writing beyond the end of that stack buffer. Alternatively, depending on the value of the "size" parameter, it could fail to init

[Qemu-devel] [PATCH 1/2] kvm/apic: correct short memset

2012-05-10 Thread Jim Meyering
From: Jim Meyering kvm_put_apic_state's attempt to clear *kapic before setting its bits cleared sizeof(void*) bytes (no more than 8) rather than the intended 1024 (KVM_APIC_REG_SIZE) bytes. Spotted by coverity. Signed-off-by: Jim Meyering --- hw/kvm/apic.c | 2 +- 1 file changed, 1 inse

Re: [Qemu-devel] checkpatch issue

2012-05-10 Thread Jim Meyering
g a "struct" before the typedef's EHCIPacket. >From 49f786191ab2a8176eb44a78e3d5ba44da6e10b6 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 10 May 2012 18:25:51 +0200 Subject: [PATCH] . Signed-off-by: Jim Meyering --- hw/usb/hcd-ehci.c | 5 + 1 file changed, 5 inserti

[Qemu-devel] [PATCH] posix-aio: don't set aiocb->ret/active outside critical section

2012-05-15 Thread Jim Meyering
Move code that sets aiocb->ret and aiocb->active into critical section. All other accesses are lock-guarded. Spotted by coverity. Signed-off-by: Jim Meyering --- I've included enough context to show one of the guarded uses in the following function. posix-aio-compat.c | 2 +- 1 f

Re: [Qemu-devel] [PATCH] posix-aio: don't set aiocb->ret/active outside critical section

2012-05-15 Thread Jim Meyering
Kevin Wolf wrote: > Am 15.05.2012 13:27, schrieb Jim Meyering: >> >> Move code that sets aiocb->ret and aiocb->active into critical section. >> All other accesses are lock-guarded. Spotted by coverity. >> >> Signed-off-by: Jim Meyering >> --- >&

[Qemu-devel] [PATCH 1/6] qcow2: don't leak buffer for unexpected qcow_version in header

2012-05-16 Thread Jim Meyering
From: Jim Meyering Signed-off-by: Jim Meyering --- block/qcow2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/qcow2.c b/block/qcow2.c index 655799c..f3388bf 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -919,6 +919,7 @@ int qcow2_update_header(BlockDriverState *bs

[Qemu-devel] [PATCH 0/6] plug memory and file-descriptor leaks

2012-05-16 Thread Jim Meyering
From: Jim Meyering These changes fix most of the legitimate coverity-reported leak warnings. Jim Meyering (6): qcow2: don't leak buffer for unexpected qcow_version in header qemu-ga: avoid unconditional lockfile file descriptor leak linux-user: do_msgrcv: don't leak ho

[Qemu-devel] [PATCH 4/6] sheepdog: don't leak socket file descriptor upon connection failure

2012-05-16 Thread Jim Meyering
From: Jim Meyering Signed-off-by: Jim Meyering --- block/sheepdog.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/sheepdog.c b/block/sheepdog.c index e01d371..a5c834f 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -489,6 +489,7 @@ static int connect_to_sdog(const char

[Qemu-devel] [PATCH 3/6] linux-user: do_msgrcv: don't leak host_mb upon TARGET_EFAULT failure

2012-05-16 Thread Jim Meyering
From: Jim Meyering Signed-off-by: Jim Meyering --- linux-user/syscall.c | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 20d2a74..bdf8ce0 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2814,6 +2814,7 @@ static inline

[Qemu-devel] [PATCH 6/6] softmmu-semi: fix lock_user* functions not to deref NULL upon OOM

2012-05-16 Thread Jim Meyering
From: Jim Meyering Use g_malloc/g_free in place of malloc/free. Signed-off-by: Jim Meyering --- softmmu-semi.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/softmmu-semi.h b/softmmu-semi.h index 648cb95..996e0f7 100644 --- a/softmmu-semi.h +++ b/softmmu-semi.h

[Qemu-devel] [PATCH 2/6] qemu-ga: avoid unconditional lockfile file descriptor leak

2012-05-16 Thread Jim Meyering
From: Jim Meyering Do not leak a file descriptor. Also, do not forget to unlink the lockfile upon failed lockf. Always close the lockfile file descriptor, taking care to diagnose close, as well as open and write, failure. Signed-off-by: Jim Meyering --- qemu-ga.c | 10 -- 1 file

[Qemu-devel] [PATCH 5/6] arm-semi: don't leak 1kb user string lock buffer upon TARGET_SYS_OPEN

2012-05-16 Thread Jim Meyering
From: Jim Meyering Always call unlock_user before returning. . Signed-off-by: Jim Meyering --- arm-semi.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/arm-semi.c b/arm-semi.c index 88ca9bb..5d2a2d2 100644 --- a/arm-semi.c +++ b/arm-semi.c @@ -194,18

Re: [Qemu-devel] [PATCH 3/6] linux-user: do_msgrcv: don't leak host_mb upon TARGET_EFAULT failure

2012-05-16 Thread Jim Meyering
Peter Maydell wrote: > On 16 May 2012 14:07, Jim Meyering wrote: >> From: Jim Meyering >> >> >> Signed-off-by: Jim Meyering >> --- >>  linux-user/syscall.c | 1 + >>  1 file changed, 1 insertion(+) >> >> diff --git a/linux-user/syscall.

[Qemu-devel] [PATCHv2 3/6] linux-user: do_msgrcv: don't leak host_mb upon TARGET_EFAULT failure

2012-05-16 Thread Jim Meyering
Also, use g_malloc to avoid NULL-deref upon OOM. Signed-off-by: Jim Meyering --- There are other, similar NULL-deref risks in this file. TBD separately. linux-user/syscall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c

Re: [Qemu-devel] [PATCH 2/6] qemu-ga: avoid unconditional lockfile file descriptor leak

2012-05-16 Thread Jim Meyering
Michael Roth wrote: > On Wed, May 16, 2012 at 03:07:57PM +0200, Jim Meyering wrote: >> From: Jim Meyering >> >> Do not leak a file descriptor. >> Also, do not forget to unlink the lockfile upon failed lockf. >> Always close the lockfile file descriptor, taking c

[Qemu-devel] [PATCHv2 2/6] qemu-ga: don't leak a file descriptor upon failed lockf

2012-05-16 Thread Jim Meyering
Signed-off-by: Jim Meyering --- qemu-ga.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qemu-ga.c b/qemu-ga.c index 680997e..24b236a 100644 --- a/qemu-ga.c +++ b/qemu-ga.c @@ -246,6 +246,9 @@ static bool ga_open_pidfile(const char *pidfile) pidfd = open(pidfile, O_CREAT|O_WRONLY

[Qemu-devel] [PATCH 0/3] tighten scope of accidentally global variables

2012-05-21 Thread Jim Meyering
From: Jim Meyering I noticed this commit, virtio-pci: add missing 'static' which made this change: > -const MemoryRegionPortio virtio_portio[] = { > +static const MemoryRegionPortio virtio_portio[] = { and wondered if there were other variables like that. The f

[Qemu-devel] [PATCH 1/3] xen: remove unused global, xen_xcg

2012-05-21 Thread Jim Meyering
From: Jim Meyering Signed-off-by: Jim Meyering --- hw/xen_backend.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/xen_backend.c b/hw/xen_backend.c index 66cb144..e44ced0 100644 --- a/hw/xen_backend.c +++ b/hw/xen_backend.c @@ -47,7 +47,6 @@ /* public */ XenXC xen_xc

[Qemu-devel] [PATCH 2/3] scsi: declare vmstate_info_scsi_requests to be static

2012-05-21 Thread Jim Meyering
From: Jim Meyering Signed-off-by: Jim Meyering --- hw/scsi-bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index 8ab9bcd..f10f3ec 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -1561,7 +1561,7 @@ static int get_scsi_requests(QEMUFile

[Qemu-devel] [PATCH 3/3] qemu-config: qemu_option_rom_opts, qemu_boot_opts: declare static

2012-05-21 Thread Jim Meyering
From: Jim Meyering Signed-off-by: Jim Meyering --- qemu-config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu-config.c b/qemu-config.c index be84a03..c03e52b 100644 --- a/qemu-config.c +++ b/qemu-config.c @@ -528,7 +528,7 @@ QemuOptsList qemu_spice_opts

Re: [Qemu-devel] [PATCH 1/3] envlist.c: handle strdup failure

2012-05-21 Thread Jim Meyering
Blue Swirl wrote: > On Tue, May 15, 2012 at 1:04 PM, wrote: >> From: Jim Meyering >> >> Without this, envlist_to_environ may silently fail to copy all >> strings into the destination buffer, and both callers would leak >> any env strings allocated after a faili

[Qemu-devel] [PATCHv2 1/6] qcow2: don't leak buffer for unexpected qcow_version in header

2012-05-21 Thread Jim Meyering
Signed-off-by: Jim Meyering --- Thanks to Kevin Wolf for the improvement. block/qcow2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/qcow2.c b/block/qcow2.c index 655799c..c2e49cd 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -919,7 +919,8 @@ int

Re: [Qemu-devel] [PATCH 1/6] qcow2: don't leak buffer for unexpected qcow_version in header

2012-05-21 Thread Jim Meyering
Kevin Wolf wrote: > Am 16.05.2012 15:07, schrieb Jim Meyering: >> From: Jim Meyering >> >> >> Signed-off-by: Jim Meyering >> --- >> block/qcow2.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/block/qcow2.c b/block/qcow2.

Re: [Qemu-devel] [PATCH 0/3] tighten scope of accidentally global variables

2012-05-21 Thread Jim Meyering
Blue Swirl wrote: > On Mon, May 21, 2012 at 10:03 AM, Jim Meyering wrote: >> From: Jim Meyering >> >> I noticed this commit, >> >>    virtio-pci: add missing 'static' >> >> which made this change: >> >>    > -const MemoryReg

Re: [Qemu-devel] [PATCH 0/3] tighten scope of accidentally global variables

2012-05-21 Thread Jim Meyering
Blue Swirl wrote: > On Mon, May 21, 2012 at 6:10 PM, Jim Meyering wrote: >> Blue Swirl wrote: >>> On Mon, May 21, 2012 at 10:03 AM, Jim Meyering wrote: >>>> From: Jim Meyering >>>> >>>> I noticed this commit, >>>> >>

[Qemu-devel] [PATCH 0/9] convert many more globals to "static"

2012-05-21 Thread Jim Meyering
From: Jim Meyering Following up on discussion here, http://marc.info/?t=13375948768&r=1&w=2 here are patches to limit the scope of the remaining global variables. Most changes simply added a preceding "static". However, in some cases, I've made minor additional c

[Qemu-devel] [PATCH 1/9] ccid: declare DEFAULT_ATR table to be "static const"

2012-05-21 Thread Jim Meyering
From: Jim Meyering Signed-off-by: Jim Meyering --- hw/ccid-card-passthru.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ccid-card-passthru.c b/hw/ccid-card-passthru.c index bd6c777..1caaa45 100644 --- a/hw/ccid-card-passthru.c +++ b/hw/ccid-card-passthru.c @@ -27,7

[Qemu-devel] [PATCH 1/9] ccid: declare DEFAULT_ATR table to be "static const"

2012-05-21 Thread Jim Meyering
From: Jim Meyering Signed-off-by: Jim Meyering --- hw/ccid-card-passthru.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ccid-card-passthru.c b/hw/ccid-card-passthru.c index bd6c777..1caaa45 100644 --- a/hw/ccid-card-passthru.c +++ b/hw/ccid-card-passthru.c @@ -27,7

[Qemu-devel] [PATCH 2/9] tcg: declare __jit_debug_descriptor to be static

2012-05-21 Thread Jim Meyering
From: Jim Meyering Signed-off-by: Jim Meyering --- tcg/tcg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index ab589c7..350fdad 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2293,7 +2293,7 @@ void __jit_debug_register_code(void) /* Must statically

[Qemu-devel] [PATCH 2/9] tcg: declare __jit_debug_descriptor to be static

2012-05-21 Thread Jim Meyering
From: Jim Meyering Signed-off-by: Jim Meyering --- tcg/tcg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index ab589c7..350fdad 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2293,7 +2293,7 @@ void __jit_debug_register_code(void) /* Must statically

[Qemu-devel] [PATCH 3/9] alpha-dis: remove unused global; declare others to be static

2012-05-21 Thread Jim Meyering
From: Jim Meyering alpha_num_operands: Remove both declarations of this unused global. alpha_opcodes: Declare static to limit scope. Remove duplicate decl. alpha_num_opcodes: Likewise. alpha_operands: Likewise. Signed-off-by: Jim Meyering --- alpha-dis.c | 26 +- 1

[Qemu-devel] [PATCH 3/9] alpha-dis: remove unused global; declare others to be static

2012-05-21 Thread Jim Meyering
From: Jim Meyering alpha_num_operands: Remove both declarations of this unused global. alpha_opcodes: Declare static to limit scope. Remove duplicate decl. alpha_num_opcodes: Likewise. alpha_operands: Likewise. Signed-off-by: Jim Meyering --- alpha-dis.c | 26 +- 1

[Qemu-devel] [PATCH 6/9] sheepdog: declare bdrv_sheepdog to be static

2012-05-21 Thread Jim Meyering
From: Jim Meyering Signed-off-by: Jim Meyering --- block/sheepdog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index e01d371..fdb3eca 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -2014,7 +2014,7 @@ static

[Qemu-devel] [PATCH 4/9] linux-user: arg_table need not have global scope

2012-05-21 Thread Jim Meyering
From: Jim Meyering Declare arg_table to be "static const", and adjust the two users to also be const. Signed-off-by: Jim Meyering --- linux-user/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 191b750..cc5b

[Qemu-devel] [PATCH 8/9] bonito: declare bonito_state to be static

2012-05-21 Thread Jim Meyering
From: Jim Meyering Signed-off-by: Jim Meyering --- hw/bonito.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/bonito.c b/hw/bonito.c index 77786f8..6bd0242 100644 --- a/hw/bonito.c +++ b/hw/bonito.c @@ -218,7 +218,7 @@ typedef struct PCIBonitoState } PCIBonitoState

[Qemu-devel] [PATCH 5/9] ccid: make backend_enum_table "static const" and adjust users

2012-05-21 Thread Jim Meyering
From: Jim Meyering Signed-off-by: Jim Meyering --- hw/ccid-card-emulated.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/ccid-card-emulated.c b/hw/ccid-card-emulated.c index f4a6da4..440f050 100644 --- a/hw/ccid-card-emulated.c +++ b/hw/ccid-card-emulated.c

Re: [Qemu-devel] [PATCH 2/9] tcg: declare __jit_debug_descriptor to be static

2012-05-21 Thread Jim Meyering
Peter Maydell wrote: > On 21 May 2012 20:51, Jim Meyering wrote: >> From: Jim Meyering >> >> >> Signed-off-by: Jim Meyering >> --- >>  tcg/tcg.c | 2 +- >>  1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/tcg/tcg.c b/tcg/

[Qemu-devel] [PATCH 7/9] mips-dis: declare four globals to be "static"

2012-05-21 Thread Jim Meyering
From: Jim Meyering Signed-off-by: Jim Meyering --- mips-dis.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/mips-dis.c b/mips-dis.c index e3a6e0b..f6109a1 100644 --- a/mips-dis.c +++ b/mips-dis.c @@ -888,10 +888,9 @@ enum Many instructions are short

[Qemu-devel] [PATCH 9/9] convert many more globals to static

2012-05-21 Thread Jim Meyering
From: Jim Meyering Minor exceptions: * arm-dis: move now-detected-as-unused static variables into #if-0'd block of code where they *are* used. * microblaze: remove decls of now-detected-as-unused vars Signed-off-by: Jim Meyering --- arm-dis.c | 8 ++--- c

[Qemu-devel] [PATCH 0/2] envlist.c: handle strdup failure

2012-05-22 Thread Jim Meyering
From: Jim Meyering Per discussion, let's switch envlist.c to indent with spaces, and then make the fix: Jim Meyering (2): envlist.c: convert many leading TABs to spaces via expand -i envlist.c: handle strdup failure envlist.c

[Qemu-devel] [PATCH 1/2] envlist.c: convert many leading TABs to spaces via expand -i

2012-05-22 Thread Jim Meyering
From: Jim Meyering Signed-off-by: Jim Meyering --- envlist.c | 256 +++--- 1 file changed, 128 insertions(+), 128 deletions(-) diff --git a/envlist.c b/envlist.c index f2303cd..1d98108 100644 --- a/envlist.c +++ b/envlist.c @@ -8,13

[Qemu-devel] [PATCH 2/2] envlist.c: handle strdup failure

2012-05-22 Thread Jim Meyering
From: Jim Meyering Without this, envlist_to_environ may silently fail to copy all strings into the destination buffer, and both callers would leak any env strings allocated after a failing strdup, because the freeing code stops at the first NULL pointer. Signed-off-by: Jim Meyering

Re: [Qemu-devel] [PATCH 1/3] envlist.c: handle strdup failure

2012-05-22 Thread Jim Meyering
Kevin Wolf wrote: > A patch replacing tabs by spaces isn't really the kind of patches that > we would want to avoid during freeze. It's easy enough to check with git > diff -w that it doesn't change anything semantically. That makes sense, so I've posted two patches: 1) two patches: one repla

[Qemu-devel] [PATCHv2 0/2] envlist.c: handle strdup failure

2012-05-22 Thread Jim Meyering
From: Jim Meyering This is the same as v1, except that two lines of non-leading TABs in envlist.c (indenting comments after code) have also been converted to use equivalent spaces instead of TABs. Jim Meyering (2): envlist.c: convert all TABs to equivalent spaces envlist.c: handle strdup

[Qemu-devel] [PATCHv2 2/2] envlist.c: handle strdup failure

2012-05-22 Thread Jim Meyering
From: Jim Meyering Without this, envlist_to_environ may silently fail to copy all strings into the destination buffer, and both callers would leak any env strings allocated after a failing strdup, because the freeing code stops at the first NULL pointer. Signed-off-by: Jim Meyering

[Qemu-devel] [PATCHv2 1/2] envlist.c: convert all TABs to equivalent spaces

2012-05-22 Thread Jim Meyering
From: Jim Meyering Signed-off-by: Jim Meyering --- envlist.c | 256 +++--- 1 file changed, 128 insertions(+), 128 deletions(-) diff --git a/envlist.c b/envlist.c index f2303cd..be0addb 100644 --- a/envlist.c +++ b/envlist.c @@ -8,13

Re: [Qemu-devel] [PATCH 1/3] envlist.c: handle strdup failure

2012-05-22 Thread Jim Meyering
Kevin Wolf wrote: > Am 22.05.2012 11:05, schrieb Jim Meyering: >> Kevin Wolf wrote: >>> A patch replacing tabs by spaces isn't really the kind of patches that >>> we would want to avoid during freeze. It's easy enough to check with git >>> diff -

[Qemu-devel] [PATCHv3 0/2] envlist.c: handle strdup failure

2012-05-22 Thread Jim Meyering
From: Jim Meyering Same as v2, but now with TABs converted using expand --tabs=4. Jim Meyering (2): envlist.c: convert each TAB(width-4) to equivalent spaces envlist.c: handle strdup failure envlist.c | 272 -- 1 file changed

[Qemu-devel] [PATCHv3 1/2] envlist.c: convert each TAB(width-4) to equivalent spaces

2012-05-22 Thread Jim Meyering
From: Jim Meyering Signed-off-by: Jim Meyering --- envlist.c | 256 +++--- 1 file changed, 128 insertions(+), 128 deletions(-) diff --git a/envlist.c b/envlist.c index f2303cd..e44889b 100644 --- a/envlist.c +++ b/envlist.c @@ -8,13

[Qemu-devel] [PATCHv2 2/9] tcg: __jit_debug_descriptor must *not* be static

2012-05-22 Thread Jim Meyering
From: Jim Meyering Add comments so no one else will be tempted to reduce the scope of this global variable. Signed-off-by: Jim Meyering --- tcg/tcg.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index ab589c7..2793fa6 100644 --- a/tcg

Re: [Qemu-devel] [PATCH 2/9] tcg: declare __jit_debug_descriptor to be static

2012-05-22 Thread Jim Meyering
Peter Maydell wrote: > On 21 May 2012 21:10, Jim Meyering wrote: >> Peter Maydell wrote: >>> On 21 May 2012 20:51, Jim Meyering wrote: >>>> From: Jim Meyering >>>> >>>> >>>> Signed-off-by: Jim Meyering >>>&g

Re: [Qemu-devel] [PATCHv2 1/2] envlist.c: convert all TABs to equivalent spaces

2012-05-22 Thread Jim Meyering
Peter Maydell wrote: > On 22 May 2012 10:50, Jim Meyering wrote: >> From: Jim Meyering > > If we're going to go to the effort of a complete reindent > patch we should actually reindent to the QEMU coding style > standard, which is four-space, not eight. Good point. V3 is on its way.

[Qemu-devel] [PATCHv3 2/2] envlist.c: handle strdup failure

2012-05-22 Thread Jim Meyering
From: Jim Meyering Without this, envlist_to_environ may silently fail to copy all strings into the destination buffer, and both callers would leak any env strings allocated after a failing strdup, because the freeing code stops at the first NULL pointer. Signed-off-by: Jim Meyering

[Qemu-devel] [PATCH v2 6/6] softmmu-semi: fix lock_user* functions not to deref NULL upon OOM

2012-05-24 Thread Jim Meyering
Return NULL upon malloc failure. Signed-off-by: Jim Meyering --- Improved based on suggestion from Peter Maydell: Handle malloc failure rather than relying on g_malloc, since we can't afford to let guest-provided "len" induce g_malloc's abort. softmmu-semi.h | 5

Re: [Qemu-devel] [PATCH 6/6] softmmu-semi: fix lock_user* functions not to deref NULL upon OOM

2012-05-24 Thread Jim Meyering
Peter Maydell wrote: > On 16 May 2012 14:08, Jim Meyering wrote: >> From: Jim Meyering >> >> Use g_malloc/g_free in place of malloc/free. >> >> Signed-off-by: Jim Meyering >> --- >>  softmmu-semi.h | 6 +++--- >>  1 file changed, 3 insertions(+

Re: [Qemu-devel] [V9fs-developer] Breaking out virtfs as a standalone server?

2011-04-11 Thread Jim Garlick
de.google.com/p/diod/wiki/protocol Maybe that will be a helpful start for someone implementing a new server, until something more official comes along. Jim On Mon, Apr 11, 2011 at 01:28:49PM -0700, Venkateswararao Jujjuri wrote: > On 04/11/2011 06:42 AM, Rob Landley wrote: > > Righ

[Qemu-devel] [PATCH] qcow2: don't ignore failed update_refcount

2010-02-08 Thread Jim Meyering
ignored. This fixes them: >From 107940556a2d0ef1de1d59a5da0c6c3086246817 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 8 Feb 2010 11:50:59 +0100 Subject: [PATCH] qcow2: don't ignore failed update_refcount * block/qcow2-refcount.c (grow_refcount_table): When update_refcount fails

[Qemu-devel] Re: [PATCH] qcow2: don't ignore failed update_refcount

2010-02-08 Thread Jim Meyering
Kevin Wolf wrote: ... > I'm currently working on fixing exactly this, and unfortunaly, no, it's > not that easy. What you introduce looks like proper error handling at > first sight, but what happens in fact is that while the current write > request correctly fails now we're running with corrupted

[Qemu-devel] [PATCH] don't dereference NULL after failed strdup

2010-02-08 Thread Jim Meyering
e74c20aa8c7 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 8 Feb 2010 18:29:29 +0100 Subject: [PATCH] don't dereference NULL after failed strdup Handle failing strdup by replacing each use with qemu_strdup, so as not to dereference NULL or trigger a failing assertion. * block/curl.c (

[Qemu-devel] [PATCH] qemu: reset buffer pointers after CR/LF

2007-08-13 Thread Jim Paris
If readline_handle_byte() is sent both a CR and LF, and readline_start() is not called after the first CR, then the LF will cause the same command to be executed a second time. Fix this by explicitly resetting the buffer pointers when it is processed. Signed-off-by: Jim Paris <[EMAIL PROTEC

[Qemu-devel] QEMU Patch

2006-09-03 Thread Jim Peterson
on an Pentium 4 host) --Jim diff -ruN qemu-0.8.2/hw/pc.c qemu-0.8.2.new/hw/pc.c --- qemu-0.8.2/hw/pc.c 2006-07-22 13:23:34.0 -0400 +++ qemu-0.8.2.new/hw/pc.c 2006-09-02 15:30:49.0 -0400 @@ -163,11 +163,16 @@ int i; /* set the CMOS date */ -time(&ti); -if (rtc_u

[Qemu-devel] Developer Mailinglist Archives

2005-05-05 Thread Jim Provan
For about a week, I have not been able to get into the QEMU developer mailinglist archives. Has anyone else had this problem ? Is it going to be corrected ? I receive email from the mailinglist, I am just not able to get into the list from the website. Jim Provan

Re: [Qemu-devel] Re: Developer Mailinglist Archives

2005-05-05 Thread Jim Provan
Thanks for all the responses. Jim Provan Ben Pfaff wrote: Jim Provan <[EMAIL PROTECTED]> writes: For about a week, I have not been able to get into the QEMU developer mailinglist archives. Has anyone else had this problem ? Is it going to be corrected ? T

Re: [Qemu-devel] SuSE 10

2005-11-13 Thread Jim Provan
list=i386-softmmu make all su root make install This will get you going. Jim Provan Hi! I've just upgraded to SuSE 10.0 and since it's now based on GCC4 I would like to know if there 's a way to compile QEMU with this distribution?

Re: [PATCH] gtk: disable GTK Clipboard with a new option 'gtk_clipboard'

2022-11-18 Thread Jim Fehlig
@@ -93,6 +93,7 @@ meson_options_help() { printf "%s\n" ' glusterfs Glusterfs block device driver' printf "%s\n" ' gnutls GNUTLS cryptography support' printf "%s\n" ' gtk GTK+ user interface' + pr

Re: [PATCH] gtk: disable GTK Clipboard with a new option 'gtk_clipboard'

2022-11-21 Thread Jim Fehlig
On 11/21/22 04:24, Claudio Fontana wrote: On 11/18/22 23:26, Jim Fehlig wrote: I should make myself useful around here on occasion when items are within my skill set. But I already struggle to find time for that in the libvirt community :-). Thanks for taking a look, On 11/8/22 09:23

Re: [PATCH v2] gtk: disable GTK Clipboard with a new meson option

2022-11-21 Thread Jim Fehlig
'./configure --help' contained your text :-). Reviewed-by: Jim Fehlig v1 -> v2: * fixed a too long line in scripts/meson-buildoptions.sh (checkpatch) * meson.build: set have_gtk_clipboard variable once, avoid duplication (Jim) * mention the warnings about experimental nature of t

[PATCH] target/riscv: support cache-related PMU events in virtual mode

2022-11-23 Thread Jim Shu
let tlb_fill() function also increments PMU counter when it is from two-stage translation, so QEMU could also monitor these PMU events when CPU runs in VS/VU mode (like running guest OS). Signed-off-by: Jim Shu --- target/riscv/cpu_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] hw/intc: sifive_plic: fix out-of-bound access of source_priority array

2022-11-27 Thread Jim Shu
If the number of interrupt is not multiple of 32, PLIC will have out-of-bound access to source_priority array. Compute the number of interrupt in the last word to avoid this out-of-bound access of array. Signed-off-by: Jim Shu --- hw/intc/sifive_plic.c | 12 +++- 1 file changed, 11

Re: [PATCH] target/riscv: Support SW update of PTE A/D bits and Ssptwad extension

2022-07-25 Thread Jim Shu
Hi Alistair, Why do we want to support that? We can do either and we are > implementing the much more usual scheme. I don't see a reason to > bother implementing the other one. Is anyone ever going to use it? > Thanks for your response. I got it. Regards, Jim Shu

[PATCH] print memory in MB units in initrd-too-large errmsg

2023-08-04 Thread Jim Cromie
size check. With MB displayed, I have to ask: is it coincidence that max == 2048-1 ? Signed-off-by: Jim Cromie --- hw/i386/x86.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index a88a126123..0677fe2fd1 100644 --- a/hw/i386/x86.c +++ b/hw/

Re: [PATCH] print memory in MB units in initrd-too-large errmsg

2023-08-06 Thread jim . cromie
On Sat, Aug 5, 2023 at 12:26 AM Markus Armbruster wrote: > > Jim Cromie writes: > > > Change 2 error messages to display sizes in MB, not bytes. > > > > qemu: initrd is too large, cannot support this. (max: 2047 MB, need 5833 MB) > > > > Also, disti

Re: Why does the vmovdqu works for passthrough device but crashes for emulated device with "illegal operand" error (in x86_64 QEMU, -accel = kvm) ?

2024-03-04 Thread Jim Mattson
On Mon, Mar 4, 2024 at 6:11 PM Xu Liu wrote: > > Hey Alex and Paolo, > > I saw there is some code related to AVX > https://elixir.bootlin.com/linux/latest/source/arch/x86/kvm/emulate.c#L668 > > Does that mean in some special cases, kvm supports AVX instructions ? > I didn’t really know the big p

Re: [PATCH 2/2] target/riscv: Make the "virt" register writable by GDB

2023-03-08 Thread Jim Shu
Thanks for reviewing. I'll fix this issue. On Mon, Mar 6, 2023 at 7:26 PM LIU Zhiwei wrote: > > > On 2023/3/5 17:42, Jim Shu wrote: > > This patch also enables debugger to set current privilege mode to > > VU/VS-mode. > > > > Extend previous commit 81d29

Re: [PATCH 2/2] target/riscv: Make the "virt" register writable by GDB

2023-03-08 Thread Jim Shu
On Mon, Mar 6, 2023 at 7:26 PM LIU Zhiwei wrote: > > > On 2023/3/5 17:42, Jim Shu wrote: > > This patch also enables debugger to set current privilege mode to > > VU/VS-mode. > > > > Extend previous commit 81d2929c41d32af138f3562f5a7b309f6eac7ca7 to > > sup

[Bug 1735049] Re: Need MTTCG support for x86 guests

2022-02-26 Thread Jim Kleckner
See the discussion linked below that says that strong on weak is not actually fully supported yet. Is that discussion correct? === In short they explained to me that since the host arm64 is a weaker memory order than the guest x86 they disabled mttcg because if they would implement it would slow

Re: [PATCH v11 00/16] target/riscv: Update QEmu for Zb[abcs] 1.0.0

2021-09-27 Thread Jim Wilson
to use with the gcc that you are using. This stuff hasn't been actively maintained so we have old gcc and binutils release versions. We are in the process of putting stuff upstream now. Jim

Re: [PATCH] include/hw/riscv/sifive_e.h: Fix the type of parent_obj of SiFiveEState.

2022-08-21 Thread Jim Shu
Reviewed-by: Jim Shu On Fri, Aug 19, 2022 at 3:11 PM Tommy Wu wrote: > > Fix the type of parent_obj of SiFiveEState from 'SysBusDevice' > to 'MachineState'. Because the parent of SiFiveEState is 'MachineState'. > > Signed-off-by: Tommy Wu > ---

Re: [PATCH v4] x86: add etc/phys-bits fw_cfg file

2022-09-22 Thread Jim Mattson
On Thu, Sep 22, 2022 at 7:16 AM Gerd Hoffmann wrote: > > On Thu, Sep 22, 2022 at 02:38:02PM +0200, Paolo Bonzini wrote: > > On Thu, Sep 22, 2022 at 2:21 PM Gerd Hoffmann wrote: > > > No. This will basically inform the guest that host-phys-bits has been > > > enabled (and pass the number of bits)

[PATCH] hw/intc: sifive_plic: fix hard-coded max priority level

2022-09-25 Thread Jim Shu
Property in maximum priority level. Signed-off-by: Emmanuel Blot Signed-off-by: Jim Shu Reviewed-by: Frank Chang --- hw/intc/sifive_plic.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/intc/sifive_plic.c b/hw/intc/sifive_plic.c index af4ae3630e..f864efa761 100644

Re: [PATCH 2/4] hw/intc: sifive_plic.c: Fix interrupt priority index.

2022-09-25 Thread Jim Shu
formula "irq = ((addr - plic->priority_base) >> 2) + 1" will take offset 0x4 as IRQ source 1, which is correct. Your fix will cause the bug in existing machines. Thanks, Jim Shu On Tue, Sep 6, 2022 at 11:21 PM Tyler Ng wrote: > > Here's the patch

Re: [PATCH 2/4] hw/intc: sifive_plic.c: Fix interrupt priority index.

2022-09-26 Thread Jim Shu
Hi Tyler, Thanks for the explanation. I understand the issue here. I think we should align the priority base in each RISC-V platform to the same value (no matter 0x0 or 0x4) if they use PLIC in the same way. Thanks, Jim Shu On Tue, Sep 27, 2022 at 4:04 AM Tyler Ng wrote: > >

Re: [PATCH] hw/intc: sifive_plic: fix hard-coded max priority level

2022-09-28 Thread Jim Shu
"num_priorities + 1" should be power-of-2 and SW could discover available bits of interrupt source priority. I'll do this enhancement in the next version patch. [1] https://github.com/riscv/riscv-plic-spec/blob/master/riscv-plic.adoc#interrupt-priorities Thanks, Jim Shu On Mon, S

[PATCH v2 1/2] hw/intc: sifive_plic: fix hard-coded max priority level

2022-09-30 Thread Jim Shu
Property in maximum priority level. Signed-off-by: Emmanuel Blot Signed-off-by: Jim Shu Reviewed-by: Frank Chang --- hw/intc/sifive_plic.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/intc/sifive_plic.c b/hw/intc/sifive_plic.c index af4ae3630e..f864efa761 100644

[PATCH v2 0/2] Enhance maximum priority support of PLIC

2022-09-30 Thread Jim Shu
This patchset fixes hard-coded maximum priority of interrupt priority register and also changes this register to WARL field to align the PLIC spec. Changelog: v2: * change interrupt priority register to WARL field. Jim Shu (2): hw/intc: sifive_plic: fix hard-coded max priority level hw

[PATCH v2 2/2] hw/intc: sifive_plic: change interrupt priority register to WARL field

2022-09-30 Thread Jim Shu
hange each bit of interrupt priority register to WARL field when the number of supported priority is power-of-2. [1] https://github.com/riscv/riscv-plic-spec/blob/master/riscv-plic.adoc#interrupt-priorities Signed-off-by: Jim Shu --- hw/intc/sifive_plic.c | 21 +++-- 1 file change

Re: [PATCH v2 2/2] hw/intc: sifive_plic: change interrupt priority register to WARL field

2022-09-30 Thread Jim Shu
hi Clément, Thank you very much. I'll fix it in the next version patch. Thanks, Jim Shu On Fri, Sep 30, 2022 at 8:58 PM Clément Chigot wrote: > > Hi Jim, > > On Fri, Sep 30, 2022 at 2:32 PM Jim Shu wrote: > > > > PLIC spec [1] requires interrupt source priority

Re: [PATCH v2 2/2] hw/intc: sifive_plic: change interrupt priority register to WARL field

2022-10-02 Thread Jim Shu
Hi Clément, > > > @@ -180,7 +180,15 @@ static void sifive_plic_write(void *opaque, hwaddr > > > addr, uint64_t value, > > > if (addr_between(addr, plic->priority_base, plic->num_sources << 2)) > > > { > > > uint32_t irq = ((addr - plic->priority_base) >> 2) + 1; > > > > > > -

<    1   2   3   4   5   6   7   8   >