From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>
Subject: [PULL 2/6] usb-storage: add commandlog property
Date: Mon, 16 Nov 2020 12:10:32 +0100 [thread overview]
Message-ID: <20201116111036.12820-3-kraxel@redhat.com> (raw)
In-Reply-To: <20201116111036.12820-1-kraxel@redhat.com>
Add property so scsi command logging can be switched
at runtime instead of compile time.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201105134112.25119-3-kraxel@redhat.com
---
hw/usb/dev-storage.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
index e317cde8fd48..d5cc6137443c 100644
--- a/hw/usb/dev-storage.c
+++ b/hw/usb/dev-storage.c
@@ -25,8 +25,6 @@
#include "qom/object.h"
#include "trace.h"
-//#define DEBUG_MSD
-
/* USB requests. */
#define MassStorageReset 0xff
#define GetMaxLun 0xfe
@@ -59,6 +57,7 @@ struct MSDState {
/* usb-storage only */
BlockConf conf;
uint32_t removable;
+ bool commandlog;
SCSIDevice *scsi_dev;
};
typedef struct MSDState MSDState;
@@ -451,9 +450,9 @@ static void usb_msd_handle_data(USBDevice *dev, USBPacket *p)
assert(le32_to_cpu(s->csw.residue) == 0);
s->scsi_len = 0;
s->req = scsi_req_new(scsi_dev, tag, cbw.lun, cbw.cmd, NULL);
-#ifdef DEBUG_MSD
- scsi_req_print(s->req);
-#endif
+ if (s->commandlog) {
+ scsi_req_print(s->req);
+ }
len = scsi_req_enqueue(s->req);
if (len) {
scsi_req_continue(s->req);
@@ -684,6 +683,7 @@ static Property msd_properties[] = {
DEFINE_BLOCK_PROPERTIES(MSDState, conf),
DEFINE_BLOCK_ERROR_PROPERTIES(MSDState, conf),
DEFINE_PROP_BIT("removable", MSDState, removable, 0, false),
+ DEFINE_PROP_BOOL("commandlog", MSDState, commandlog, false),
DEFINE_PROP_END_OF_LIST(),
};
--
2.27.0
next prev parent reply other threads:[~2020-11-16 11:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-16 11:10 [PULL 0/6] Fixes 20201116 patches Gerd Hoffmann
2020-11-16 11:10 ` [PULL 1/6] usb-storage: switch trace events Gerd Hoffmann
2020-11-16 11:10 ` Gerd Hoffmann [this message]
2020-11-16 11:10 ` [PULL 3/6] usb-storage: use bool for removable property Gerd Hoffmann
2020-11-16 11:10 ` [PULL 4/6] usb-storage: fill csw on cancel Gerd Hoffmann
2020-11-16 11:10 ` [PULL 5/6] xhci: fix guest triggerable assert Gerd Hoffmann
2020-11-16 11:10 ` [PULL 6/6] xhci: move sanity checks Gerd Hoffmann
2020-11-16 15:32 ` [PULL 0/6] Fixes 20201116 patches Peter Maydell
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=20201116111036.12820-3-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).