All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: Eduardo Habkost <ehabkost@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Thomas Huth <thuth@redhat.com>,
	qemu-devel@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 3/7] usb-ccid: convert CCIDCardClass::init -> realize
Date: Wed, 31 Jan 2018 14:43:34 +0100	[thread overview]
Message-ID: <87wozy3zzt.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20180122120351.22369-4-f4bug@amsat.org> ("Philippe Mathieu-Daudé"'s message of "Mon, 22 Jan 2018 09:03:47 -0300")

Philippe Mathieu-Daudé <f4bug@amsat.org> writes:

> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/usb/ccid.h                 |  9 +++++--
>  hw/usb/ccid-card-emulated.c   | 45 ++++++++++++++++++----------------
>  hw/usb/ccid-card-passthru.c   | 10 ++++----
>  hw/usb/dev-smartcard-reader.c | 57 +++++++++++++++----------------------------
>  4 files changed, 56 insertions(+), 65 deletions(-)
>
[...]
> diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c
> index e646eb243b..a2b608a953 100644
> --- a/hw/usb/ccid-card-emulated.c
> +++ b/hw/usb/ccid-card-emulated.c
> @@ -27,6 +27,7 @@
>   */
>  
>  #include "qemu/osdep.h"
> +#include "qapi/error.h"
>  #include <eventt.h>
>  #include <vevent.h>
>  #include <vreader.h>
> @@ -480,7 +481,7 @@ static uint32_t parse_enumeration(char *str,
>      return ret;
>  }
>  
> -static int emulated_initfn(CCIDCardState *base)
> +static void emulated_realize(CCIDCardState *base, Error **errp)
>  {
>      EmulatedState *card = EMULATED_CCID_CARD(base);
>      VCardEmulError ret;
> @@ -495,7 +496,8 @@ static int emulated_initfn(CCIDCardState *base)
>      card->reader = NULL;
>      card->quit_apdu_thread = 0;
>      if (init_event_notifier(card) < 0) {
> -        return -1;
> +        error_setg(errp, TYPE_EMULATED_CCID ": event notifier creation failed");
> +        return;
>      }
>  
>      card->backend = 0;
> @@ -505,11 +507,12 @@ static int emulated_initfn(CCIDCardState *base)
>      }
>  
>      if (card->backend == 0) {
> -        printf("backend must be one of:\n");
> +        error_setg(errp, TYPE_EMULATED_CCID ": no backend specified.");

No period at end of error_setg() messages, please.  More of the same below.

> +        error_append_hint(errp, "backend must be one of:\n");
>          for (ptable = backend_enum_table; ptable->name != NULL; ++ptable) {
> -            printf("%s\n", ptable->name);
> +            error_append_hint(errp, "%s\n", ptable->name);
>          }
> -        return -1;
> +        return;
>      }
>  
>      /* TODO: a passthru backened that works on local machine. third card type?*/
[...]

  parent reply	other threads:[~2018-01-31 13:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-22 12:03 [Qemu-devel] [PATCH v2 0/7] qdev: remove DeviceClass::init/exit() Philippe Mathieu-Daudé
2018-01-22 12:03 ` [Qemu-devel] [PATCH v2 1/7] hw/i2c/smbus: use DeviceClass::realize instead of SMBusDeviceClass::init Philippe Mathieu-Daudé
2018-01-22 12:03 ` [Qemu-devel] [PATCH v2 2/7] hw/i2c: use DeviceClass::realize instead of I2CSlaveClass::init Philippe Mathieu-Daudé
2018-01-22 12:03 ` [Qemu-devel] [PATCH v2 3/7] usb-ccid: convert CCIDCardClass::init -> realize Philippe Mathieu-Daudé
2018-01-25 15:25   ` Gerd Hoffmann
2018-01-31 13:43   ` Markus Armbruster [this message]
2018-01-22 12:03 ` [Qemu-devel] [PATCH v2 4/7] virtio-ccw: convert VirtIOCCWDeviceClass::exit -> unrealize Philippe Mathieu-Daudé
2018-01-22 12:03 ` [Qemu-devel] [PATCH v2 5/7] qdev: simplify the SysBusDeviceClass::init path Philippe Mathieu-Daudé
2018-01-22 12:03 ` [Qemu-devel] [PATCH v2 6/7] qdev: remove DeviceClass::exit Philippe Mathieu-Daudé
2018-01-22 12:03 ` [Qemu-devel] [PATCH v2 7/7] qdev: rename typedef qdev_resetfn() -> DeviceReset() Philippe Mathieu-Daudé
2018-01-31 13:42 ` [Qemu-devel] [PATCH v2 0/7] qdev: remove DeviceClass::init/exit() Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wozy3zzt.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=kraxel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.