Patchwork [1/2] rtc: Parse the 'driftfix' option only for TARGET_I386

login
register
mail settings
Submitter Amit Shah
Date June 23, 2010, 2:29 p.m.
Message ID <34d91ff747d586261f56ba024d2fe9f8734180f6.1277303360.git.amit.shah@redhat.com>
Download mbox | patch
Permalink /patch/56679/
State New
Headers show

Comments

Amit Shah - June 23, 2010, 2:29 p.m.
The driftfix option is only useful for Windows guests, and for the x86
architecture, so limit the option parsing to TARGET_I386. This ifdef
conditional is moved from qemu-config.c to vl.c. The next patch will fix
a bug where the driftfix option wasn't exposed at all even to the x86
architecture.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
 vl.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Paolo Bonzini - June 23, 2010, 2:35 p.m.
On 06/23/2010 04:29 PM, Amit Shah wrote:
> The driftfix option is only useful for Windows guests, and for the x86
> architecture, so limit the option parsing to TARGET_I386. This ifdef
> conditional is moved from qemu-config.c to vl.c. The next patch will fix
> a bug where the driftfix option wasn't exposed at all even to the x86
> architecture.
>
> Signed-off-by: Amit Shah<amit.shah@redhat.com>
> ---
>   vl.c |    2 ++
>   1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/vl.c b/vl.c
> index 920717a..f9c8086 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -418,6 +418,7 @@ static void configure_rtc(QemuOpts *opts)
>               exit(1);
>           }
>       }
> +#ifdef TARGET_I386
>       value = qemu_opt_get(opts, "driftfix");
>       if (value) {
>           if (!strcmp(value, "slew")) {
> @@ -429,6 +430,7 @@ static void configure_rtc(QemuOpts *opts)
>               exit(1);
>           }
>       }
> +#endif
>   }
>
>   /***********************************************************/

This file is compiled only once for upstream qemu, so it will never see 
TARGET_I386.  Any reason to have the #ifdef at all?

Paolo
Juan Quintela - June 23, 2010, 2:39 p.m.
Amit Shah <amit.shah@redhat.com> wrote:
> The driftfix option is only useful for Windows guests, and for the x86
> architecture, so limit the option parsing to TARGET_I386. This ifdef
> conditional is moved from qemu-config.c to vl.c. The next patch will fix
> a bug where the driftfix option wasn't exposed at all even to the x86
> architecture.
>
> Signed-off-by: Amit Shah <amit.shah@redhat.com>

Acked-by: Juan Quintela <quintela@redhat.com>

(for both patches).
Amit Shah - June 23, 2010, 2:43 p.m.
On (Wed) Jun 23 2010 [16:35:26], Paolo Bonzini wrote:
> On 06/23/2010 04:29 PM, Amit Shah wrote:
> >The driftfix option is only useful for Windows guests, and for the x86
> >architecture, so limit the option parsing to TARGET_I386. This ifdef
> >conditional is moved from qemu-config.c to vl.c. The next patch will fix
> >a bug where the driftfix option wasn't exposed at all even to the x86
> >architecture.
> >
> >Signed-off-by: Amit Shah<amit.shah@redhat.com>
> >---
> >  vl.c |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> >
> >diff --git a/vl.c b/vl.c
> >index 920717a..f9c8086 100644
> >--- a/vl.c
> >+++ b/vl.c
> >@@ -418,6 +418,7 @@ static void configure_rtc(QemuOpts *opts)
> >              exit(1);
> >          }
> >      }
> >+#ifdef TARGET_I386
> >      value = qemu_opt_get(opts, "driftfix");
> >      if (value) {
> >          if (!strcmp(value, "slew")) {
> >@@ -429,6 +430,7 @@ static void configure_rtc(QemuOpts *opts)
> >              exit(1);
> >          }
> >      }
> >+#endif
> >  }
> >
> >  /***********************************************************/
> 
> This file is compiled only once for upstream qemu, so it will never
> see TARGET_I386.  Any reason to have the #ifdef at all?

Er, yeah; I wanted to drop 1/2 before sending out the patch -- just
patch 2 should be considered. I'll send a v2.


		Amit

Patch

diff --git a/vl.c b/vl.c
index 920717a..f9c8086 100644
--- a/vl.c
+++ b/vl.c
@@ -418,6 +418,7 @@  static void configure_rtc(QemuOpts *opts)
             exit(1);
         }
     }
+#ifdef TARGET_I386
     value = qemu_opt_get(opts, "driftfix");
     if (value) {
         if (!strcmp(value, "slew")) {
@@ -429,6 +430,7 @@  static void configure_rtc(QemuOpts *opts)
             exit(1);
         }
     }
+#endif
 }
 
 /***********************************************************/