[Qemu-devel] [PATCH V26 31/32] cleanup QEMUOptionParameter

2014-04-29 Thread Chunyan Liu
Now that all backend drivers are using QemuOpts, remove all QEMUOptionParameter related codes. Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- Changes to V25: * update according to patch 12/32 block.c | 93 ++ block/cow.c | 4 +- block/gl

[Qemu-devel] [PATCH V26 10/32] QemuOpts: add qemu_opts_append to replace append_option_parameters

2014-04-29 Thread Chunyan Liu
For later merge .create_opts of drv and proto_drv in qemu-img commands. Reviewed-by: Stefan Hajnoczi Reviewed-by: Eric Blake Reviewed-by: Leandro Dorileo Signed-off-by: Chunyan Liu --- include/qemu/option.h | 5 util/qemu-option.c| 65

[Qemu-devel] [PATCH V26 05/32] QemuOpts: change opt->name|str from (const char *) to (char *)

2014-04-29 Thread Chunyan Liu
qemu_opt_del() already assumes that all QemuOpt instances contain malloc'd name and value; but it had to cast away const because opts_start_struct() was doing its own thing and using static storage instead. By using the correct type and malloced strings everywhere, the usage of this struct becomes

Re: [Qemu-devel] [PATCH] spapr_pci: Fix maximum IRQ number check in ibm, change-msi

2014-04-29 Thread Alexander Graf
On 29.04.14 05:17, Alexey Kardashevskiy wrote: Recently a check for maximum supported MSIX vectors number has been added. However the check always assumed that MSIX is the only case and failed on devices which have MSI but do not have MSIX such as QEMU's PCI Bridge. This results in assert in xic

[Qemu-devel] [PATCH V26 18/32] qcow.c: replace QEMUOptionParameter with QemuOpts

2014-04-29 Thread Chunyan Liu
Reviewed-by: Stefan Hajnoczi Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- block/qcow.c | 72 ++-- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/block/qcow.c b/block/qcow.c index 9411aef..b4ce133 100644 --- a

[Qemu-devel] [PATCH V26 03/32] QemuOpts: repurpose qemu_opts_print to replace print_option_parameters

2014-04-29 Thread Chunyan Liu
Currently this function is not used anywhere. In later patches, it will replace print_option_parameters. To avoid print info changes, change qemu_opts_print from fprintf stderr to printf to keep consistent with print_option_parameters, remove last printf and print size/number with opt->value.uint i

[Qemu-devel] [PATCH V26 30/32] vpc.c: replace QEMUOptionParameter with QemuOpts

2014-04-29 Thread Chunyan Liu
Reviewed-by: Stefan Hajnoczi Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- block/vpc.c | 62 + 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/block/vpc.c b/block/vpc.c index 2e25f57..8ebf424 100644 --- a/b

[Qemu-devel] [PATCH V26 21/32] raw-posix.c: replace QEMUOptionParameter with QemuOpts

2014-04-29 Thread Chunyan Liu
Reviewed-by: Stefan Hajnoczi Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- block/raw-posix.c | 59 +-- 1 file changed, 27 insertions(+), 32 deletions(-) diff --git a/block/raw-posix.c b/block/raw-posix.c index 1688e16..e72f449 10

[Qemu-devel] [PATCH V26 29/32] vmdk.c: replace QEMUOptionParameter with QemuOpts

2014-04-29 Thread Chunyan Liu
Reviewed-by: Stefan Hajnoczi Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- block/vmdk.c | 123 ++- 1 file changed, 63 insertions(+), 60 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 3802863..490f6a6 100644 --- a

[Qemu-devel] [PATCH V26 04/32] qapi: output def_value_str when query command line options

2014-04-29 Thread Chunyan Liu
Change qapi interfaces to output the newly added def_value_str when querying command line options. Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- Changes to V25: * update @default description in .json file qapi-schema.json | 5 - qmp-commands.hx| 2 ++ util/qemu-config.

[Qemu-devel] [PATCH V26 01/32] QemuOpts: move find_desc_by_name ahead for later calling

2014-04-29 Thread Chunyan Liu
Reviewed-by: Stefan Hajnoczi Reviewed-by: Eric Blake Signed-off-by: Chunyan Liu --- util/qemu-option.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/util/qemu-option.c b/util/qemu-option.c index 8bbc3ad..808aef4 100644 --- a/util/qemu-option.

[Qemu-devel] [PATCH V26 32/32] QemuOpts: cleanup tmp 'allocated' member from QemuOptsList

2014-04-29 Thread Chunyan Liu
Now only qemu_opts_append uses 'allocated' to indicate free memory. For this function only, we can also let result list's (const char *) members point to input list's members, only if the input list has longer lifetime than result list. In current code, that is true. So, we can remove the 'allocate

[Qemu-devel] [PATCH V26 15/32] gluster.c: replace QEMUOptionParameter with QemuOpts

2014-04-29 Thread Chunyan Liu
Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- Changes to V25: * fix create_opts, OPT_STRING -> QEMU_OPT_STRING block/gluster.c | 81 ++--- 1 file changed, 42 insertions(+), 39 deletions(-) diff --git a/block/gluster.c b/block/g

[Qemu-devel] [PATCH V26 08/32] QemuOpts: add qemu_opts_print_help to replace print_option_help

2014-04-29 Thread Chunyan Liu
print_option_help takes QEMUOptionParameter as parameter, add qemu_opts_print_help to take QemuOptsList as parameter for later replace work. Reviewed-by: Eric Blake Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- include/qemu/option.h | 1 + util/qemu-option.c| 13 +

[Qemu-devel] [PATCH V26 07/32] QemuOpts: add qemu_opt_get_*_del functions for replace work

2014-04-29 Thread Chunyan Liu
Add qemu_opt_get_del, qemu_opt_get_bool_del, qemu_opt_get_number_del and qemu_opt_get_size_del to replace the same handling of QEMUOptionParameter (get and delete). Several drivers are coded to parse a known subset of options, then remove them from the list before handing all remaining options to

[Qemu-devel] [PATCH V26 22/32] raw-win32.c: replace QEMUOptionParameter with QemuOpts

2014-04-29 Thread Chunyan Liu
Reviewed-by: Stefan Hajnoczi Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- block/raw-win32.c | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/block/raw-win32.c b/block/raw-win32.c index 48cb2c2..b00d7fc 100644 --- a/block/

[Qemu-devel] [PATCH V26 06/32] QemuOpts: move qemu_opt_del ahead for later calling

2014-04-29 Thread Chunyan Liu
In later patch, qemu_opt_get_del functions will be added, they will first get the option value, then call qemu_opt_del to remove the option from opt list. To prepare for that purpose, move qemu_opt_del ahead first. Reviewed-by: Eric Blake Signed-off-by: Chunyan Liu --- util/qemu-option.c | 16 +

[Qemu-devel] [PATCH V26 24/32] rbd.c: replace QEMUOptionParameter with QemuOpts

2014-04-29 Thread Chunyan Liu
Reviewed-by: Stefan Hajnoczi Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- block/rbd.c | 63 + 1 file changed, 30 insertions(+), 33 deletions(-) diff --git a/block/rbd.c b/block/rbd.c index dbc79f4..f878877 100644 --- a/b

[Qemu-devel] [PATCH V26 14/32] cow.c: replace QEMUOptionParameter with QemuOpts

2014-04-29 Thread Chunyan Liu
Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- block/cow.c | 54 ++ 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/block/cow.c b/block/cow.c index 26cf4a5..fb2c

Re: [Qemu-devel] [PATCH 3/4] target-ppc: ppc can be either endian

2014-04-29 Thread Greg Kurz
On Tue, 29 Apr 2014 11:14:12 +0200 Alexander Graf wrote: > > On 28.04.14 14:47, Andreas Färber wrote: > > [fixing Bharata's address] > > > > Am 28.04.2014 13:29, schrieb Greg Kurz: > >> POWER7, POWER7+ and POWER8 families use the ILE bit of the LPCR > >> special purpose register to decide the end

Re: [Qemu-devel] [PATCH 1/4] dump: Make DumpState and endian conversion routines available for arch-specific dump code

2014-04-29 Thread Greg Kurz
On Tue, 29 Apr 2014 11:16:51 +0200 Alexander Graf wrote: > > On 28.04.14 13:29, Greg Kurz wrote: > > From: Bharata B Rao > > > > Make DumpState and endian conversion routines available for arch-specific > > dump > > code by moving into dump.h. DumpState will be needed by arch-specific dump > >

Re: [Qemu-devel] [PATCH v2] target-ppc: ppc can be either endian

2014-04-29 Thread Alexander Graf
On 29.04.14 11:15, Greg Kurz wrote: POWER7, POWER7+ and POWER8 families use the ILE bit of the LPCR special purpose register to decide the endianness to use when entering interrupt handlers. When running a Linux guest, this provides a hint on the endianness used by the kernel. From a QEMU point

Re: [Qemu-devel] [PATCHv2 RESEND] block/iscsi: speed up read for unallocated sectors

2014-04-29 Thread Paolo Bonzini
Il 29/04/2014 10:57, Peter Lieven ha scritto: Am 28.04.2014 16:56, schrieb Paolo Bonzini: Il 28/04/2014 16:41, Peter Lieven ha scritto: What if opt_unmap_gran is 32K or lower? In this case you're not using an allocationmap. As written I am fine with lowering this to 4K. Follow-Up or v3? F

[Qemu-devel] [PATCH v2] target-ppc: ppc can be either endian

2014-04-29 Thread Greg Kurz
POWER7, POWER7+ and POWER8 families use the ILE bit of the LPCR special purpose register to decide the endianness to use when entering interrupt handlers. When running a Linux guest, this provides a hint on the endianness used by the kernel. From a QEMU point of view, the information is needed for

[Qemu-devel] [PATCH V26 26/32] ssh.c: replace QEMUOptionParameter with QemuOpts

2014-04-29 Thread Chunyan Liu
Reviewed-by: Stefan Hajnoczi Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- block/ssh.c | 32 +++- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/block/ssh.c b/block/ssh.c index aa63c9d..3a5eead 100644 --- a/block/ssh.c +++ b/block/ssh.c

[Qemu-devel] [PATCH V26 30/32] vpc.c: replace QEMUOptionParameter with QemuOpts

2014-04-29 Thread Chunyan Liu
Reviewed-by: Stefan Hajnoczi Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- block/vpc.c | 62 + 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/block/vpc.c b/block/vpc.c index 2e25f57..8ebf424 100644 --- a/b

Re: [Qemu-devel] [PATCH 4/3] qemu-socket: Clean up inet_connect_opts()

2014-04-29 Thread Paolo Bonzini
Il 29/04/2014 08:28, Markus Armbruster ha scritto: Separate the search for a working addrinfo from the code that does something with it. Makes for a clearer search loop. Use a local Error * to simplify resetting the error in the search loop. Signed-off-by: Markus Armbruster --- Forgot to incl

Re: [Qemu-devel] [PATCH 1/4] dump: Make DumpState and endian conversion routines available for arch-specific dump code

2014-04-29 Thread Alexander Graf
On 28.04.14 13:29, Greg Kurz wrote: From: Bharata B Rao Make DumpState and endian conversion routines available for arch-specific dump code by moving into dump.h. DumpState will be needed by arch-specific dump code to access target endian information from DumpState->ArchDumpInfo. Also break th

[Qemu-devel] [PATCH V26 29/32] vmdk.c: replace QEMUOptionParameter with QemuOpts

2014-04-29 Thread Chunyan Liu
Reviewed-by: Stefan Hajnoczi Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- block/vmdk.c | 123 ++- 1 file changed, 63 insertions(+), 60 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 3802863..490f6a6 100644 --- a

Re: [Qemu-devel] [PATCH 3/4] target-ppc: ppc can be either endian

2014-04-29 Thread Alexander Graf
On 28.04.14 14:47, Andreas Färber wrote: [fixing Bharata's address] Am 28.04.2014 13:29, schrieb Greg Kurz: POWER7, POWER7+ and POWER8 families use the ILE bit of the LPCR special purpose register to decide the endianness to use when entering interrupt handlers. When running a linux guest, thi

[Qemu-devel] [PATCH V26 17/32] nfs.c: replace QEMUOptionParameter with QemuOpts

2014-04-29 Thread Chunyan Liu
Signed-off-by: Chunyan Liu --- block/nfs.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/block/nfs.c b/block/nfs.c index 9fa831f..8633c04 100644 --- a/block/nfs.c +++ b/block/nfs.c @@ -357,20 +357,14 @@ static int nfs_file_open(BlockDriverState *bs, QDict *opti

[Qemu-devel] [PATCH V26 27/32] vdi.c: replace QEMUOptionParameter with QemuOpts

2014-04-29 Thread Chunyan Liu
Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- block/vdi.c | 73 + 1 file changed, 35 insertions(+), 38 deletions(-) diff --git a/block/vdi.c b/block/vdi.c index 820cd37..950cf46 100644 --- a/block/vdi.c +++ b/block/vdi.c @

[Qemu-devel] [PATCH V26 19/32] qcow2.c: replace QEMUOptionParameter with QemuOpts

2014-04-29 Thread Chunyan Liu
Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- block/qcow2.c | 265 +++--- include/qemu/option.h | 1 + util/qemu-option.c| 2 +- 3 files changed, 143 insertions(+), 125 deletions(-) diff --git a/block/qcow2.c b/block/qcow2

[Qemu-devel] [PATCH V26 25/32] sheepdog.c: replace QEMUOptionParameter with QemuOpts

2014-04-29 Thread Chunyan Liu
Reviewed-by: Stefan Hajnoczi Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- block/sheepdog.c | 108 --- 1 file changed, 55 insertions(+), 53 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index 0eb33ee..9f280f6 1006

[Qemu-devel] [PATCH V26 23/32] raw_bsd.c: replace QEMUOptionParameter with QemuOpts

2014-04-29 Thread Chunyan Liu
Reviewed-by: Stefan Hajnoczi Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- block/raw_bsd.c | 27 +++ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/block/raw_bsd.c b/block/raw_bsd.c index 9ae5fc2..ee797fd 100644 --- a/block/raw_bsd.c +++ b/b

[Qemu-devel] [PATCH V26 21/32] raw-posix.c: replace QEMUOptionParameter with QemuOpts

2014-04-29 Thread Chunyan Liu
Reviewed-by: Stefan Hajnoczi Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- block/raw-posix.c | 59 +-- 1 file changed, 27 insertions(+), 32 deletions(-) diff --git a/block/raw-posix.c b/block/raw-posix.c index 1688e16..e72f449 10

[Qemu-devel] [PATCH V26 28/32] vhdx.c: replace QEMUOptionParameter with QemuOpts

2014-04-29 Thread Chunyan Liu
Reviewed-by: Stefan Hajnoczi Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- block/vhdx.c | 99 +--- block/vhdx.h | 1 + 2 files changed, 48 insertions(+), 52 deletions(-) diff --git a/block/vhdx.c b/block/vhdx.c index a9fcf6b

[Qemu-devel] [PATCH V26 16/32] iscsi.c: replace QEMUOptionParameter with QemuOpts

2014-04-29 Thread Chunyan Liu
Reviewed-by: Stefan Hajnoczi Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- block/iscsi.c | 34 -- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/block/iscsi.c b/block/iscsi.c index a30202b..e4a127b 100644 --- a/block/iscsi.c +++ b/bl

[Qemu-devel] [PATCH V26 20/32] qed.c: replace QEMUOptionParameter with QemuOpts

2014-04-29 Thread Chunyan Liu
One extra change is to define QED_DEFAULT_CLUSTER_SIZE = 65536 instead of 64 * 1024; because: according to existing create_options, "cluster size" has default value = QED_DEFAULT_CLUSTER_SIZE, after switching to create_opts, this has to be stringized and set to .def_value_str. That is, .def_value

[Qemu-devel] [PATCH V26 18/32] qcow.c: replace QEMUOptionParameter with QemuOpts

2014-04-29 Thread Chunyan Liu
Reviewed-by: Stefan Hajnoczi Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- block/qcow.c | 72 ++-- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/block/qcow.c b/block/qcow.c index 9411aef..b4ce133 100644 --- a

[Qemu-devel] [PATCH V26 14/32] cow.c: replace QEMUOptionParameter with QemuOpts

2014-04-29 Thread Chunyan Liu
Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- block/cow.c | 54 ++ 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/block/cow.c b/block/cow.c index 26cf4a5..fb2c

[Qemu-devel] [PATCH V26 24/32] rbd.c: replace QEMUOptionParameter with QemuOpts

2014-04-29 Thread Chunyan Liu
Reviewed-by: Stefan Hajnoczi Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- block/rbd.c | 63 + 1 file changed, 30 insertions(+), 33 deletions(-) diff --git a/block/rbd.c b/block/rbd.c index dbc79f4..f878877 100644 --- a/b

[Qemu-devel] [PATCH V26 15/32] gluster.c: replace QEMUOptionParameter with QemuOpts

2014-04-29 Thread Chunyan Liu
Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- Changes to V25: * fix create_opts, OPT_STRING -> QEMU_OPT_STRING block/gluster.c | 81 ++--- 1 file changed, 42 insertions(+), 39 deletions(-) diff --git a/block/gluster.c b/block/g

[Qemu-devel] [PATCH V26 12/32] change block layer to support both QemuOpts and QEMUOptionParamter

2014-04-29 Thread Chunyan Liu
Change block layer to support both QemuOpts and QEMUOptionParameter. After this patch, it will change backend drivers one by one. At the end, QEMUOptionParameter will be removed and only QemuOpts is kept. Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- Changes to V25: * fix Eric's c

[Qemu-devel] [PATCH V26 06/32] QemuOpts: move qemu_opt_del ahead for later calling

2014-04-29 Thread Chunyan Liu
In later patch, qemu_opt_get_del functions will be added, they will first get the option value, then call qemu_opt_del to remove the option from opt list. To prepare for that purpose, move qemu_opt_del ahead first. Reviewed-by: Eric Blake Signed-off-by: Chunyan Liu --- util/qemu-option.c | 16 +

[Qemu-devel] [PATCH V26 11/32] QemuOpts: check NULL input for qemu_opts_del

2014-04-29 Thread Chunyan Liu
To simplify later using of qemu_opts_del, accept NULL input. Reviewed-by: Stefan Hajnoczi Reviewed-by: Eric Blake Signed-off-by: Chunyan Liu --- util/qemu-option.c | 4 1 file changed, 4 insertions(+) diff --git a/util/qemu-option.c b/util/qemu-option.c index 4de99b3..2667e16 100644 ---

[Qemu-devel] [PATCH V26 02/32] QemuOpts: add def_value_str to QemuOptDesc

2014-04-29 Thread Chunyan Liu
Add def_value_str (default value) to QemuOptDesc, to replace function of the default value in QEMUOptionParameter. Improve qemu_opts_get_* functions: if find opt, return opt->str; otherwise, if desc->def_value_str is set, return desc->def_value_str; otherwise, return input defval. Improve qemu_op

[Qemu-devel] [PATCH V26 07/32] QemuOpts: add qemu_opt_get_*_del functions for replace work

2014-04-29 Thread Chunyan Liu
Add qemu_opt_get_del, qemu_opt_get_bool_del, qemu_opt_get_number_del and qemu_opt_get_size_del to replace the same handling of QEMUOptionParameter (get and delete). Several drivers are coded to parse a known subset of options, then remove them from the list before handing all remaining options to

[Qemu-devel] [PATCH V26 09/32] QemuOpts: add conversion between QEMUOptionParameter to QemuOpts

2014-04-29 Thread Chunyan Liu
Add two temp conversion functions between QEMUOptionParameter to QemuOpts, so that next patch can use it. It will simplify later patch for easier review. And will be finally removed after all backend drivers switch to QemuOpts. Reviewed-by: Stefan Hajnoczi Reviewed-by: Eric Blake Signed-off-by:

[Qemu-devel] [PATCH V26 04/32] qapi: output def_value_str when query command line options

2014-04-29 Thread Chunyan Liu
Change qapi interfaces to output the newly added def_value_str when querying command line options. Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- Changes to V25: * update @default description in .json file qapi-schema.json | 5 - qmp-commands.hx| 2 ++ util/qemu-config.

[Qemu-devel] [PATCH V26 10/32] QemuOpts: add qemu_opts_append to replace append_option_parameters

2014-04-29 Thread Chunyan Liu
For later merge .create_opts of drv and proto_drv in qemu-img commands. Reviewed-by: Stefan Hajnoczi Reviewed-by: Eric Blake Reviewed-by: Leandro Dorileo Signed-off-by: Chunyan Liu --- include/qemu/option.h | 5 util/qemu-option.c| 65

[Qemu-devel] [PATCH V26 08/32] QemuOpts: add qemu_opts_print_help to replace print_option_help

2014-04-29 Thread Chunyan Liu
print_option_help takes QEMUOptionParameter as parameter, add qemu_opts_print_help to take QemuOptsList as parameter for later replace work. Reviewed-by: Eric Blake Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu --- include/qemu/option.h | 1 + util/qemu-option.c| 13 +

[Qemu-devel] [PATCH V26 00/32] replace QEMUOptionParameter with QemuOpts

2014-04-29 Thread Chunyan Liu
This patch series is to replace QEMUOptionParameter with QemuOpts, so that only one Qemu Option structure is kept in QEMU code. --- Changes to v25: * split v25 2/31 (add def_value_str to QemuOptDesc) into two patches: 1st patch adds def_value_str, 2nd patch repurpose qemu_opts_print. * upd

[Qemu-devel] [PATCH V26 05/32] QemuOpts: change opt->name|str from (const char *) to (char *)

2014-04-29 Thread Chunyan Liu
qemu_opt_del() already assumes that all QemuOpt instances contain malloc'd name and value; but it had to cast away const because opts_start_struct() was doing its own thing and using static storage instead. By using the correct type and malloced strings everywhere, the usage of this struct becomes

Re: [Qemu-devel] [PATCH 4/5] libcacard: replace qemu thread primitives with glib ones

2014-04-29 Thread Paolo Bonzini
Il 29/04/2014 10:42, Michael Tokarev ha scritto: >>> > Also replace single instance pstrcpy() in vcard_emul_nss.c >>> > to strncpy(). This reverts commit 2e679780ae86c6ca8. >> An alternative would be to use g_strlcpy which guarantees >> nul-termination. > > Yes, that is better. Actually in th

[Qemu-devel] [PATCH V26 03/32] QemuOpts: repurpose qemu_opts_print to replace print_option_parameters

2014-04-29 Thread Chunyan Liu
Currently this function is not used anywhere. In later patches, it will replace print_option_parameters. To avoid print info changes, change qemu_opts_print from fprintf stderr to printf to keep consistent with print_option_parameters, remove last printf and print size/number with opt->value.uint i

[Qemu-devel] [PATCH V26 01/32] QemuOpts: move find_desc_by_name ahead for later calling

2014-04-29 Thread Chunyan Liu
Reviewed-by: Stefan Hajnoczi Reviewed-by: Eric Blake Signed-off-by: Chunyan Liu --- util/qemu-option.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/util/qemu-option.c b/util/qemu-option.c index 8bbc3ad..808aef4 100644 --- a/util/qemu-option.

[Qemu-devel] [PULL 1/1] hda-audio: fix non-mixer codecs

2014-04-29 Thread Gerd Hoffmann
They don't advertise mixer support, but still allow the guest change mixer settings. Add a check to avoid it. Signed-off-by: Gerd Hoffmann --- hw/audio/hda-codec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c index a67ca91..48c6ead 100644 --

[Qemu-devel] [PULL 0/1] hda-audio: fix non-mixer codecs

2014-04-29 Thread Gerd Hoffmann
Hi, pretty short audio patch queue, featuring a single hda-audio fix. please pull, Gerd The following changes since commit e2da502c003b9a91b4aea7684959192bd07c1f1d: Merge remote-tracking branch 'remotes/otubo/seccomp' into staging (2014-04-28 14:14:35 +0100) are available in the git rep

Re: [Qemu-devel] [PATCHv2 RESEND] block/iscsi: speed up read for unallocated sectors

2014-04-29 Thread Peter Lieven
Am 28.04.2014 16:56, schrieb Paolo Bonzini: > Il 28/04/2014 16:41, Peter Lieven ha scritto: >>> > What if opt_unmap_gran is 32K or lower? In this case you're not using an >>> > allocationmap. >> As written I am fine with lowering this to 4K. >> >> Follow-Up or v3? > > Follow up is okay. 2 follow

Re: [Qemu-devel] KVM call agenda for 2014-04-28

2014-04-29 Thread Peter Maydell
On 29 April 2014 06:51, Michael S. Tsirkin wrote: > If not too late, I'd like to discuss our security process. > Do we as the project generally agree to use responsible disclosure policy > http://en.wikipedia.org/wiki/Responsible_disclosure ? I think something like that makes sense. I'm a bit war

Re: [Qemu-devel] KVM call agenda for 2014-04-28

2014-04-29 Thread Alexander Graf
On 28.04.2014, at 17:34, Markus Armbruster wrote: > Juan Quintela writes: > >> Hi >> >> Please, send any topic that you are interested in covering. > > [...] > > I'd like to have these things settled sooner than five minutes before > the scheduled hour, so here goes: call or no call? Agend

Re: [Qemu-devel] [PATCH] block: Add '--version' option to qemu-img

2014-04-29 Thread Kevin Wolf
Am 28.04.2014 um 20:37 hat Jeff Cody geschrieben: > This allows qemu-img to print out version information, without > needing to print the long help wall of text. > > While there, perform some minor whitespace cleanup, and remove the > unused option_index variable in the call to getopt_long(). > >

Re: [Qemu-devel] [PATCH 23/35] acpi:piix4: make plug/unlug callbacks generic

2014-04-29 Thread Paolo Bonzini
Il 29/04/2014 09:25, Michael S. Tsirkin ha scritto: But to repeat what I was saying, this check (that object passed in is a PCI DEVICE) belongs in acpi_pcihp_device_plug_cb and should not be piix specific, I don't want to duplicate this logic in q35 later. Similar checks should be added in shpc_d

[Qemu-devel] [PATCH 1/2] usb: mtp: fix possible buffer overflow

2014-04-29 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/usb/dev-mtp.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index b6eaeae..62428d8 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -998,6 +998,14 @@ static void usb_mtp_handle_data(USBDevice *dev, USBPac

[Qemu-devel] [PATCH 2/2] usb: mtp: reply INCOMPLETE_TRANSFER on read errors

2014-04-29 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/usb/dev-mtp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index 62428d8..943f930 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -50,6 +50,7 @@ enum mtp_code { RES_INVALID_TRANSACTION_I

[Qemu-devel] [PATCH 0/2] usb: mtp: incremental fixes

2014-04-29 Thread Gerd Hoffmann
Hi, Resending updates for the two mtp patches which has review comments. cheers, Gerd Gerd Hoffmann (2): usb: mtp: fix possible buffer overflow usb: mtp: reply INCOMPLETE_TRANSFER on read errors hw/usb/dev-mtp.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) -- 1.

Re: [Qemu-devel] [PATCH 4/5] libcacard: replace qemu thread primitives with glib ones

2014-04-29 Thread Michael Tokarev
29.04.2014 12:38, Paolo Bonzini wrote: > Il 29/04/2014 10:26, Christophe Fergeau ha scritto: >>> > Replace QemuMutex with GMutex and QemuCond with GCond >>> > (with corresponding function changes), to make libcacard >>> > independent of qemu internal functions. >>> > >>> > Also replace single insta

Re: [Qemu-devel] [PATCH] linux-user: avoid using glibc internals

2014-04-29 Thread Natanael Copa
On Wed, 23 Apr 2014 19:00:41 +0100 Peter Maydell wrote: > On 23 April 2014 15:59, Natanael Copa wrote: > > Avoid using glibc specific internals. > > > > Calculate the sigevent pad size is calculated in similar way as kernel > > does it. > > > > This is needed for building with musl libc. > > Th

Re: [Qemu-devel] [PATCH 4/5] libcacard: replace qemu thread primitives with glib ones

2014-04-29 Thread Paolo Bonzini
Il 29/04/2014 10:26, Christophe Fergeau ha scritto: > Replace QemuMutex with GMutex and QemuCond with GCond > (with corresponding function changes), to make libcacard > independent of qemu internal functions. > > Also replace single instance pstrcpy() in vcard_emul_nss.c > to strncpy(). This rev

Re: [Qemu-devel] [PATCH 23/35] acpi:piix4: make plug/unlug callbacks generic

2014-04-29 Thread Michael S. Tsirkin
On Fri, Apr 11, 2014 at 09:40:19PM -0400, Paolo Bonzini wrote: > Il 07/04/2014 11:19, Michael S. Tsirkin ha scritto: > >This means we can't cleanly implement an option for guest to > >disable ACPI and switch to native if supported, > >like the ACPI spec allows. > > > >If we change hotplug code to w

Re: [Qemu-devel] [PATCH 4/5] libcacard: replace qemu thread primitives with glib ones

2014-04-29 Thread Christophe Fergeau
Hey, patch looks good On Tue, Apr 29, 2014 at 10:02:27AM +0400, Michael Tokarev wrote: > Replace QemuMutex with GMutex and QemuCond with GCond > (with corresponding function changes), to make libcacard > independent of qemu internal functions. > > Also replace single instance pstrcpy() in vcard_e

Re: [Qemu-devel] [PATCH 23/35] acpi:piix4: make plug/unlug callbacks generic

2014-04-29 Thread Michael S. Tsirkin
On Tue, Apr 29, 2014 at 10:12:34AM +0200, Paolo Bonzini wrote: > Il 07/04/2014 17:36, Michael S. Tsirkin ha scritto: > >>> * What if there would be more handlers that could or should handle event > >>>for device? > >That's actually very useful. We could scan top to bottom > >so e.g. acpi can i

Re: [Qemu-devel] [PATCH 23/35] acpi:piix4: make plug/unlug callbacks generic

2014-04-29 Thread Paolo Bonzini
Il 07/04/2014 17:36, Michael S. Tsirkin ha scritto: > * What if there would be more handlers that could or should handle event >for device? That's actually very useful. We could scan top to bottom so e.g. acpi can intercept bridges. Be careful about "top to bottom". Does top-to-bottom m

Re: [Qemu-devel] [PATCH 1/5] do not call g_thread_init() for glib >= 2.31

2014-04-29 Thread Christophe Fergeau
On Tue, Apr 29, 2014 at 10:02:24AM +0400, Michael Tokarev wrote: > glib >= 2.31 always enables thread support and g_thread_supported() > is #defined to 1, there's no need to call g_thread_init() anymore, > and it definitely does not need to report error which never happens. > Keep code for old < 2.

Re: [Qemu-devel] [PATCH 3/5] vscclient: use glib thread primitives not qemu

2014-04-29 Thread Michael Tokarev
29.04.2014 12:03, Christophe Fergeau wrote: > Hey, > > On Tue, Apr 29, 2014 at 10:02:26AM +0400, Michael Tokarev wrote: >> Use glib-provided thread primitives in vscclient, not qemu >> thread primitives. This way, vscclient becomes more stand-alone. > > For what it's worth, this patch has a few

Re: [Qemu-devel] [PATCH 3/5] vscclient: use glib thread primitives not qemu

2014-04-29 Thread Christophe Fergeau
Hey, On Tue, Apr 29, 2014 at 10:02:26AM +0400, Michael Tokarev wrote: > Use glib-provided thread primitives in vscclient, not qemu > thread primitives. This way, vscclient becomes more stand-alone. For what it's worth, this patch has a few non-threading related bits in it because of the removal

[Qemu-devel] [PATCH] linux-user: avoid using glibc internals in _syscall5 and in definition of target_sigevent struct

2014-04-29 Thread Natanael Copa
Use the public sigset_t instead of the glibc specific internal __sigset_t in _syscall. Calculate the sigevent pad size is calculated in similar way as kernel does it instead of using glibc internal field _pad. This is needed for building with musl libc. Signed-off-by: Natanael Copa --- Changes

[Qemu-devel] [PATCH v3] mirror: Check for bdrv_get_info result

2014-04-29 Thread Fam Zheng
bdrv_get_info could fail. Add check before using the returned value. Signed-off-by: Fam Zheng --- v3: Don't leak things, jump to immediate_exit. (Kevin) Signed-off-by: Fam Zheng --- block/mirror.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/block/mirror.c b/block/

[Qemu-devel] [PATCH] mirror: Fix resource leak when bdrv_getlength fails

2014-04-29 Thread Fam Zheng
The direct return will skip releasing of all the resouces at immediate_exit, don't miss that. Signed-off-by: Fam Zheng --- block/mirror.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/mirror.c b/block/mirror.c index 2618c37..56dfee2 100644 --- a/block/mirror.c +++ b

Re: [Qemu-devel] [PATCH] Makefile: Fix per-object variables for Makefile.target

2014-04-29 Thread Fam Zheng
On Tue, 04/29 08:29, Paolo Bonzini wrote: > Il 29/04/2014 05:29, Fam Zheng ha scritto: > > The compiling is done in a subdir, so the extraction of per-object libs > > and cflags are referencing objects with ../ prefixed. So prefix the > > per-object variables "foo.o-cflags" and "foo.o-libs" to > >

Re: [Qemu-devel] [PATCH] linux-user: avoid using glibc internals

2014-04-29 Thread Natanael Copa
On Wed, 23 Apr 2014 19:00:41 +0100 Peter Maydell wrote: > On 23 April 2014 15:59, Natanael Copa wrote: > > Avoid using glibc specific internals. > > > > Calculate the sigevent pad size is calculated in similar way as kernel > > does it. > > > > This is needed for building with musl libc. > > Th

Re: [Qemu-devel] [PATCH] -nographic sometimes adds an extra chardev for stdio

2014-04-29 Thread Gerd Hoffmann
On Mo, 2014-04-28 at 11:00 -0400, Mike Day wrote: > When the deprecated -nographic option is used with the -mon option in > readline mode, qemu will create a second character device for stdio > and place it over the stdio chardev put into place by the -mon > option. This causes the terminal to stop

[Qemu-devel] [Bug 1313816] Re: qemu should close sound device when no more needs.

2014-04-29 Thread Michael Tokarev
This will not work if qemu is chrooted, because audio devices (/dev) aren't usually available there. So at least a naive approach should not be used. If nothing else, it should be an option. But really, with pulseaudio backend, there should be no need to go this route and to add new code. -- Y

<    1   2   3   4