On Wed, May 5, 2021 at 3:19 PM Alex Bennée wrote:
>
> Mahmoud Mandour writes:
>
> > Added a table-like output which contains the total number of calls
> > for each used syscall along with the number of errors that occurred.
> >
> > Per-call tracing is stil
vious patch had some errors. Also, I thought
that it's better to split the patch into smaller pieces.
The previous patch can be found here:
https://lists.gnu.org/archive/html/qemu-devel/2021-03/msg05153.html
Mahmoud Mandour (8):
virtiofsd: Changed allocations of fuse_req to GLib functions
ucts and
fv_QueueInfo structs.
Signed-off-by: Mahmoud Mandour
---
tools/virtiofsd/fuse_virtio.c | 19 ++-
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/tools/virtiofsd/fuse_virtio.c b/tools/virtiofsd/fuse_virtio.c
index 07e5d91a9f..5828b9a76f 100644
--- a/t
Replaced the allocation and deallocation of fuse_req structs
using calloc()/free() call pairs to a GLib's g_try_new0()
and g_free().
Signed-off-by: Mahmoud Mandour
---
tools/virtiofsd/fuse_lowlevel.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/virt
Changed the allocations of some local variables to GLib's allocation
functions, such as g_try_malloc0(), and annotated those variables
as g_autofree. Subsequently, I was able to remove the calls to free().
Signed-off-by: Mahmoud Mandour
---
tools/virtiofsd/passthrough_ll.c
er
to the calling function and still auto-frees the memory when the calling
function finishes (maintaining the symantics of previous code).
Signed-off-by: Mahmoud Mandour
---
tools/virtiofsd/fuse_lowlevel.c | 19 +++
tools/virtiofsd/fuse_virtio.c | 6 +-
2 files chang
Changed allocation of fuse_pollhandle structs to GLib's g_new().
Removed the null checking as allocating such a small memory segment
should always succeed on a healthy system. Otherwise, the system
is already in a critical state.
Signed-off-by: Mahmoud Mandour
---
tools/virt
: Mahmoud Mandour
---
tools/virtiofsd/fuse_lowlevel.c | 10 +++---
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_lowlevel.c
index 45527ff703..b0e9ef29a7 100644
--- a/tools/virtiofsd/fuse_lowlevel.c
+++ b/tools/virtiofsd
Replaced the allocation of local variables from malloc() to
GLib allocation functions.
In one instance, dropped the usage to an assert after a malloc()
call and used g_malloc() instead.
Signed-off-by: Mahmoud Mandour
---
tools/virtiofsd/fuse_virtio.c | 9 -
1 file changed, 4 insertions
Replaced (re)allocation of lo_map_elem structs from realloc() to
GLib's g_try_realloc_n() and replaced the respective free() call
with a g_free().
Signed-off-by: Mahmoud Mandour
---
tools/virtiofsd/passthrough_ll.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/
On Fri, Mar 19, 2021 at 3:25 PM Mahmoud Mandour
wrote:
> Replaced allocations done using malloc(), calloc(), and realloc()
> to their equivalent functions in GLib.
>
> Memory that is allocated locally and freed when the function exits
> are annotated g_autofree so that the
Replaced the allocation and deallocation of fuse_session structs
from calloc() and free() calls to g_try_new0() and g_free().
Signed-off-by: Mahmoud Mandour
---
tools/virtiofsd/fuse_lowlevel.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/virtiofsd
On Wed, Mar 24, 2021 at 2:57 PM Stefan Hajnoczi wrote:
> Please use Reply-All on mailing list emails so that the mailing like and
> all other CC email addresses are included in the discussion.
>
That's my bad, hopefully this won't happen again in the future.
Mahmoud
Removed a qemu_mutex_lock() and its respective qemu_mutex_unlock()
and used QEMU_LOCK_GUARD instead. This simplifies the code by
eliminiating gotos and removing the qemu_mutex_unlock() calls.
Signed-off-by: Mahmoud Mandour
---
backends/tpm/tpm_emulator.c | 8 +++-
1 file changed, 3
calls to
qemu_mutex_lock/unlock are a matching pair.
Mahmoud Mandour (9):
tpm: Changed a qemu_mutex_lock to QEMU_LOCK_GUARD
block: Replaced qemu_mutex_lock calls with QEMU_LOCK_GUARD
char: Replaced a qemu_mutex_lock with QEMU_LOCK_GUARD
util: Replaced qemu_mutex_lock with QEMU_LOCK_G
Replaced various qemu_mutex_lock/qemu_mutex_unlock calls with
lock guard macros (QEMU_LOCK_GUARD() and WITH_QEMU_LOCK_GUARD).
This slightly simplifies the code by eliminating calls to
qemu_mutex_unlock and eliminates goto paths.
Signed-off-by: Mahmoud Mandour
---
block/curl.c | 13 ++--
block
Removed various qemu_mutex_lock and their respective qemu_mutex_unlock
calls and used lock guard macros (QEMU_LOCK_GUARD and
WITH_QEMU_LOCK_GUARD). This simplifies the code by
eliminating qemu_mutex_unlock calls.
Signed-off-by: Mahmoud Mandour
---
monitor/monitor.c | 8 ++--
monitor/qmp.c
Replaced some calls to qemu_mutex_lock and their respective
qemu_mutex_unlock calls with QEMU_LOCK_GUARD macro. This simplifies
the code by removing the calls to qemu_mutex_unlock and eliminates
goto paths.
Signed-off-by: Mahmoud Mandour
---
hw/hyperv/vmbus.c | 13 +
1 file changed
Removed a pair of qemu_mutex_lock and its respective qemu_mutex_unlock
and used a QEMU_LOCK_GUARD instead. This improves readability by
removing the call to qemu_mutex_unlock.
Signed-off-by: Mahmoud Mandour
---
chardev/char.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a
Removed various qemu_mutex_lock calls and their respective
qemu_mutex_unlock calls and used QEMU_LOCK_GUARD. This simplifies
the code by eliminating various goto paths and removes
qemu_mutex_unlock calls.
Signed-off-by: Mahmoud Mandour
---
util/filemonitor-inotify.c | 24
Replaced various qemu_mutex_lock calls and their respective
qemu_mutex_unlock calls with QEMU_LOCK_GUARD macro. This simplifies
the code by eliminating the respective qemu_mutex_unlock calls.
Signed-off-by: Mahmoud Mandour
---
migration/migration.c | 6 ++
migration/ram.c | 6
In various places, qemu_mutex_lock calls and their respective
calls to qemu_mutex_unlock are replaced with QEMU_LOCK_GUARD macros.
This simplifies the code by removing the calls to
qemu_mutex_unlock and eliminates goto paths.
Signed-off-by: Mahmoud Mandour
---
hw/virtio/virtio-iommu.c | 78
Replaced a call to qemu_mutex_lock and its respective call to
qemu_mutex_unlock and used QEMU_LOCK_GUARD macro in their place.
This simplifies the code by removing the call required to unlock
and also eliminates goto paths.
Signed-off-by: Mahmoud Mandour
---
hw/9pfs/9p-synth.c | 12
at 1:59 PM Christian Schoenebeck <
qemu_...@crudebyte.com> wrote:
> On Donnerstag, 11. März 2021 12:52:45 CET Greg Kurz wrote:
> > On Thu, 11 Mar 2021 11:49:06 +0100
> >
> > Christian Schoenebeck wrote:
> > > On Donnerstag, 11. März 2021 04:15:37 CET Mahmoud Ma
at 12:23 PM Vladimir Sementsov-Ogievskiy <
vsement...@virtuozzo.com> wrote:
> 11.03.2021 06:15, Mahmoud Mandour wrote:
> > Replaced various qemu_mutex_lock/qemu_mutex_unlock calls with
> > lock guard macros (QEMU_LOCK_GUARD() and WITH_QEMU_LOCK_GUARD).
> > This slightly si
ll to free().
Mahmoud Mandour (9):
bsd-user/elfload.c: Replaced calls to malloc/free with GLib variants
hw/audio/fmopl.c: Fixing some style errors.
hw/audio/fmopl.c: Replaced calls to malloc with GLib's variants
pc-bios/s390-ccw/netmain.c: Changed a malloc/free to GLib's variants
Replaced the calls to malloc(), realloc(), and free() to their
equivalents in GLib's allocation functions in various places.
Signed-off-by: Mahmoud Mandour
---
bsd-user/elfload.c | 74 +++---
1 file changed, 37 insertions(+), 37 deletions(-)
diff --
Replaced a malloc() call and its respective free() with
GLib's g_try_malloc() and g_free() calls.
Signed-off-by: Mahmoud Mandour
---
tools/virtiofsd/fuse_opt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/virtiofsd/fuse_opt.c b/tools/virtiofsd/fuse_opt.c
Fixed style errors on the relevant lines in which
I will introduce changes.
Signed-off-by: Mahmoud Mandour
---
hw/audio/fmopl.c | 52
1 file changed, 26 insertions(+), 26 deletions(-)
diff --git a/hw/audio/fmopl.c b/hw/audio/fmopl.c
index
Replaced a malloc() call and its respective free() call with
GLib's g_try_malloc() and g_free(). Also, did slight styling
changes that were producing errors using the checkpatch.pl
script.
Signed-off-by: Mahmoud Mandour
---
util/compatfd.c | 10 +-
1 file changed, 5 insertions(
Replaced calls to malloc(), and free() to their equivalent
allocation functions from GLib.
Also added checking for null after ENV_CURVE allocation
following the same pattern of checking on preceeding
table allocations.
Signed-off-by: Mahmoud Mandour
---
hw/audio/fmopl.c | 41
Replaced a call to calloc() and its respective free() call
with GLib's g_try_new0() and g_free() calls.
Signed-off-by: Mahmoud Mandour
---
tools/virtiofsd/buffer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/virtiofsd/buffer.c b/tools/virtiofsd/buffer.c
Changed a call to malloc() and its respective calls free() with
GLib's allocation and deallocation functions.
Signed-off-by: Mahmoud Mandour
---
pc-bios/s390-ccw/netmain.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s39
Replaced the calls to malloc() and their respective calls to
free() with GLib's allocation and deallocation functions.
Signed-off-by: Mahmoud Mandour
---
target/xtensa/xtensa-isa.c | 28 ++--
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/target/x
established through GLib's functions.
Signed-off-by: Mahmoud Mandour
---
tools/virtiofsd/fuse_lowlevel.c | 30 ++--
tools/virtiofsd/fuse_virtio.c| 34
tools/virtiofsd/passthrough_ll.c | 32 +++---
3 files change
ng to resend it (after
amending those problems). Therefore I'm going to exclude this commit.
On Sat, Mar 13, 2021 at 8:50 PM Christian Borntraeger <
borntrae...@de.ibm.com> wrote:
> On 13.03.21 17:36, Mahmoud Mandour wrote:
> > Changed a call to malloc() and its respective call
ll to free().
This series was resent due to some previous problems that are hopefully
resolved in this series.
Mahmoud Mandour (8):
bsd-user/elfload.c: Replaced calls to malloc/free with GLib variants
hw/audio/fmopl.c: Fixing some style errors
hw/audio/fmopl.c: Replaced calls to malloc with G
Replaced the calls to malloc(), realloc(), and free() to their
equivalents in GLib's allocation functions in various places.
Signed-off-by: Mahmoud Mandour
---
bsd-user/elfload.c | 74 +++---
1 file changed, 37 insertions(+), 37 deletions(-)
diff --
Replaced calls to malloc(), and free() to their equivalent
allocation functions from GLib.
Also added checking for null after ENV_CURVE allocation
following the same pattern of checking on preceeding
table allocations.
Signed-off-by: Mahmoud Mandour
---
hw/audio/fmopl.c | 42
Fixed style errors on the relevant lines in which
I will introduce changes.
Signed-off-by: Mahmoud Mandour
---
hw/audio/fmopl.c | 58 ++--
1 file changed, 32 insertions(+), 26 deletions(-)
diff --git a/hw/audio/fmopl.c b/hw/audio/fmopl.c
index
Replaced a malloc() call and its respective free() call with
GLib's g_try_malloc() and g_free().
Also, did slight styling changes that were producing
style errors when using the checkpatch.pl script against
the file.
Signed-off-by: Mahmoud Mandour
---
util/compatfd.c | 10 +-
1
Replaced the calls to malloc() and their respective calls to
free() with GLib's allocation and deallocation functions.
Removed null checking before calling g_free() because it's
not necessary and generates style errors.
Signed-off-by: Mahmoud Mandour
---
target/xtensa/xtensa-
Replaced a malloc() call and its respective free() with
GLib's g_try_malloc() and g_free() calls.
Signed-off-by: Mahmoud Mandour
---
tools/virtiofsd/fuse_opt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/virtiofsd/fuse_opt.c b/tools/virtiofsd/fuse_opt.c
Replaced a call to calloc() and its respective free() call
with GLib's g_try_new0() and g_free() calls.
Signed-off-by: Mahmoud Mandour
---
tools/virtiofsd/buffer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/virtiofsd/buffer.c b/tools/virtiofsd/buffer.c
established through GLib's functions.
Signed-off-by: Mahmoud Mandour
---
tools/virtiofsd/fuse_lowlevel.c | 30 ++--
tools/virtiofsd/fuse_virtio.c| 34
tools/virtiofsd/passthrough_ll.c | 32 +++---
3 files change
>
> If it's unrelated, then maybe better do it in a separate patch.
>
I thought so but I didn't know whether it was a so-small change
that it didn't require its own patch or not. I will amend that.
Since this is only a very small allocation, I think it would be better to
> use g_malloc() here and
On Mon, Mar 15, 2021 at 12:01 PM Stefan Hajnoczi
wrote:
> On Sun, Mar 14, 2021 at 05:23:24AM +0200, Mahmoud Mandour wrote:
> > @@ -130,7 +130,7 @@ static struct fuse_req *fuse_ll_alloc_req(struct
> fuse_session *se)
> > {
> > struct fuse_req *req;
> >
&
healthy system.
Otherwise, the system is already in a critical state.
Subsequently, removed NULL-checking after g_malloc().
Signed-off-by: Mahmoud Mandour
---
util/compatfd.c | 8 ++--
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/util/compatfd.c b/util/compatfd.c
index 174f394533
ation is already small and its better
if the system aborts on failure of such small allocations.
Mahmoud Mandour (2):
util/compatfd.c: Fixed style issues
util/compatfd.c: Replaced a malloc call with g_malloc.
util/compatfd.c | 14 +-
1 file changed, 5 insertions(+), 9 dele
Fixed two styling issues that caused checkpatch.pl errors.
Signed-off-by: Mahmoud Mandour
---
util/compatfd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/util/compatfd.c b/util/compatfd.c
index ee47dd8089..174f394533 100644
--- a/util/compatfd.c
+++ b/util
On Mon, Mar 15, 2021 at 1:13 PM Philippe Mathieu-Daudé
wrote:
> Hi Mahmoud,
>
> On 3/15/21 11:58 AM, Mahmoud Mandour wrote:
> > Replaced a call to malloc() and its respective call to free()
> > with g_malloc() and g_free().
> >
> > g_malloc() is preferred m
ll make the
changes again and properly, split the patch, and then send it as a
series regarding this file.
Thanks
Mahmoud Mandour
null checks
for the tables
to be dropped. And that's because of the cruciality of this initialization
code.
Can you please elaborate more on how I would employ g_autofree in this
code? Are
you talking about the memory allocated for ``ptr`` in OPLCreate here?
Thanks
Mahmoud Mandour
In this RFC patch series, I propose an initial cache modelling TCG
plugin. As of now, it models separate L1 data cache and L1 instruction
cache. It supports three eviction policies: LRU, random, and FIFO. Once
a policy is chosen, it's used for both instruction and data caches.
Mahmoud Mando
Now one of the three eviction policies can be chosen as an argument. On
not specifying an argument, LRU is used by default.
Signed-off-by: Mahmoud Mandour
---
contrib/plugins/cache.c | 159
1 file changed, 146 insertions(+), 13 deletions(-)
diff --git a
Made both icache and dcache configurable through plugin arguments
and added memory trace printing in a separate file.
Signed-off-by: Mahmoud Mandour
---
contrib/plugins/cache.c | 68 +++--
1 file changed, 66 insertions(+), 2 deletions(-)
diff --git a/contrib
Added a cache modelling plugin that uses a static configuration used in
many of the commercial microprocessors and uses random eviction policy.
Signed-off-by: Mahmoud Mandour
---
contrib/plugins/Makefile | 1 +
contrib/plugins/cache.c | 398 +++
2 files
Added a cache modelling plugin that uses a static configuration used in
many of the commercial microprocessors and uses random eviction policy.
Signed-off-by: Mahmoud Mandour
---
contrib/plugins/Makefile | 1 +
contrib/plugins/cache.c | 398 +++
2 files
ld double-free it.
How do I mitigate this? I need to free the InsnData passed to
vcpu_mem_access only once if we find out that it's an IO
access since we do not need it anymore and it will early
return every time.
Mahmoud Mandour (3):
plugins: Added a new
Now one of the three eviction policies can be chosen as an argument. On
not specifying an argument, LRU is used by default.
Signed-off-by: Mahmoud Mandour
---
contrib/plugins/cache.c | 159
1 file changed, 146 insertions(+), 13 deletions(-)
diff --git a
Made both icache and dcache configurable through plugin arguments
and added memory trace printing in a separate file.
Signed-off-by: Mahmoud Mandour
---
contrib/plugins/cache.c | 68 +++--
1 file changed, 66 insertions(+), 2 deletions(-)
diff --git a/contrib
Thank you, I'll also CC Emilio in the v2 of this series.
On Sun, May 30, 2021 at 8:36 AM Philippe Mathieu-Daudé
wrote:
> Cc'ing Emilio too.
>
> On 5/29/21 5:22 PM, Mahmoud Mandour wrote:
> > In this RFC patch series, I propose an initial cache modelling TCG
> &g
On Sun, May 30, 2021 at 8:37 AM Mahmoud Mandour
wrote:
> In this RFC patch series, I propose an initial cache modelling TCG
> plugin. As of now, it models separate L1 data cache and L1 instruction
> cache. It supports three eviction policies: LRU, random, and FIFO. Once
> a poli
On Sun, May 30, 2021 at 8:37 AM Mahmoud Mandour
wrote:
> Added a cache modelling plugin that uses a static configuration used in
> many of the commercial microprocessors and uses random eviction policy.
>
> Signed-off-by: Mahmoud Mandour
> ---
> contrib/plugins/Makefile
CC'ing Emilio
On Sun, May 30, 2021 at 8:37 AM Mahmoud Mandour
wrote:
> Made both icache and dcache configurable through plugin arguments
> and added memory trace printing in a separate file.
>
> Signed-off-by: Mahmoud Mandour
> ---
> contr
On Sun, May 30, 2021 at 8:37 AM Mahmoud Mandour
wrote:
> Now one of the three eviction policies can be chosen as an argument. On
> not specifying an argument, LRU is used by default.
>
> Signed-off-by: Mahmoud Mandour
> ---
> contrib/plu
On Tue, Jun 1, 2021 at 1:12 PM Alex Bennée wrote:
>
> Mahmoud Mandour writes:
>
> > Added a cache modelling plugin that uses a static configuration used in
> > many of the commercial microprocessors and uses random eviction policy.
> >
> > Signed-off-by: Mahm
On Tue, Jun 1, 2021 at 1:29 PM Alex Bennée wrote:
>
> (Stefan CC'ed for tracing discussion)
>
> Mahmoud Mandour writes:
>
> > Made both icache and dcache configurable through plugin arguments
> > and added memory trace printing in a separate file.
>
> Pleas
On Tue, Jun 1, 2021 at 3:27 PM Alex Bennée wrote:
>
> Mahmoud Mandour writes:
>
> > Now one of the three eviction policies can be chosen as an argument. On
> > not specifying an argument, LRU is used by default.
> >
> > Signed-off-by: Mahmoud Mandour
> >
On Tue, Jun 1, 2021 at 4:58 PM Alex Bennée wrote:
> This is a quality of life helper for plugins so they don't need to
> re-implement symbol lookup when dumping an address. The strings are
> constant so don't need to be duplicated. One minor tweak is to return
> NULL instead of a zero length stri
On Tue, Jun 1, 2021 at 3:32 PM Alex Bennée wrote:
>
> Mahmoud Mandour writes:
>
> > In this RFC patch series, I propose an initial cache modelling TCG
> > plugin. As of now, it models separate L1 data cache and L1 instruction
> > cache. It supports three eviction poli
Added a table-like output which contains the total number of calls
for each used syscall along with the number of errors that occurred.
Per-call tracing is still available through supplying the argument
``print`` to the plugin.
Signed-off-by: Mahmoud Mandour
---
v3 -> v4: Added a miss
Added a table-like output which contains the total number of calls
for each used syscall along with the number of errors that occurred.
Per-call tracing is still available through supplying the argument
``print`` to the plugin.
Signed-off-by: Mahmoud Mandour
---
tests/plugin/syscall.c | 94
On Thu, Apr 15, 2021 at 5:20 PM Mahmoud Mandour
wrote:
> Added a table-like output which contains the total number of calls
> for each used syscall along with the number of errors that occurred.
>
> Per-call tracing is still available through supplying the argument
> ``print`
On Fri, Apr 16, 2021 at 8:54 AM Mahmoud Mandour
wrote:
> On Thu, Apr 15, 2021 at 5:20 PM Mahmoud Mandour
> wrote:
>
>>
>> Hello. I just realized that this hunk:
>
> static void vcpu_syscall_ret(qemu_plugin_id_t id, unsigned int vcpu_idx,
>>
Added a table-like output which contains the total number of calls
for each used syscall along with the number of errors that occurred.
Per-call tracing is still available through supplying the argument
``print`` to the plugin.
Signed-off-by: Mahmoud Mandour
---
v1: https://lists.gnu.org
On Mon, Mar 22, 2021 at 5:53 PM Stefan Hajnoczi wrote:
> On Fri, Mar 19, 2021 at 03:47:03PM +0200, Mahmoud Mandour wrote:
> > On Fri, Mar 19, 2021 at 3:25 PM Mahmoud Mandour
> > wrote:
> >
> > > Replaced allocations done using malloc(), calloc(), and reall
Added a table-like output which contains the total number of calls
for each used syscall along with the number of errors that occurred.
Per-call tracing is still available through supplying the argument
``print`` to the plugin.
Signed-off-by: Mahmoud Mandour
---
v2 -> v3: * Locked shared h
patch had some errors. Also, I thought
that it's better to split the patch into smaller pieces.
Mahmoud Mandour (7):
virtiofsd: Changed allocations of fuse_req to GLib functions
virtiofds: Changed allocations of iovec to GLib's functions
virtiofsd: Changed allocations of fuse_se
Replaced the allocation and deallocation of fuse_req structs
using calloc()/free() call pairs to a GLib's g_try_new0()
and g_free().
Signed-off-by: Mahmoud Mandour
Reviewed-by: Stefan Hajnoczi
---
tools/virtiofsd/fuse_lowlevel.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
er
to the calling function and still auto-frees the memory when the calling
function finishes (maintaining the symantics of previous code).
Signed-off-by: Mahmoud Mandour
Reviewed-by: Stefan Hajnoczi
---
tools/virtiofsd/fuse_lowlevel.c | 19 +++
tools/virtiofsd/fuse_virtio.c
Replaced the allocation and deallocation of fuse_session structs
from calloc() and free() calls to g_try_new0() and g_free().
Signed-off-by: Mahmoud Mandour
Reviewed-by: Stefan Hajnoczi
---
tools/virtiofsd/fuse_lowlevel.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git
Replaced (re)allocation of lo_map_elem structs from realloc() to
GLib's g_try_realloc_n() and replaced the respective free() call
with a g_free().
Signed-off-by: Mahmoud Mandour
Reviewed-by: Stefan Hajnoczi
---
tools/virtiofsd/passthrough_ll.c | 4 ++--
1 file changed, 2 insertions(
Replaced the allocation of local variables from malloc() to
GLib allocation functions.
In one instance, dropped the usage to an assert after a malloc()
call and used g_malloc() instead.
Signed-off-by: Mahmoud Mandour
Reviewed-by: Stefan Hajnoczi
---
tools/virtiofsd/fuse_virtio.c | 9
ucts and
fv_QueueInfo structs.
Signed-off-by: Mahmoud Mandour
Reviewed-by: Stefan Hajnoczi
---
tools/virtiofsd/fuse_virtio.c | 19 ++-
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/tools/virtiofsd/fuse_virtio.c b/tools/virtiofsd/fuse_virtio.c
index 07e5d9
Changed the allocations of some local variables to GLib's allocation
functions, such as g_try_malloc0(), and annotated those variables
as g_autofree. Subsequently, I was able to remove the calls to free().
Signed-off-by: Mahmoud Mandour
Reviewed-by: Stefan Hajnoczi
---
tools/virt
On Tue, Apr 20, 2021 at 9:03 PM Vivek Goyal wrote:
> On Tue, Apr 20, 2021 at 05:46:36PM +0200, Mahmoud Mandour wrote:
> > Replaced the allocation and deallocation of fuse_req structs
> > using calloc()/free() call pairs to a GLib's g_try_new0()
> > and g_free().
>
&g
A hash table made using ``g_hash_table_new`` requires manually
freeing any dynamically allocated keys/values. The two patches
in this series fixes this issue in hotblocks and hotpages plugins.
Mahmoud Mandour (2):
plugins/hotblocks: Properly freed the hash table values
plugins/hotpages
Freed the values stored in the hash table ``pages``
returned by ``g_hash_table_get_values()`` by freeing the sorted
list and destroyed the hash table afterward.
Signed-off-by: Mahmoud Mandour
---
contrib/plugins/hotpages.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a
Freed the values stored in the hash table ``hotblocks``
returned by ``g_hash_table_get_values()`` by freeing the sorted
list and destroyed the hash table afterward.
Signed-off-by: Mahmoud Mandour
---
contrib/plugins/hotblocks.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
probably better because the sorted list
is only made on having ``counts != NULL`` and ``counts`` has a next
pointer so essentially at least 2 elements in the list.
Mahmoud Mandour (2):
plugins/hotblocks: Properly freed the hash table values
plugins/hotpages: Properly freed the hash tabl
Freed the values stored in the hash table ``hotblocks``
returned by ``g_hash_table_get_values()`` by freeing the sorted
list and destroyed the hash table afterward.
Signed-off-by: Mahmoud Mandour
---
contrib/plugins/hotblocks.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
Allocated ``pages`` hash table through ``g_hash_table_new_full`` to
add a freeing function & destroyed the hash table on exit.
Signed-off-by: Mahmoud Mandour
---
contrib/plugins/hotpages.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/contrib/plugins/hotpages.c b/con
On Tue, Apr 27, 2021 at 12:25 PM Dr. David Alan Gilbert
wrote:
> * Mahmoud Mandour (ma.mando...@gmail.com) wrote:
> > Replaced the calls to malloc()/calloc() and their respective
> > calls to free() of iovec structs with GLib's allocation and
> > deallocation funct
On Tue, Apr 27, 2021 at 1:01 PM Dr. David Alan Gilbert
wrote:
> * Mahmoud Mandour (ma.mando...@gmail.com) wrote:
> > On Tue, Apr 27, 2021 at 12:25 PM Dr. David Alan Gilbert <
> dgilb...@redhat.com>
> > wrote:
> >
> > > * Mahmoud Mandour (ma.mando...@gmail
. Not g_new0()
because the buffer is immediately overwritten using memcpy.
Signed-off-by: Mahmoud Mandour
---
v2 -> v3:
* Removed a wrongful combination of g_autofree and g_steel_pointer().
* Removed some goto paths that IMHO were not so useful any more.
* In v2, I allocated in_sg_cpy
On Tue, Apr 27, 2021 at 1:33 PM Dr. David Alan Gilbert
wrote:
> * Mahmoud Mandour (ma.mando...@gmail.com) wrote:
> > On Tue, Apr 27, 2021 at 1:01 PM Dr. David Alan Gilbert <
> dgilb...@redhat.com>
> > wrote:
> >
> > > * Mahmoud Mandour (ma.mando...@gmail.c
Previously, on configuring with --enable-virtiofsd and specifying
a target list that does not contain a full-system emulation target,
a spurious error message is emitted. This patch introduces a
meaningful error message for such case.
Signed-off-by: Mahmoud Mandour
---
tools/meson.build | 4
On Wed, Apr 28, 2021 at 3:56 PM Connor Kuehl wrote:
> On 4/28/21 8:35 AM, Mahmoud Mandour wrote:
> > Previously, on configuring with --enable-virtiofsd and specifying
> > a target list that does not contain a full-system emulation target,
> > a spurious error message i
On Wed, Apr 28, 2021 at 4:29 PM Connor Kuehl wrote:
> On 4/28/21 9:13 AM, Mahmoud Mandour wrote:
> >> I am not entirely sure if this is true. The error message before this
> >> patch is applied is:
> >>
> >> ../tools/meson.build:12:6
1 - 100 of 217 matches
Mail list logo