[Qemu-devel] [PATCH 22/26] qapi: make rtc-reset-reinjection depend on TARGET_I386

Marc-André Lureau posted 26 patches 8 years, 6 months ago
There is a newer version of this series
[Qemu-devel] [PATCH 22/26] qapi: make rtc-reset-reinjection depend on TARGET_I386
Posted by Marc-André Lureau 8 years, 6 months ago
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 qapi-schema.json |  3 ++-
 monitor.c        | 10 ----------
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/qapi-schema.json b/qapi-schema.json
index 2f4528c769..2361c13fc8 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -6270,7 +6270,8 @@
 # <- { "return": {} }
 #
 ##
-{ 'command': 'rtc-reset-reinjection' }
+{ 'command': 'rtc-reset-reinjection',
+  'if': ['defined(NEED_CPU_H)', 'defined(TARGET_I386)'] }
 
 # Rocker ethernet network switch
 { 'include': 'qapi/rocker.json' }
diff --git a/monitor.c b/monitor.c
index 383c84d162..f3dafafa22 100644
--- a/monitor.c
+++ b/monitor.c
@@ -970,9 +970,6 @@ static void qmp_query_qmp_schema(QDict *qdict, QObject **ret_data,
  */
 static void qmp_unregister_commands_hack(void)
 {
-#ifndef TARGET_I386
-    qmp_unregister_command(&qmp_commands, "rtc-reset-reinjection");
-#endif
 #ifndef TARGET_S390X
     qmp_unregister_command(&qmp_commands, "dump-skeys");
 #endif
@@ -4151,13 +4148,6 @@ QemuOptsList qemu_mon_opts = {
     },
 };
 
-#ifndef TARGET_I386
-void qmp_rtc_reset_reinjection(Error **errp)
-{
-    error_setg(errp, QERR_FEATURE_DISABLED, "rtc-reset-reinjection");
-}
-#endif
-
 #ifndef TARGET_S390X
 void qmp_dump_skeys(const char *filename, Error **errp)
 {
-- 
2.14.0.rc0.1.g40ca67566


Re: [Qemu-devel] [PATCH 22/26] qapi: make rtc-reset-reinjection depend on TARGET_I386
Posted by Markus Armbruster 8 years, 5 months ago
Marc-André Lureau <marcandre.lureau@redhat.com> writes:

> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  qapi-schema.json |  3 ++-
>  monitor.c        | 10 ----------
>  2 files changed, 2 insertions(+), 11 deletions(-)
>
> diff --git a/qapi-schema.json b/qapi-schema.json
> index 2f4528c769..2361c13fc8 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -6270,7 +6270,8 @@
>  # <- { "return": {} }
>  #
>  ##
> -{ 'command': 'rtc-reset-reinjection' }
> +{ 'command': 'rtc-reset-reinjection',
> +  'if': ['defined(NEED_CPU_H)', 'defined(TARGET_I386)'] }

Aha, here' you use the list syntax.

And your strategy to keep things compiling also becomes clear: you wrap
uses of poisoned symbols like TARGET_I386 in #if defined(NEED_CPU_H).

Not exactly elegant, but looks workable.  But you need to explain this
solution in commit messages [PATCH 21, I guess] and document it in
qapi-code-gen.txt.  *Unless* we can find a better one.

>  
>  # Rocker ethernet network switch
>  { 'include': 'qapi/rocker.json' }
> diff --git a/monitor.c b/monitor.c
> index 383c84d162..f3dafafa22 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -970,9 +970,6 @@ static void qmp_query_qmp_schema(QDict *qdict, QObject **ret_data,
>   */
>  static void qmp_unregister_commands_hack(void)
>  {
> -#ifndef TARGET_I386
> -    qmp_unregister_command(&qmp_commands, "rtc-reset-reinjection");
> -#endif
>  #ifndef TARGET_S390X
>      qmp_unregister_command(&qmp_commands, "dump-skeys");
>  #endif
> @@ -4151,13 +4148,6 @@ QemuOptsList qemu_mon_opts = {
>      },
>  };
>  
> -#ifndef TARGET_I386
> -void qmp_rtc_reset_reinjection(Error **errp)
> -{
> -    error_setg(errp, QERR_FEATURE_DISABLED, "rtc-reset-reinjection");
> -}
> -#endif
> -
>  #ifndef TARGET_S390X
>  void qmp_dump_skeys(const char *filename, Error **errp)
>  {

Re: [Qemu-devel] [PATCH 22/26] qapi: make rtc-reset-reinjection depend on TARGET_I386
Posted by Marc-André Lureau 8 years, 5 months ago
Hi

On Thu, Aug 17, 2017 at 1:57 PM, Markus Armbruster <armbru@redhat.com> wrote:
> Marc-André Lureau <marcandre.lureau@redhat.com> writes:
>
>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>> ---
>>  qapi-schema.json |  3 ++-
>>  monitor.c        | 10 ----------
>>  2 files changed, 2 insertions(+), 11 deletions(-)
>>
>> diff --git a/qapi-schema.json b/qapi-schema.json
>> index 2f4528c769..2361c13fc8 100644
>> --- a/qapi-schema.json
>> +++ b/qapi-schema.json
>> @@ -6270,7 +6270,8 @@
>>  # <- { "return": {} }
>>  #
>>  ##
>> -{ 'command': 'rtc-reset-reinjection' }
>> +{ 'command': 'rtc-reset-reinjection',
>> +  'if': ['defined(NEED_CPU_H)', 'defined(TARGET_I386)'] }
>
> Aha, here' you use the list syntax.
>
> And your strategy to keep things compiling also becomes clear: you wrap
> uses of poisoned symbols like TARGET_I386 in #if defined(NEED_CPU_H).
>
> Not exactly elegant, but looks workable.  But you need to explain this
> solution in commit messages [PATCH 21, I guess] and document it in
> qapi-code-gen.txt.  *Unless* we can find a better one.

Updated doc

>
>>
>>  # Rocker ethernet network switch
>>  { 'include': 'qapi/rocker.json' }
>> diff --git a/monitor.c b/monitor.c
>> index 383c84d162..f3dafafa22 100644
>> --- a/monitor.c
>> +++ b/monitor.c
>> @@ -970,9 +970,6 @@ static void qmp_query_qmp_schema(QDict *qdict, QObject **ret_data,
>>   */
>>  static void qmp_unregister_commands_hack(void)
>>  {
>> -#ifndef TARGET_I386
>> -    qmp_unregister_command(&qmp_commands, "rtc-reset-reinjection");
>> -#endif
>>  #ifndef TARGET_S390X
>>      qmp_unregister_command(&qmp_commands, "dump-skeys");
>>  #endif
>> @@ -4151,13 +4148,6 @@ QemuOptsList qemu_mon_opts = {
>>      },
>>  };
>>
>> -#ifndef TARGET_I386
>> -void qmp_rtc_reset_reinjection(Error **errp)
>> -{
>> -    error_setg(errp, QERR_FEATURE_DISABLED, "rtc-reset-reinjection");
>> -}
>> -#endif
>> -
>>  #ifndef TARGET_S390X
>>  void qmp_dump_skeys(const char *filename, Error **errp)
>>  {
>



-- 
Marc-André Lureau