[Qemu-devel] [RFC PATCH] tests: rtl8139: test timers and interrupt

2015-01-07 Thread Frediano Ziglio
Test behaviour of timers and interrupts related to timeouts. Signed-off-by: Frediano Ziglio fredd...@gmail.com --- tests/Makefile | 2 +- tests/rtl8139-test.c | 164 +++ 2 files changed, 165 insertions(+), 1 deletion(-) This patch

Re: [Qemu-devel] [Xen-devel] Project idea: make QEMU more flexible

2014-01-06 Thread Frediano Ziglio
On Mon, 2014-01-06 at 12:54 +, Wei Liu wrote: Hi all This idea is to modify QEMU's Makefiles, plus implementing some stubs to make it possible to tailor QEMU to a smaller binary. The current setup for Xen on X86 is to build i386-softmmu, and uses this single binary for two purposes:

Re: [Qemu-devel] [RFC PATCH] vga: Start supporting resolution not multiple of 16 correctly.

2013-07-28 Thread Frediano Ziglio
2013/7/23 Gerd Hoffmann kra...@redhat.com Hi, Tested-by: Fabio Fantoni fabio.fant...@m2r.biz I tested it for a long time with spice on xen (because qxl will be fully working only after adding SSE support on hvm domUs). It works, I think it is good to add this and the respective

Re: [Qemu-devel] [RFC PATCH] vga: Start supporting resolution not multiple of 16 correctly.

2013-06-18 Thread Frediano Ziglio
Modern notebook support 1366x768 resolution. The resolution width is not multiple of 16 causing some problems. QEMU VGA emulation requires width resolution to be multiple of 8. VNC implementation requires width resolution to be multiple of 16. Signed-off-by: Frediano Ziglio frediano.zig

[Qemu-devel] [RFC PATCH] vga: Start supporting resolution not multiple of 16 correctly.

2013-03-15 Thread Frediano Ziglio
to make this alignment? Signed-off-by: Frediano Ziglio frediano.zig...@citrix.com --- hw/vga.c |2 +- ui/vnc.c | 27 +-- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/hw/vga.c b/hw/vga.c index 1caf23d..d229f06 100644 --- a/hw/vga.c +++ b/hw/vga.c

[Qemu-devel] Fix invalidate if memory requested was not bucket aligned

2012-08-07 Thread Frediano Ziglio
is invalidated the virtual address saved in the reverse mapping is used. This cause that the mapping is freed but the last_address_vaddr is not reset. Signed-off-by: Frediano Ziglio frediano.zig...@citrix.com --- xen-mapcache.c |9 + 1 files changed, 5 insertions(+), 4 deletions

Re: [Qemu-devel] Qemu crashed with lsi booting

2012-07-27 Thread Frediano Ziglio
2012/7/27 Paolo Bonzini pbonz...@redhat.com: Il 26/07/2012 10:31, Frediano Ziglio ha scritto: sudo ./x86_64-softmmu/qemu-system-x86_64 -m 1024 -hda test.qcow -device lsi -drive file=/dev/sdb,if=none,id=XXX -device scsi-block,drive=XXX -enable-kvm -bios ~/seabios/out/bios.bin -serial

[Qemu-devel] Qemu crashed with lsi booting

2012-07-26 Thread Frediano Ziglio
I always get an assert launching this command sudo ./x86_64-softmmu/qemu-system-x86_64 -m 1024 -hda test.qcow -device lsi -drive file=/dev/sdb,if=none,id=XXX -device scsi-block,drive=XXX -enable-kvm -bios ~/seabios/out/bios.bin -serial file:out.txt lsi_scsi: error: Multiple IO pending for request

[Qemu-devel] automatic exit on memory errors

2012-04-04 Thread Frediano Ziglio
Hi, I just realized that on any out of memory conditions Qemu exit with an error. I found this thread on g_malloc http://comments.gmane.org/gmane.comp.emulators.qemu/128863 but nothing related to the exit conditions. I know that out of memory conditions is quite hard to handle but if

[Qemu-devel] [PATCH] make qemu_event_handle static

2012-03-31 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- main-loop.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/main-loop.c b/main-loop.c index db23de0..fc738d1 100644 --- a/main-loop.c +++ b/main-loop.c @@ -164,7 +164,7 @@ static int qemu_signal_init(void) #else

[Qemu-devel] Adding size to snapshot

2012-03-27 Thread Frediano Ziglio
Hi, did you add disk size to snapshot in order to support resizing of snapshot? I remember we discussed about some months ago. Regards Frediano

[Qemu-devel] [PATCH] qcow2: fix 028 iotest

2011-09-23 Thread Frediano Ziglio
This fix bound check bug accessing last cluster if image size is not cluster aligned caused by Unlock during COW patch. Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2-cluster.c |8 ++-- block/qcow2.c |2 +- block/qcow2.h |2 ++ 3 files changed

[Qemu-devel] [PATCH] core: remove qemu_service_io

2011-09-22 Thread Frediano Ziglio
qemu_service_io was mainly an alias to qemu_notify_event, currently used only by PPC for timer hack, so call qemu_notify_event directly. Signed-off-by: Frediano Ziglio fredd...@gmail.com --- arch_init.c |5 - qemu-common.h|3 --- qemu-tool.c |4

Re: [Qemu-devel] [PATCH] qcow2: Unlock during COW

2011-09-22 Thread Frediano Ziglio
2011/9/19 Kevin Wolf kw...@redhat.com: Unlocking during COW allows for more parallelism. One change it requires is that buffers are dynamically allocated instead of just using a per-image buffer. While touching the code, drop the synchronous qcow2_read() function and replace it by a

[Qemu-devel] [PATCH 0/2][RFC?] Remove SIGUSR2 from posix-aio

2011-09-19 Thread Frediano Ziglio
readable. Doubts: - any sense having two patches and not only last one? - comment is perhaps wrong as is also affect main core - is ok if KVM is disabled? more testing required Frediano Ziglio (2): block: avoid storing a constant in qemu_paiocb structure block: avoid SIGUSR2 cpus.c

[Qemu-devel] [PATCH 1/2] block: avoid storing a constant in qemu_paiocb structure

2011-09-19 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- posix-aio-compat.c |5 + 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/posix-aio-compat.c b/posix-aio-compat.c index 3193dbf..7ea63a1 100644 --- a/posix-aio-compat.c +++ b/posix-aio-compat.c @@ -42,7 +42,6 @@ struct

[Qemu-devel] [PATCH 2/2] block: avoid SIGUSR2

2011-09-19 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- cpus.c |5 - posix-aio-compat.c | 14 -- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/cpus.c b/cpus.c index 54c188c..d0cfe91 100644 --- a/cpus.c +++ b/cpus.c @@ -380,11 +380,6 @@ static int

[Qemu-devel] [PATCH v2] block: avoid SIGUSR2

2011-09-19 Thread Frediano Ziglio
Now that iothread is always compiled sending a signal seems only an additional step. This patch also avoid writing to two pipe (one from signal and one in qemu_service_io). Work with kvm enabled or disabled. strace output is more readable (less syscalls). Signed-off-by: Frediano Ziglio fredd

[Qemu-devel] [PATCH] removed usused offset variable

2011-09-16 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- posix-aio-compat.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/posix-aio-compat.c b/posix-aio-compat.c index 3193dbf..63a8fae 100644 --- a/posix-aio-compat.c +++ b/posix-aio-compat.c @@ -181,7 +181,6

Re: [Qemu-devel] [PATCH][RFC][0/2] REF+/REF- optimization

2011-09-15 Thread Frediano Ziglio
2011/9/14 Kevin Wolf kw...@redhat.com: ... But let's measure the effects first, I suspect that for cluster allocation it doesn't help much because every REF- comes with a REF+. That's 50% of effort if REF- clusters are far from REF+ :) I would expect that the next REF+ allocates exactly

Re: [Qemu-devel] [PATCH][RFC][0/2] REF+/REF- optimization

2011-09-14 Thread Frediano Ziglio
2011/9/14 Kevin Wolf kw...@redhat.com: Am 13.09.2011 15:36, schrieb Frediano Ziglio: 2011/9/13 Kevin Wolf kw...@redhat.com: Am 13.09.2011 09:53, schrieb Frediano Ziglio: These patches try to trade-off between leaks and speed for clusters refcounts. Refcount increments (REF+ or refp

Re: [Qemu-devel] [PATCH][RFC][0/2] REF+/REF- optimization

2011-09-14 Thread Frediano Ziglio
2011/9/14 Kevin Wolf kw...@redhat.com: ... omissis... To optimize REF+ I mark a range as allocated and use this range to get new ones (avoiding writing refcount to disk). When a flush is requested or in some situations (like snapshot) this cache is disabled and flushed (written as REF-). I

[Qemu-devel] [PATCH][RFC][0/2] REF+/REF- optimization

2011-09-13 Thread Frediano Ziglio
and pass all io-tests but for instance I would avoid allocating new clusters for refcount during preallocation. End speed up is quite visible allocating clusters (more then 20%). Frediano Ziglio (2): qcow2: optimize refminus updates qcow2: ref+ optimization block/qcow2-refcount.c | 270

[Qemu-devel] [PATCH][RFC][1/2] qcow2: optimize refminus updates

2011-09-13 Thread Frediano Ziglio
Cache refcount decrement in an array to trade-off between leaks and speed. Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2-refcount.c | 142 ++-- block/qcow2.c |1 + block/qcow2.h | 14 + 3 files changed

[Qemu-devel] [PATCH][RFC][2/2] qcow2: ref+ optimization

2011-09-13 Thread Frediano Ziglio
preallocate multiple refcount increment in order to collapse allocation writes. This cause leaks in case of Qemu crash but no corruptions. Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2-refcount.c | 128 --- block/qcow2.c

Re: [Qemu-devel] [PATCH] qcow2: fix range check

2011-09-13 Thread Frediano Ziglio
2011/9/12 Kevin Wolf kw...@redhat.com: Am 10.09.2011 10:23, schrieb Frediano Ziglio: QCowL2Meta::offset is not cluster aligned but only sector aligned however nb_clusters count cluster from cluster start. This fix range check. Note that old code have no corruption issues related to this check

[Qemu-devel] qcow2: snapshot and resize possible?

2011-09-13 Thread Frediano Ziglio
Looking at block TODOs I saw qcow2 resize with snapshot. However I would ask if this is technical possible with current format. The reason is that snapshots have no size (only l1_size, QCowHeader have a size field) however I think that size if part of machine state and is not possible to compute

Re: [Qemu-devel] [PATCH][RFC][0/2] REF+/REF- optimization

2011-09-13 Thread Frediano Ziglio
2011/9/13 Kevin Wolf kw...@redhat.com: Am 13.09.2011 09:53, schrieb Frediano Ziglio: These patches try to trade-off between leaks and speed for clusters refcounts. Refcount increments (REF+ or refp) are handled in a different way from decrements (REF- or refm). The reason it that posting

Re: [Qemu-devel] [PATCH][RFC][0/2] REF+/REF- optimization

2011-09-13 Thread Frediano Ziglio
2011/9/13 Kevin Wolf kw...@redhat.com: Am 13.09.2011 09:53, schrieb Frediano Ziglio: These patches try to trade-off between leaks and speed for clusters refcounts. Refcount increments (REF+ or refp) are handled in a different way from decrements (REF- or refm). The reason it that posting

[Qemu-devel] [PATCH] qcow2: fix range check

2011-09-10 Thread Frediano Ziglio
QCowL2Meta::offset is not cluster aligned but only sector aligned however nb_clusters count cluster from cluster start. This fix range check. Note that old code have no corruption issues related to this check cause it only cause intersection to occur when shouldn't. Signed-off-by: Frediano Ziglio

[Qemu-devel] [PATCH] qcow2: align cluster_data to block to improve performance using O_DIRECT

2011-09-10 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2.c | 14 +++--- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 8aed310..510ff68 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -237,7 +237,7 @@ static int qcow2_open

[Qemu-devel] [PATCH] qcow2: initialize metadata before inserting in cluster_allocs

2011-09-08 Thread Frediano Ziglio
QCow2Meta structure was inserted into list before many fields are initialized. Currently is not a problem cause all occur in a lock but if qcow2_alloc_clusters would in a future unlock this lock some issues could arise. Initializing fields before inserting fix the problem. Signed-off-by: Frediano

[Qemu-devel] [PATCH] qcow2: removed unused depends_on field

2011-09-07 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2-cluster.c |3 +-- block/qcow2.h |1 - 2 files changed, 1 insertions(+), 3 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index e06be64..113db8b 100644 --- a/block/qcow2-cluster.c +++ b

[Qemu-devel] Suspicious code in qcow2.

2011-09-07 Thread Frediano Ziglio
Actually it does not cause problems but this code order seems a bit wrong to me (block/qcow2-cluster.c) QLIST_INSERT_HEAD(s-cluster_allocs, m, next_in_flight); /* allocate a new cluster */ cluster_offset = qcow2_alloc_clusters(bs, nb_clusters * s-cluster_size); if

[Qemu-devel] [PATCH] rename qemu_malloc and related to glib names for coherence

2011-08-31 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- trace-events | 10 +- vl.c |6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/trace-events b/trace-events index dc300a2..37da2e0 100644 --- a/trace-events +++ b/trace-events @@ -14,7 +14,7

[Qemu-devel] [PATCH] linux aio: some comments

2011-08-30 Thread Frediano Ziglio
Add some notes about Linux AIO explaining why we don't use AIO in some situations. Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/raw-posix.c |4 linux-aio.c |1 + 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/block/raw-posix.c b/block/raw-posix.c

[Qemu-devel] [PATCH] disasm: update comment

2011-08-25 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- disas.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/disas.c b/disas.c index 1334b8e..611b30b 100644 --- a/disas.c +++ b/disas.c @@ -137,7 +137,7 @@ print_insn_thumb1(bfd_vma pc, disassemble_info *info

[Qemu-devel] [PATCH] qcow2: use always stderr for debugging

2011-08-25 Thread Frediano Ziglio
let all DEBUG_ALLOC2 printf goes to stderr Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2-cluster.c |2 +- block/qcow2-refcount.c |4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index 9269dda

[Qemu-devel] [PATCH] qcow2: remove unused qcow2_create_refcount_update function

2011-08-25 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2-refcount.c | 18 -- block/qcow2.h |2 -- 2 files changed, 0 insertions(+), 20 deletions(-) diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 2a915be..62946bb 100644 --- a/block

Re: [Qemu-devel] [PATCH 2/2] disasm: update comment

2011-08-25 Thread Frediano Ziglio
2011/8/25 Peter Maydell peter.mayd...@linaro.org: On 25 August 2011 09:44, Stefan Hajnoczi stefa...@linux.vnet.ibm.com wrote:  /* Disassemble this for me please... (debugging). 'flags' has the following    values: -    i386 - nonzero means 16 bit code +    i386 - 1 means 16 bit code, 2 means

[Qemu-devel] [PATCH v3 00/15] qcow/qcow2 cleanups

2011-08-23 Thread Frediano Ziglio
These patches mostly cleanup some AIO code using coroutines. Mostly they use stack instead of allocated AIO structure. Feel free to collapse it too short. Frediano Ziglio (15): qcow: allocate QCowAIOCB structure using stack qcow: QCowAIOCB field cleanup qcow: move some blocks of code

[Qemu-devel] [PATCH v3 01/15] qcow: allocate QCowAIOCB structure using stack

2011-08-23 Thread Frediano Ziglio
instead of calling qemi_aio_get use stack Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow.c | 52 block/qcow2.c | 38 +++--- 2 files changed, 27 insertions(+), 63 deletions(-) diff --git

[Qemu-devel] [PATCH v3 02/15] qcow: QCowAIOCB field cleanup

2011-08-23 Thread Frediano Ziglio
remove unused field from this structure and put some of them in qcow_aio_read_cb and qcow_aio_write_cb Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow.c | 137 +++-- 1 files changed, 65 insertions(+), 72 deletions(-) diff

[Qemu-devel] [PATCH v3 03/15] qcow: move some blocks of code to avoid useless variable initialization

2011-08-23 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow.c | 53 ++--- 1 files changed, 26 insertions(+), 27 deletions(-) diff --git a/block/qcow.c b/block/qcow.c index 9754ca9..4ede7f3 100644 --- a/block/qcow.c +++ b/block/qcow.c

[Qemu-devel] [PATCH v3 05/15] qcow: remove old #undefined code

2011-08-23 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow.c | 63 -- 1 files changed, 0 insertions(+), 63 deletions(-) diff --git a/block/qcow.c b/block/qcow.c index f28c821..8cbabdd 100644 --- a/block/qcow.c +++ b/block/qcow.c

[Qemu-devel] [PATCH v3 12/15] qcow2: removed QCowAIOCB entirely

2011-08-23 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2.c | 207 ++--- 1 files changed, 80 insertions(+), 127 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 287dd99..d34bd72 100644 --- a/block/qcow2.c +++ b/block

[Qemu-devel] [PATCH v3 13/15] qcow2: remove memory leak

2011-08-23 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index d34bd72..07529b1 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -492,6 +492,7 @@ fail: qemu_co_mutex_unlock(s

[Qemu-devel] [PATCH v3 14/15] qcow2: small math optimization

2011-08-23 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2-refcount.c |5 + 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 2a915be..0f9a64a 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c

[Qemu-devel] [PATCH v3 15/15] qcow2: small optimization

2011-08-23 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2-refcount.c | 11 +-- 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 0f9a64a..243c24b 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c

[Qemu-devel] [PATCH v3 04/15] qcow: embed qcow_aio_read_cb into qcow_co_readv and qcow_aio_write_cb into qcow_co_writev

2011-08-23 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow.c | 291 - 1 files changed, 123 insertions(+), 168 deletions(-) diff --git a/block/qcow.c b/block/qcow.c index 4ede7f3..f28c821 100644 --- a/block/qcow.c +++ b/block/qcow.c

[Qemu-devel] [PATCH v3 09/15] qcow2: remove cluster_offset from QCowAIOCB

2011-08-23 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2.c | 22 +++--- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 4b9ec29..7e13283 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -378,7 +378,6 @@ typedef

[Qemu-devel] [PATCH v3 10/15] qcow2: remove common from QCowAIOCB

2011-08-23 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 7e13283..519fc8b 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -373,7 +373,7 @@ int qcow2_backing_read1

Re: [Qemu-devel] [PATCH v2 00/15] qcow/qcow2 cleanups

2011-08-23 Thread Frediano Ziglio
2011/8/22 Kevin Wolf kw...@redhat.com: Am 09.08.2011 09:46, schrieb Frediano Ziglio: These patches mostly cleanup some AIO code using coroutines. Mostly they use stack instead of allocated AIO structure. Feel free to collapse it too short. Frediano Ziglio (15):   qcow: allocate QCowAIOCB

[Qemu-devel] [PATCH v3 06/15] qcow2: removed unused fields

2011-08-23 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2.c | 10 +++--- 1 files changed, 3 insertions(+), 7 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index bb6c75e..4171b47 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -381,11 +381,8 @@ typedef struct QCowAIOCB

[Qemu-devel] [PATCH v3 07/15] qcow2: removed cur_nr_sectors field in QCowAIOCB

2011-08-23 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2.c | 98 + 1 files changed, 43 insertions(+), 55 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 4171b47..f920dbe 100644 --- a/block/qcow2.c +++ b/block/qcow2

[Qemu-devel] [PATCH v3 11/15] qcow2: reindent and use while before the big jump

2011-08-23 Thread Frediano Ziglio
prepare to remove read/write callbacks Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2.c | 272 - 1 files changed, 135 insertions(+), 137 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 519fc8b..287dd99

[Qemu-devel] [PATCH v3 08/15] qcow2: remove l2meta from QCowAIOCB

2011-08-23 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2.c | 15 --- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index f920dbe..4b9ec29 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -381,7 +381,6 @@ typedef struct

[Qemu-devel] full allocation and file fragmentation.

2011-08-13 Thread Frediano Ziglio
Looking at you patch for full image preallocation I noted you used bdrv_write to fill space with zeroes. Nothing wrong but I would add a call to fallocate or posix_fallocate in order to get less fragmentation on file system. Perhaps there should be a bdrv_preallocate call ?? Regards Frediano

[Qemu-devel] [PATCH v2 00/15] qcow/qcow2 cleanups

2011-08-09 Thread Frediano Ziglio
These patches mostly cleanup some AIO code using coroutines. Mostly they use stack instead of allocated AIO structure. Feel free to collapse it too short. Frediano Ziglio (15): qcow: allocate QCowAIOCB structure using stack qcow: QCowAIOCB field cleanup qcow: move some blocks of code

[Qemu-devel] [PATCH v2 02/15] qcow: QCowAIOCB field cleanup

2011-08-09 Thread Frediano Ziglio
remove unused field from this structure and put some of them in qcow_aio_read_cb and qcow_aio_write_cb Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow.c | 137 +++-- 1 files changed, 65 insertions(+), 72 deletions(-) diff

[Qemu-devel] [PATCH v2 03/15] qcow: move some blocks of code to avoid useless variable initialization

2011-08-09 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow.c | 53 ++--- 1 files changed, 26 insertions(+), 27 deletions(-) diff --git a/block/qcow.c b/block/qcow.c index f0b1599..e17f9c5 100644 --- a/block/qcow.c +++ b/block/qcow.c

[Qemu-devel] [PATCH v2 01/15] qcow: allocate QCowAIOCB structure using stack

2011-08-09 Thread Frediano Ziglio
instead of calling qemi_aio_get use stack Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow.c | 52 block/qcow2.c | 38 +++--- 2 files changed, 27 insertions(+), 63 deletions(-) diff --git

[Qemu-devel] [PATCH v2 15/15] qcow2: small optimization

2011-08-09 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2-refcount.c | 11 +-- 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 0e31868..318d66d 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c

[Qemu-devel] [PATCH v2 13/15] qcow2: remove memory leak

2011-08-09 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 6073568..aed8da7 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -492,6 +492,7 @@ fail: qemu_co_mutex_unlock(s

[Qemu-devel] [PATCH v2 14/15] qcow2: small math optimization

2011-08-09 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2-refcount.c |5 + 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 14b2f67..0e31868 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c

[Qemu-devel] [PATCH v2 11/15] qcow2: reindent and use while before the big jump

2011-08-09 Thread Frediano Ziglio
prepare to remove read/write callbacks Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2.c | 272 - 1 files changed, 135 insertions(+), 137 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index c7445cc..dfb969e

[Qemu-devel] [PATCH v2 10/15] qcow2: remove common from QCowAIOCB

2011-08-09 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 446946e..c7445cc 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -373,7 +373,7 @@ int qcow2_backing_read1

[Qemu-devel] [PATCH v2 06/15] qcow2: removed unused fields

2011-08-09 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2.c | 10 +++--- 1 files changed, 3 insertions(+), 7 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index edc068e..5c454bb 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -381,11 +381,8 @@ typedef struct QCowAIOCB

[Qemu-devel] [PATCH v2 07/15] qcow2: removed cur_nr_sectors field in QCowAIOCB

2011-08-09 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2.c | 98 + 1 files changed, 43 insertions(+), 55 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 5c454bb..0cf4465 100644 --- a/block/qcow2.c +++ b/block/qcow2

[Qemu-devel] [PATCH v2 08/15] qcow2: remove l2meta from QCowAIOCB

2011-08-09 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2.c | 15 --- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 0cf4465..adf31ce 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -381,7 +381,6 @@ typedef struct

[Qemu-devel] [PATCH v2 09/15] qcow2: remove cluster_offset from QCowAIOCB

2011-08-09 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2.c | 22 +++--- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index adf31ce..446946e 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -378,7 +378,6 @@ typedef

[Qemu-devel] [PATCH v2 05/15] qcow: remove old #undefined code

2011-08-09 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow.c | 63 -- 1 files changed, 0 insertions(+), 63 deletions(-) diff --git a/block/qcow.c b/block/qcow.c index 00f339f..0989799 100644 --- a/block/qcow.c +++ b/block/qcow.c

[Qemu-devel] [PATCH v2 12/15] qcow2: removed QCowAIOCB entirely

2011-08-09 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2.c | 207 ++--- 1 files changed, 80 insertions(+), 127 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index dfb969e..6073568 100644 --- a/block/qcow2.c +++ b/block

[Qemu-devel] [PATCH v2 04/15] qcow: embed qcow_aio_read_cb into qcow_co_readv and qcow_aio_write_cb into qcow_co_writev

2011-08-09 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow.c | 291 - 1 files changed, 123 insertions(+), 168 deletions(-) diff --git a/block/qcow.c b/block/qcow.c index e17f9c5..00f339f 100644 --- a/block/qcow.c +++ b/block/qcow.c

Re: [Qemu-devel] [PATCH] posix-aio-compat: fix latency issues

2011-08-08 Thread Frediano Ziglio
2011/8/8 Avi Kivity a...@redhat.com: In certain circumstances, posix-aio-compat can incur a lot of latency:  - threads are created by vcpu threads, so if vcpu affinity is set,   aio threads inherit vcpu affinity.  This can cause many aio threads   to compete for one cpu.  - we can create up

Re: [Qemu-devel] [PATCH] posix-aio-compat: fix latency issues

2011-08-08 Thread Frediano Ziglio
2011/8/8 Avi Kivity a...@redhat.com: On 08/08/2011 03:49 PM, Frediano Ziglio wrote: 2011/8/8 Avi Kivitya...@redhat.com:  In certain circumstances, posix-aio-compat can incur a lot of latency:    - threads are created by vcpu threads, so if vcpu affinity is set,     aio threads inherit

Re: [Qemu-devel] [PATCH v2 0.15.0] qcow2: Fix L1 table size after bdrv_snapshot_goto

2011-08-05 Thread Frediano Ziglio
2011/8/4 Kevin Wolf kw...@redhat.com: When loading an internal snapshot whose L1 table is smaller than the current L1 table, the size of the current L1 would be shrunk to the snapshot's L1 size in memory, but not on disk. This lead to incorrect refcount updates and eventuelly to image

[Qemu-devel] Possible corruption on qcow2_snapshot_goto

2011-08-05 Thread Frediano Ziglio
This function seems to be not that safe. The first problem is that the first thing it does if free refcount calling qcow2_update_snapshot_refcount(bs, s-l1_table_offset, s-l1_size, -1). Now if something goes wrong (crash, disk errors) this could lead to refcount == 0 (depending on L1 size, cache,

Re: [Qemu-devel] [PATCH v2 0.15.0] qcow2: Fix L1 table size after bdrv_snapshot_goto

2011-08-05 Thread Frediano Ziglio
2011/8/5 Kevin Wolf kw...@redhat.com: Am 05.08.2011 08:35, schrieb Frediano Ziglio: 2011/8/4 Kevin Wolf kw...@redhat.com: When loading an internal snapshot whose L1 table is smaller than the current L1 table, the size of the current L1 would be shrunk to the snapshot's L1 size in memory

Re: [Qemu-devel] [PATCH v2 0.15.0] qcow2: Fix L1 table size after bdrv_snapshot_goto

2011-08-05 Thread Frediano Ziglio
2011/8/5 Frediano Ziglio fredd...@gmail.com: 2011/8/5 Kevin Wolf kw...@redhat.com: Am 05.08.2011 08:35, schrieb Frediano Ziglio: 2011/8/4 Kevin Wolf kw...@redhat.com: When loading an internal snapshot whose L1 table is smaller than the current L1 table, the size of the current L1 would

Re: [Qemu-devel] qcow2x

2011-08-03 Thread Frediano Ziglio
2011/8/2 Kevin Wolf kw...@redhat.com: Am 02.08.2011 17:29, schrieb Frediano Ziglio: - L2 allocation can be done with relative data (this is not easy to do with current code) What do you mean by that? Let's take an example. By allocation I mean give a position to data/l2/refcount_table

[Qemu-devel] qcow2x

2011-08-02 Thread Frediano Ziglio
Hi, I spent some time trying to find a way to speed up qcow2 performance on allocation and snapshot so I branch from kevin/coroutine-block branch a qcow2x branch. Currently it just write using different algorithm (that is is fully compatible with qcow2, there is not ICountAsZero(TM) method :) ).

Re: [Qemu-devel] [PATCH 00/10] block: Coroutine support

2011-08-02 Thread Frediano Ziglio
2011/8/2 Kevin Wolf kw...@redhat.com: Am 02.08.2011 16:23, schrieb Avi Kivity: On 07/26/2011 02:48 PM, Kevin Wolf wrote: Depends on Stefan's latest coroutine patches. This series makes qcow and qcow2 take advantage of the new coroutine infrastructure. Both formats used synchronous

Re: [Qemu-devel] qcow2x

2011-08-02 Thread Frediano Ziglio
2011/8/2 Kevin Wolf kw...@redhat.com: Am 02.08.2011 16:30, schrieb Frediano Ziglio: Hi,   I spent some time trying to find a way to speed up qcow2 performance on allocation and snapshot so I branch from kevin/coroutine-block branch a qcow2x branch. Currently it just write using different

Re: [Qemu-devel] Volume key in qcow3?

2011-07-29 Thread Frediano Ziglio
2011/7/28 Kevin Wolf kw...@redhat.com: Am 28.07.2011 10:05, schrieb Frediano Ziglio: Hi,   I noted that AES encryption using qcow2 just use the password given as as key (and also truncating it to 16 bytes == 128 bits). This is prone to brute force attacks and is not also easy to change

[Qemu-devel] [PATCH 0/8] qcow2 cleanup for coroutine-block branch

2011-07-28 Thread Frediano Ziglio
This is a collection of patches that remove QCowAIOCB, useless with coroutines. It apply to Kevin coroutine-block branch. I leave all step I did to remove the structure, feel free to collapse some of them. I tested with iotests and got no changes (026 fails like coroutine-block branch). Frediano

[Qemu-devel] [PATCH 1/8] qcow2: removed unused fields

2011-07-28 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2.c | 10 +++--- 1 files changed, 3 insertions(+), 7 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index edc068e..5c454bb 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -381,11 +381,8 @@ typedef struct QCowAIOCB

[Qemu-devel] [PATCH 2/8] qcow2: removed cur_nr_sectors field in QCowAIOCB

2011-07-28 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2.c | 98 + 1 files changed, 43 insertions(+), 55 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 5c454bb..0cf4465 100644 --- a/block/qcow2.c +++ b/block/qcow2

[Qemu-devel] [PATCH 3/8] qcow2: remove l2meta from QCowAIOCB

2011-07-28 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2.c | 15 --- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 0cf4465..adf31ce 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -381,7 +381,6 @@ typedef struct

[Qemu-devel] [PATCH 8/8] qcow2: remove memory leak

2011-07-28 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 6073568..aed8da7 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -492,6 +492,7 @@ fail: qemu_co_mutex_unlock(s

[Qemu-devel] [PATCH 7/8] qcow2: removed QCowAIOCB entirely

2011-07-28 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2.c | 207 ++--- 1 files changed, 80 insertions(+), 127 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index dfb969e..6073568 100644 --- a/block/qcow2.c +++ b/block

[Qemu-devel] [PATCH 4/8] qcow2: remove cluster_offset from QCowAIOCB

2011-07-28 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2.c | 22 +++--- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index adf31ce..446946e 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -378,7 +378,6 @@ typedef

[Qemu-devel] Volume key in qcow3?

2011-07-28 Thread Frediano Ziglio
Hi, I noted that AES encryption using qcow2 just use the password given as as key (and also truncating it to 16 bytes == 128 bits). This is prone to brute force attacks and is not also easy to change password (you have to decrypt and encrypt again the entire image). LUKS and EncFS use another

[Qemu-devel] [PATCH 5/8] qcow2: remove common from QCowAIOCB

2011-07-28 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 446946e..c7445cc 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -373,7 +373,7 @@ int qcow2_backing_read1

[Qemu-devel] [PATCH 6/8] qcow2: reindent and use while before the big jump

2011-07-28 Thread Frediano Ziglio
prepare to remove read/write callbacks Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2.c | 272 - 1 files changed, 135 insertions(+), 137 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index c7445cc..dfb969e

Re: [Qemu-devel] Block layer roadmap

2011-07-28 Thread Frediano Ziglio
2011/7/28 Christoph Hellwig h...@lst.de: On Wed, Jul 27, 2011 at 01:37:31PM +0100, Stefan Hajnoczi wrote: Coroutines in the block layer [Kevin]  * Programming model to simplify block drivers without blocking QEMU threads Can anyone explain what the whole point of this is?  It really just is

[Qemu-devel] [PATCH] [RFC] qcow2: group refcount updates during cow

2011-07-28 Thread Frediano Ziglio
in the same l2 table but with this code you get two write instead of one. I'm thinking about a function in qcow2-refcount.c that accept an array of cluster instead of a start + len. Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/qcow2-cluster.c | 36

[Qemu-devel] [PATCH 0/3] small trivial patches

2011-07-27 Thread Frediano Ziglio
Minor fixes and improves Frediano Ziglio (3): block: removed unused function block: typo fix aio: always check paio_init result block.c | 13 - block.h |2 -- block/raw-posix.c | 13 ++--- 3 files changed, 6 insertions(+), 22 deletions(-)

[Qemu-devel] [PATCH 1/3] block: removed unused function

2011-07-27 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block.c | 13 - block.h |2 -- 2 files changed, 0 insertions(+), 15 deletions(-) diff --git a/block.c b/block.c index 9549b9e..b2d3983 100644 --- a/block.c +++ b/block.c @@ -1108,19 +1108,6 @@ int bdrv_pwrite_sync

[Qemu-devel] [PATCH 2/3] block: typo fix

2011-07-27 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio fredd...@gmail.com --- block/raw-posix.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/block/raw-posix.c b/block/raw-posix.c index cd89c83..275b41e 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -587,7 +587,7 @@ static

<    1   2   3   >