[Qemu-devel] [PATCH v6 1/3] Check if GlobalProperty exists before registering

2012-07-18 Thread Crístian Viana
If a GlobalProperty has already been registered, it won't have its value overwritten. This is done to enforce that the properties specified in the command line will win over the ones specified by the machine properties, if set with the parameter -M. Signed-off-by: Crístian Viana via

[Qemu-devel] [PATCH v6 3/3] Change driftfix default value to slew

2012-07-18 Thread Crístian Viana
Windows 2008+ is very sensitive to missed ticks. The RTC is used by default as the time source. If driftfix is not enabled, Windows is prone to blue screening. Signed-off-by: Crístian Viana via...@linux.vnet.ibm.com --- hw/mc146818rtc.c |2 +- vl.c | 11 ++- 2 files

[Qemu-devel] [PATCH v6 2/3] Force driftfix=none on previous machines

2012-07-18 Thread Crístian Viana
The current value for the -rtc driftfix option is 'none'. This patch makes sure that the old machines configuration will work the same way even after that option changes its default value. Signed-off-by: Crístian Viana via...@linux.vnet.ibm.com --- hw/pc_piix.c |4 1 file changed, 4

[Qemu-devel] [PATCH 1/1] Remove unnecessary strlen in qga/channel-posix.c

2012-07-06 Thread Crístian Viana
The third parameter of unix_listen in the line: int fd = unix_listen(path, NULL, strlen(path)); makes an unnecessary call to strlen. That parameter will not be used unless the second parameter is not NULL, which is not the case here. --- qga/channel-posix.c |2 +- 1 file changed, 1

[Qemu-devel] [PATCH v5 3/3] Change driftfix default value to slew

2012-06-26 Thread Crístian Viana
Windows 2008+ is very sensitive to missed ticks. The RTC is used by default as the time source. If driftfix is not enabled, Windows is prone to blue screening. Signed-off-by: Crístian Viana via...@linux.vnet.ibm.com --- hw/mc146818rtc.c |2 +- vl.c | 11 ++- 2 files

[Qemu-devel] [PATCH v5 2/3] Force driftfix=none on previous machines

2012-06-26 Thread Crístian Viana
The current value for the -rtc driftfix option is 'none'. This patch makes sure that the old machines configuration will work the same way even after that option changes its default value. Signed-off-by: Crístian Viana via...@linux.vnet.ibm.com --- hw/pc_piix.c |4 1 file changed, 4

[Qemu-devel] [PATCH v5 1/3] Check if GlobalProperty exists before registering

2012-06-26 Thread Crístian Viana
If a GlobalProperty has already been registered, it won't have its value overwritten. Signed-off-by: Crístian Viana via...@linux.vnet.ibm.com --- Changes since v4: - Only register a GlobalProperty if it hasn't already been registered. That avoids the property values to be overwritten (fix

[Qemu-devel] [PATCH v4 1/2] Force driftfix=none on previous machines

2012-06-19 Thread Crístian Viana
The current value for the -rtc driftfix option is 'none'. This patch makes sure that the old machines configuration will work the same way even after that option changes its default value. Signed-off-by: Crístian Viana via...@linux.vnet.ibm.com --- There's a scenario when things don't work

[Qemu-devel] [PATCH v4 2/2] Change driftfix default value to slew

2012-06-19 Thread Crístian Viana
Windows 2008+ is very sensitive to missed ticks. The RTC is used by default as the time source. If driftfix is not enabled, Windows is prone to blue screening. Signed-off-by: Crístian Viana via...@linux.vnet.ibm.com --- Anthony, Could you please try to reproduce the segfault again (as you stated

Re: [Qemu-devel] [PATCH 1/1] Fix strcpy calls

2012-05-30 Thread Crístian Viana
On 30-05-2012 02:41, Peter Maydell wrote: Nak. This is duplicating a much better patchset from Jim Meyering: http://lists.gnu.org/archive/html/qemu-devel/2012-05/msg01151.html -- PMM Sorry, I hadn't seen his patchset. Is it OK for me to proceed with a similar patch regarding the function

[Qemu-devel] [PATCH 1/1 v5] Allow machines to configure the QEMU_VERSION that's exposed via hardware

2012-05-29 Thread Crístian Viana
report. If that field is set, then that machine will report that version to the guest. Signed-off-by: Crístian Viana via...@linux.vnet.ibm.com --- Changes since v4: - Rewrite commit message - Replace snprintf calls by pstrcpy/pstrcat. hw/boards.h |1 + hw/bt-sdp.c

[Qemu-devel] [PATCH 1/1] Fix strcpy calls

2012-05-29 Thread Crístian Viana
Replace some strcpy and strncpy calls by pstrcpy because the former ones may cause buffer overflow and may also not write a null-terminating character at the end of the resulting string Signed-off-by: Crístian Viana via...@linux.vnet.ibm.com --- According to the file HACKING, the functions strcpy

Re: [Qemu-devel] [PATCH 1/1 v4] Allow machines to configure the QEMU_VERSION that's exposed via hardware

2012-05-24 Thread Crístian Viana
On 23-05-2012 17:54, Peter Maydell wrote: The point is that your snprintf is not actually using the full power of a format string parser, it's just concatenating two strings (QEMU and the version). The simple way to put two strings into a buffer one after the other is to copy string A and then

Re: [Qemu-devel] [PATCH 1/1 v4] Allow machines to configure the QEMU_VERSION that's exposed via hardware

2012-05-23 Thread Crístian Viana
Hi Peter, Thanks for all your tips! OK, this has been bugging me for the last three versions, and since I'm complaining about other things anyway: can you reword this commit message, please, so that it is a standalone paragraph explaining (a) what the commit does and (b) why it is doing it,

Re: [Qemu-devel] [PATCH 1/1 v4] Allow machines to configure the QEMU_VERSION that's exposed via hardware

2012-05-23 Thread Crístian Viana
On 23-05-2012 13:11, Eric Blake wrote: pstrcat is more efficient than snprintf() - the former is dedicated to a single task, while the latter has to parse a format string and decode that it is doing a single %s expansion. In other words, just because *printf can do string concatenation doesn't

[Qemu-devel] [PATCH 1/1 v4] Allow machines to configure the QEMU_VERSION that's exposed via hardware

2012-05-22 Thread Crístian Viana
find all these places and stop doing this. There is a new field on the struct QEmuMachine, hw_version, which may contain the version that the specific machine should report. If that field is set, then that machine will report that version to the virtual machine. Signed-off-by: Crístian Viana via

Re: [Qemu-devel] [PATCH 1/1 v3] Allow machines to configure the QEMU_VERSION that's exposed via hardware

2012-05-08 Thread Crístian Viana
On 27-04-2012 20:14, Crístian Viana wrote: On 27-04-2012 18:23, Peter Maydell wrote: That appears to contain one of your older versions of this patch, not v3. (It touches bsd-user/main.c, for example.) -- PMM You were right, it was an older version. Now the branch is updated and rebased

[Qemu-devel] GlobalProperty in QEMUMachine overwrites explicit command line value

2012-05-08 Thread Crístian Viana
Hi, I'm trying to change the default value of the parameter -rtc driftfix= and something's going wrong. This is a GlobalProperty and, currently, it is equivalent to setting -rtc driftfix=none in the command line. I'm appending a new GlobalProperty value to all previous QEMUMachine instances

Re: [Qemu-devel] [PATCH 1/1 v3] Allow machines to configure the QEMU_VERSION that's exposed via hardware

2012-04-27 Thread Crístian Viana
On 25-04-2012 16:16, Anthony Liguori wrote: If you run: x86_64-softmmu/qemu-system-x86_64 This will SEGV because machine == NULL. It's quite a bit later in this function when machine gets initialized with the default machine. You mean running only the binary, without arguments? I got no

Re: [Qemu-devel] [PATCH 1/1 v3] Allow machines to configure the QEMU_VERSION that's exposed via hardware

2012-04-27 Thread Crístian Viana
On 27-04-2012 14:41, Anthony Liguori wrote: Can you post a git tree on github so I can look at the difference? Maybe patch applied it wrong. git://github.com/cd1/qemu.git, branch qemu-version Best regards, Crístian.

Re: [Qemu-devel] [PATCH 1/1 v3] Allow machines to configure the QEMU_VERSION that's exposed via hardware

2012-04-27 Thread Crístian Viana
On 27-04-2012 18:23, Peter Maydell wrote: That appears to contain one of your older versions of this patch, not v3. (It touches bsd-user/main.c, for example.) -- PMM You were right, it was an older version. Now the branch is updated and rebased against the current master. Best regards,

[Qemu-devel] [PATCH 1/1 v3] Allow machines to configure the QEMU_VERSION that's exposed via hardware

2012-04-13 Thread Crístian Viana
find all these places and stop doing this. There is a new field on the struct QEmuMachine, hw_version, which may contain the version that the specific machine should report. If that field is set, then that machine will report that version to the virtual machine. Signed-off-by: Crístian Viana via

Re: [Qemu-devel] [PATCH 1/1 v3] Allow machines to configure the QEMU_VERSION that's exposed via hardware

2012-04-13 Thread Crístian Viana
On 13-04-2012 16:26, Eric Blake wrote: qemu_get_version returns whatever string got put there by qemu_set_version. Am I correct that the user has full control over the string passed to qemu_set_version? Actually, this is not available to the user, the string passed to that function is

[Qemu-devel] [PATCH 1/1 v2] Allow machines to configure the QEMU_VERSION that's exposed via hardware

2012-04-10 Thread Crístian Viana
find all these places and stop doing this. There is a new field on the struct QEmuMachine, hw_version, which may contain the version that the specific machine should report. If that field is set, then that machine will report that version to the virtual machine. Signed-off-by: Crístian Viana via

[Qemu-devel] [PATCH 1/1] Allow machines to configure the QEMU_VERSION that's exposed via hardware

2012-04-05 Thread Crístian Viana
find all these places and stop doing this. There is a new field on the struct QEmuMachine, hw_version, which may contain the version that the specific machine should report. If that field is set, then that machine will report that version to the virtual machine. Signed-off-by: Crístian Viana via

Re: [Qemu-devel] [PATCH 1/1] Allow machines to configure the QEMU_VERSION that's exposed via hardware

2012-04-05 Thread Crístian Viana
On 05-04-2012 11:48, Peter Maydell wrote: This kind of change is definitely wrong -- where we're reporting the QEMU version to the *user* we definitely don't want to introduce the possibility of lying about it. (This is distinct from reporting the QEMU version to the *guest* via device

[Qemu-devel] [PATCH v3 2/2] Change timedrift default value to slew

2012-03-21 Thread Crístian Viana
Windows 2008+ is very sensitive to missed ticks. The RTC is used by default as the time source. If time drift is not enabled, Windows is prone to blue screening. Signed-off-by: Crístian Viana via...@linux.vnet.ibm.com --- hw/mc146818rtc.c |2 +- vl.c | 10 +- 2 files

[Qemu-devel] [PATCH v3 1/2] Force timedrift=none on previous machines

2012-03-21 Thread Crístian Viana
The current value for the -rtc timedrift option is none. This patch makes sure that the old machines configuration will work the same way even after that option changes its default value. Signed-off-by: Crístian Viana via...@linux.vnet.ibm.com --- hw/pc_piix.c | 39

Re: [Qemu-devel] [PATCH v2 2/2] Change timedrift default value to slew

2012-03-21 Thread Crístian Viana
On 21-03-2012 03:02, Paolo Bonzini wrote: This piece of code from the previous if: if (!strcmp(value, slew)) { static GlobalProperty slew_lost_ticks[] = { { .driver = mc146818rtc, .property = lost_tick_policy,

[Qemu-devel] [PATCH 2/2] Change timedrift default value to slew

2012-03-20 Thread Crístian Viana
Windows 2008+ is very sensitive to missed ticks. The RTC is used by default as the time source. If time drift is not enabled, Windows is prone to blue screening. Signed-off-by: Crístian Viana via...@linux.vnet.ibm.com --- vl.c | 13 - 1 files changed, 12 insertions(+), 1

[Qemu-devel] [PATCH 1/2] Force timedrift=none on previous machines

2012-03-20 Thread Crístian Viana
The current value for the -rtc timedrift option is none. This patch makes sure that the old machines configuration will work the same way even after that option changes its default value. Signed-off-by: Crístian Viana via...@linux.vnet.ibm.com --- hw/pc_piix.c | 39

Re: [Qemu-devel] [PATCH 2/2] Change timedrift default value to slew

2012-03-20 Thread Crístian Viana
On 20-03-2012 17:05, Anthony Liguori wrote: I think we just want to change: hw/mc146818rtc.h: DEFINE_PROP_LOSTTICKPOLICY(lost_tick_policy, RTCState, lost_tick_policy, LOST_TICK_DISCARD), I think we just need to change this to LOST_TICK_SLEW. This would

Re: [Qemu-devel] [PATCH 2/2] Change timedrift default value to slew

2012-03-20 Thread Crístian Viana
On 20-03-2012 17:31, Anthony Liguori wrote: On 03/20/2012 03:16 PM, Crístian Viana wrote: On 20-03-2012 17:05, Anthony Liguori wrote: I think we just want to change: hw/mc146818rtc.h: DEFINE_PROP_LOSTTICKPOLICY(lost_tick_policy, RTCState

[Qemu-devel] [PATCH v2 1/2] Force timedrift=none on previous machines

2012-03-20 Thread Crístian Viana
The current value for the -rtc timedrift option is none. This patch makes sure that the old machines configuration will work the same way even after that option changes its default value. Signed-off-by: Crístian Viana via...@linux.vnet.ibm.com --- hw/pc_piix.c | 39

[Qemu-devel] [PATCH v2 2/2] Change timedrift default value to slew

2012-03-20 Thread Crístian Viana
Windows 2008+ is very sensitive to missed ticks. The RTC is used by default as the time source. If time drift is not enabled, Windows is prone to blue screening. Signed-off-by: Crístian Viana via...@linux.vnet.ibm.com --- hw/mc146818rtc.c |2 +- vl.c |2 +- 2 files changed

[Qemu-devel] QEmu: support disk filenames with comma

2012-03-09 Thread Crístian Viana
Hi! This patch fixes RHBZ #801036 adding support to filenames with comma using QEmu. As this is my first patch to libvirt, I'm not completely sure if I should have also changed other parts of the code, or if I have used the wrong memory allocation functions/macros, or if I shouldn't have

[Qemu-devel] [PATCH 1/2] QEmu: support disk filenames with comma

2012-03-09 Thread Crístian Viana
If there is a disk file with a comma in the name, QEmu expects a double comma instead of a single one (e.g., the file virtual,disk.img needs to be specified as virtual,,disk.img in QEmu's command line). This patch fixes libvirt to work with that feature. Fix RHBZ #801036. diff --git

[Qemu-devel] [PATCH 2/2] Add myself to the AUTHORS file

2012-03-09 Thread Crístian Viana
diff --git a/AUTHORS b/AUTHORS index 954fd1a..b09bd62 100644 --- a/AUTHORS +++ b/AUTHORS @@ -224,6 +224,7 @@ Patches have also been contributed by: Peter Robinson pbrobin...@gmail.com Benjamin Camaben...@dolka.fr Duncan Rance libv...@dunquino.com + Crístian Viana

Re: [Qemu-devel] QEmu: support disk filenames with comma

2012-03-09 Thread Crístian Viana
On 09-03-2012 14:27, Eric Blake wrote: For starters, you mailed the qemu list. This patch should be sent instead to libvir-l...@redhat.com, so that it will actually reach the libvirt folks. Oh, sorry, wrong list :-) I'll mail the right one then. Thanks!