All of lore.kernel.org
 help / color / mirror / Atom feed
  • [parent not found: <1335558083-26196-7-git-send-email-mdroth@linux.vnet.ibm.com>]
  • [parent not found: <1335558083-26196-8-git-send-email-mdroth@linux.vnet.ibm.com>]
  • * Re: [Qemu-devel] [PATCH v5 0/7] add fixed-width visitors and serialization tests/fixes
           [not found] <1335558083-26196-1-git-send-email-mdroth@linux.vnet.ibm.com>
                       ` (2 preceding siblings ...)
           [not found] ` <1335558083-26196-8-git-send-email-mdroth@linux.vnet.ibm.com>
    @ 2012-05-01 22:02 ` Andreas Färber
      2012-05-11  1:22 ` Andreas Färber
                       ` (2 subsequent siblings)
      6 siblings, 0 replies; 15+ messages in thread
    From: Andreas Färber @ 2012-05-01 22:02 UTC (permalink / raw)
      To: Michael Roth; +Cc: pbonzini, aliguori, qemu-devel
    
    [-- Attachment #1: Type: text/plain, Size: 715 bytes --]
    
    Am 27.04.2012 22:21, schrieb Michael Roth:
    > These patches apply on top of qemu.git master, and can also be obtained from:
    > git://github.com/mdroth/qemu.git visitor-fixed-width-v5
    
    I've tested that branch by running some random guests without noticeable
    problems and by testing X86CPU level/xlevel simplifications on top
    (attached).
    
    NOTE: There is a v6 patch with fixed commit message hidden as reply
    within this series but there is no matching -v6 branch pushed yet.
    
    That being said, v5 series
    
    Tested-by: Andreas Färber <afaerber@suse.de>
    
    Andreas
    
    -- 
    SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
    GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
    
    [-- Warning: decoded text below may be mangled, UTF-8 assumed --]
    [-- Attachment #2: 0001-target-i386-Use-uint32-visitor-for-x-level-propertie.patch --]
    [-- Type: text/x-patch; name="0001-target-i386-Use-uint32-visitor-for-x-level-propertie.patch", Size: 3075 bytes --]
    
    >From b19a05c8dff628af5f0170cc53c8319af0074104 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de>
    Date: Tue, 1 May 2012 23:33:13 +0200
    Subject: [PATCH] target-i386: Use uint32 visitor for [x]level properties
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    
    This simplifies the code and resolves TODOs.
    
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    ---
     target-i386/cpu.c |   42 ++++--------------------------------------
     1 files changed, 4 insertions(+), 38 deletions(-)
    
    diff --git a/target-i386/cpu.c b/target-i386/cpu.c
    index 65d9af6..af8e1f3 100644
    --- a/target-i386/cpu.c
    +++ b/target-i386/cpu.c
    @@ -715,66 +715,32 @@ static void x86_cpuid_get_level(Object *obj, Visitor *v, void *opaque,
                                     const char *name, Error **errp)
     {
         X86CPU *cpu = X86_CPU(obj);
    -    int64_t value;
     
    -    value = cpu->env.cpuid_level;
    -    /* TODO Use visit_type_uint32() once available */
    -    visit_type_int(v, &value, name, errp);
    +    visit_type_uint32(v, &cpu->env.cpuid_level, name, errp);
     }
     
     static void x86_cpuid_set_level(Object *obj, Visitor *v, void *opaque,
                                     const char *name, Error **errp)
     {
         X86CPU *cpu = X86_CPU(obj);
    -    const int64_t min = 0;
    -    const int64_t max = UINT32_MAX;
    -    int64_t value;
    -
    -    /* TODO Use visit_type_uint32() once available */
    -    visit_type_int(v, &value, name, errp);
    -    if (error_is_set(errp)) {
    -        return;
    -    }
    -    if (value < min || value > max) {
    -        error_set(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE, "",
    -                  name ? name : "null", value, min, max);
    -        return;
    -    }
     
    -    cpu->env.cpuid_level = value;
    +    visit_type_uint32(v, &cpu->env.cpuid_level, name, errp);
     }
     
     static void x86_cpuid_get_xlevel(Object *obj, Visitor *v, void *opaque,
                                      const char *name, Error **errp)
     {
         X86CPU *cpu = X86_CPU(obj);
    -    int64_t value;
     
    -    value = cpu->env.cpuid_xlevel;
    -    /* TODO Use visit_type_uint32() once available */
    -    visit_type_int(v, &value, name, errp);
    +    visit_type_uint32(v, &cpu->env.cpuid_xlevel, name, errp);
     }
     
     static void x86_cpuid_set_xlevel(Object *obj, Visitor *v, void *opaque,
                                      const char *name, Error **errp)
     {
         X86CPU *cpu = X86_CPU(obj);
    -    const int64_t min = 0;
    -    const int64_t max = UINT32_MAX;
    -    int64_t value;
    -
    -    /* TODO Use visit_type_uint32() once available */
    -    visit_type_int(v, &value, name, errp);
    -    if (error_is_set(errp)) {
    -        return;
    -    }
    -    if (value < min || value > max) {
    -        error_set(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE, "",
    -                  name ? name : "null", value, min, max);
    -        return;
    -    }
     
    -    cpu->env.cpuid_xlevel = value;
    +    visit_type_uint32(v, &cpu->env.cpuid_xlevel, name, errp);
     }
     
     static char *x86_cpuid_get_vendor(Object *obj, Error **errp)
    -- 
    1.7.7
    
    
    ^ permalink raw reply related	[flat|nested] 15+ messages in thread
  • * Re: [Qemu-devel] [PATCH v5 0/7] add fixed-width visitors and serialization tests/fixes
           [not found] <1335558083-26196-1-git-send-email-mdroth@linux.vnet.ibm.com>
                       ` (3 preceding siblings ...)
      2012-05-01 22:02 ` [Qemu-devel] [PATCH v5 0/7] add fixed-width visitors and serialization tests/fixes Andreas Färber
    @ 2012-05-11  1:22 ` Andreas Färber
      2012-05-11 15:19   ` Michael Roth
           [not found] ` <1335558083-26196-3-git-send-email-mdroth@linux.vnet.ibm.com>
           [not found] ` <1335558083-26196-5-git-send-email-mdroth@linux.vnet.ibm.com>
      6 siblings, 1 reply; 15+ messages in thread
    From: Andreas Färber @ 2012-05-11  1:22 UTC (permalink / raw)
      To: Michael Roth, Luiz Capitulino
      Cc: pbonzini, aliguori, qemu-devel, Markus Armbruster
    
    Am 27.04.2012 22:21, schrieb Michael Roth:
    > These patches apply on top of qemu.git master, and can also be obtained from:
    > git://github.com/mdroth/qemu.git visitor-fixed-width-v5
    > 
    > Some of these were being carried as part of Paolo's realize series due to some
    > conflicts, but that looks to be targetted for 1.2 now, and there's a QMP
    > visitor bug and a small issue with String visitor that were caught by the test
    > infrastructure introduced here and fixed as part of this series, so I'd like to
    > get this in for 1.1
    
    Thanks, I've applied v6 to qom-next (as usual massaging the commit
    messages a bit, in particular extending the last one):
    http://repo.or.cz/w/qemu/afaerber.git/shortlog/refs/heads/qom-next
    
    Reasoning:
    This series has been around since end of February. v3 fixed a breakage
    reported by Anthony (use of signed rather than unsigned visitors); since
    then changes were mostly rebasing, and v5/v6 pass make check and my
    smoke tests.
    While this is not strictly a QOM series, I am picking it as a
    prerequisite since Paolo had picked up patches 1, 6, 7 for his Object
    properties movement and because patch 1 is handy for newly added
    properties such as of the x86 CPU.
    Further, Paolo agreed to rebase onto this series.
    
    However, it is my understanding that patches 2 and 4 are independent
    bugfixes and as such should go into 1.1.
    
    Luiz, should I send Anthony a PULL for 1.1-rc2 including those two? Can
    you ack then? Or do you want to cherry-pick them from qom-next yourself?
    
    Andreas
    
    > CHANGES SINCE v4:
    >  - Rebased on master (a8b69b8e2431edfcb6c4cfb069787e9071d6235b) and re-tested
    >  - Re-ordered patches so visitor bugs are applied before the test cases that
    >    that trigger them.
    > 
    > CHANGES SINCE V3:
    >  - Rebased on master and re-tested
    > 
    > CHANGES SINCE V2:
    >  - Fix qemu-test errors due to now-strict bounds-checking we doing assignment
    >    between signed/unsigned types.
    >  - uint* property getters/setters no longer use int* getters/setters.
    >  - valid devfn range is now explicitly enforced.
    > 
    > CHANGES SINCE V1:
    >  - unit tests: covert QmpOutputVisitor qobject to json before passing it to
    >    QmpInputVisitor*. I.e., actually do the serialization :)
    >  - QmpInputVisitor, add handling for when a serialized QFloat gets read back
    >    as a QInt
    >  - unit tests: add coverage for String visitor
    >  - StringOutputVisitor: use %f for float representation
    > 
    > These patches add fixed-width visitor interfaces and switches all qdev users
    > over to using them.
    > 
    > We also add a test suite which covers these interfaces, and also does some
    > sanity checking on Visitors (Qmp/String currently, with a pluggable interface
    > for future implementations) to ensure Visitor input/output handling remain
    > self-consistent, which is not covered by the current visitor tests which mostly
    > test input/output seperately. Maintaining this invariant is necessary to ensure
    > that visitors can be used for serialization/deserialization in the future.
    > 
    >  hw/mc146818rtc.c                   |    7 -
    >  hw/pci.c                           |    2 +-
    >  hw/pci.h                           |    2 +-
    >  hw/qdev-addr.c                     |    4 +-
    >  hw/qdev-properties.c               |  161 +++++---
    >  hw/qdev.h                          |    2 +-
    >  qapi/qapi-visit-core.c             |  139 +++++++
    >  qapi/qapi-visit-core.h             |   16 +
    >  qapi/qmp-input-visitor.c           |    9 +-
    >  qapi/string-output-visitor.c       |    2 +-
    >  tests/Makefile                     |    4 +-
    >  tests/test-string-output-visitor.c |    2 +-
    >  tests/test-visitor-serialization.c |  784 ++++++++++++++++++++++++++++++++++++
    >  13 files changed, 1049 insertions(+), 85 deletions(-)
    
    -- 
    SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
    GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
    
    ^ permalink raw reply	[flat|nested] 15+ messages in thread
  • [parent not found: <1335558083-26196-3-git-send-email-mdroth@linux.vnet.ibm.com>]
  • [parent not found: <1335558083-26196-5-git-send-email-mdroth@linux.vnet.ibm.com>]
  • * [Qemu-devel] [PATCH v4 0/7] add fixed-width visitors and serialization tests
    @ 2012-03-28 23:02 Michael Roth
      2012-03-28 23:02 ` [Qemu-devel] [PATCH 7/7] qdev: switch property accessors to fixed-width visitor interfaces Michael Roth
      0 siblings, 1 reply; 15+ messages in thread
    From: Michael Roth @ 2012-03-28 23:02 UTC (permalink / raw)
      To: qemu-devel; +Cc: pbonzini, aliguori
    
    These patches apply on top of qemu.git master, and can also be obtained from:
    git://github.com/mdroth/qemu.git visitor-fixed-width-v4
    
    CHANGES SINCE V3:
     - Rebased on master and re-tested
    
    CHANGES SINCE V2:
     - Fix qemu-test errors due to now-strict bounds-checking we doing assignment
       between signed/unsigned types.
     - uint* property getters/setters no longer use int* getters/setters.
     - valid devfn range is now explicitly enforced.
    
    CHANGES SINCE V1:
     - unit tests: covert QmpOutputVisitor qobject to json before passing it to
       QmpInputVisitor*. I.e., actually do the serialization :)
     - QmpInputVisitor, add handling for when a serialized QFloat gets read back
       as a QInt
     - unit tests: add coverage for String visitor
     - StringOutputVisitor: use %f for float representation
    
    These patches add fixed-width visitor interfaces and switches all qdev users
    over to using them.
    
    We also add a test suite which covers these interfaces, and also does some
    sanity checking on Visitors (Qmp/String currently, with a pluggable interface
    for future implementations) to ensure Visitor input/output handling remain
    self-consistent, which is not covered by the current visitor tests which mostly
    test input/output seperately. Maintaining this invariant is necessary to ensure
    that visitors can be used for serialization/deserialization in the future.
    
     hw/mc146818rtc.c             |    7 -
     hw/pci.c                     |    2 +-
     hw/pci.h                     |    2 +-
     hw/qdev-addr.c               |    4 +-
     hw/qdev-properties.c         |  151 +++++----
     hw/qdev.h                    |    2 +-
     qapi/qapi-visit-core.c       |  139 ++++++++
     qapi/qapi-visit-core.h       |   16 +
     qapi/qmp-input-visitor.c     |    9 +-
     qapi/string-output-visitor.c |    2 +-
     test-string-output-visitor.c |    2 +-
     test-visitor-serialization.c |  784 ++++++++++++++++++++++++++++++++++++++++++
     tests/Makefile               |    6 +-
     13 files changed, 1047 insertions(+), 79 deletions(-)
    
    ^ permalink raw reply	[flat|nested] 15+ messages in thread

    end of thread, other threads:[~2012-05-11 18:30 UTC | newest]
    
    Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
    -- links below jump to the message on this page --
         [not found] <1335558083-26196-1-git-send-email-mdroth@linux.vnet.ibm.com>
         [not found] ` <1335558083-26196-2-git-send-email-mdroth@linux.vnet.ibm.com>
    2012-05-01 21:37   ` [Qemu-devel] [PATCH 1/7] qapi: add Visitor interfaces for uint*_t and int*_t Andreas Färber
         [not found] ` <1335558083-26196-7-git-send-email-mdroth@linux.vnet.ibm.com>
    2012-05-01 21:52   ` [Qemu-devel] [PATCH 6/7] qdev: use int32_t container for devfn property Andreas Färber
         [not found] ` <1335558083-26196-8-git-send-email-mdroth@linux.vnet.ibm.com>
    2012-05-01 21:54   ` [Qemu-devel] [PATCH 7/7] qdev: switch property accessors to fixed-width visitor interfaces Andreas Färber
    2012-05-01 22:02 ` [Qemu-devel] [PATCH v5 0/7] add fixed-width visitors and serialization tests/fixes Andreas Färber
    2012-05-11  1:22 ` Andreas Färber
    2012-05-11 15:19   ` Michael Roth
         [not found] ` <1335558083-26196-3-git-send-email-mdroth@linux.vnet.ibm.com>
    2012-05-11 16:22   ` [Qemu-devel] [PATCH 2/7] qapi: QMP input visitor, handle floats parsed as ints Luiz Capitulino
    2012-05-11 17:04     ` Michael Roth
    2012-05-11 17:16       ` Andreas Färber
    2012-05-11 17:34         ` Michael Roth
    2012-05-11 17:38       ` Luiz Capitulino
         [not found] ` <1335558083-26196-5-git-send-email-mdroth@linux.vnet.ibm.com>
    2012-05-11 16:34   ` [Qemu-devel] [PATCH 4/7] qapi: String visitor, use %f represenation for floats Luiz Capitulino
    2012-05-11 17:32     ` Michael Roth
    2012-05-11 17:47       ` Andreas Färber
    2012-03-28 23:02 [Qemu-devel] [PATCH v4 0/7] add fixed-width visitors and serialization tests Michael Roth
    2012-03-28 23:02 ` [Qemu-devel] [PATCH 7/7] qdev: switch property accessors to fixed-width visitor interfaces Michael Roth
    

    This is an external index of several public inboxes,
    see mirroring instructions on how to clone and mirror
    all data and code used by this external index.