From b16352acf3105000e14f194b556e159d5d06cff9 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Mon, 4 Mar 2013 18:41:28 +0200 Subject: ccid-card-passthru, dev-smartcard-reader: add debug environment variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduces a new utility function: parse_debug_env to avoid code duplication. This overrides whatever debug value is set on the corresponding devices from the command line, and is meant to ease the usage with any management stack. For libvirt you can set environment variables by extending the dom namespace, i.e: Signed-off-by: Alon Levy Reviewed-by: Marc-André Lureau --- hw/usb/ccid-card-passthru.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'hw/usb/ccid-card-passthru.c') diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c index 16d51c9295..01c7e6f20d 100644 --- a/hw/usb/ccid-card-passthru.c +++ b/hw/usb/ccid-card-passthru.c @@ -350,6 +350,8 @@ static int passthru_initfn(CCIDCardState *base) error_report("missing chardev"); return -1; } + card->debug = parse_debug_env("QEMU_CCID_PASSTHRU_DEBUG", D_VERBOSE, + card->debug); assert(sizeof(DEFAULT_ATR) <= MAX_ATR_SIZE); memcpy(card->atr, DEFAULT_ATR, sizeof(DEFAULT_ATR)); card->atr_length = sizeof(DEFAULT_ATR); -- cgit v1.2.1