Hello community,

here is the log from the commit of package cdemu-daemon for openSUSE:Factory 
checked in at 2019-10-24 23:10:37
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/cdemu-daemon (Old)
 and      /work/SRC/openSUSE:Factory/.cdemu-daemon.new.2990 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "cdemu-daemon"

Thu Oct 24 23:10:37 2019 rev:23 rq:742516 version:3.2.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/cdemu-daemon/cdemu-daemon.changes        
2019-07-11 13:18:55.986757191 +0200
+++ /work/SRC/openSUSE:Factory/.cdemu-daemon.new.2990/cdemu-daemon.changes      
2019-10-24 23:10:47.420636161 +0200
@@ -1,0 +2,6 @@
+Thu Oct 24 10:56:39 UTC 2019 - Jan Engelhardt <[email protected]>
+
+- Update to release 3.2.3
+  * Updated the list of MMC commands that interrupt audio play.
+
+-------------------------------------------------------------------

Old:
----
  cdemu-daemon-3.2.1.tar.bz2

New:
----
  cdemu-daemon-3.2.3.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ cdemu-daemon.spec ++++++
--- /var/tmp/diff_new_pack.kw6bB9/_old  2019-10-24 23:10:48.692637646 +0200
+++ /var/tmp/diff_new_pack.kw6bB9/_new  2019-10-24 23:10:48.696637650 +0200
@@ -22,7 +22,7 @@
 %endif
 
 Name:           cdemu-daemon
-Version:        3.2.1
+Version:        3.2.3
 Release:        0
 Summary:        Device daemon for cdemu, a virtual CD-ROM device emulator
 License:        GPL-2.0-or-later

++++++ cdemu-daemon-3.2.1.tar.bz2 -> cdemu-daemon-3.2.3.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cdemu-daemon-3.2.1/CMakeLists.txt 
new/cdemu-daemon-3.2.3/CMakeLists.txt
--- old/cdemu-daemon-3.2.1/CMakeLists.txt       2018-07-08 13:12:55.000000000 
+0200
+++ new/cdemu-daemon-3.2.3/CMakeLists.txt       2019-08-27 17:24:39.000000000 
+0200
@@ -7,7 +7,7 @@
 list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
 
 # Versioning
-set (CDEMU_DAEMON_VERSION 3.2.1)
+set (CDEMU_DAEMON_VERSION 3.2.3)
 set (CDEMU_DAEMON_INTERFACE_VERSION_MAJOR 7)
 set (CDEMU_DAEMON_INTERFACE_VERSION_MINOR 0)
 
@@ -29,7 +29,7 @@
 find_package (Gettext 0.15 REQUIRED)
 
 pkg_check_modules (LIBMIRAGE REQUIRED libmirage>=3.2.0)
-pkg_check_modules (GLIB REQUIRED glib-2.0>=2.30 gobject-2.0>=2.30 
gmodule-2.0>=2.30 gthread-2.0>=2.30 gio-2.0>=2.30)
+pkg_check_modules (GLIB REQUIRED glib-2.0>=2.38 gobject-2.0>=2.38 
gmodule-2.0>=2.38 gthread-2.0>=2.38 gio-2.0>=2.38)
 pkg_check_modules (AO REQUIRED ao>=0.8.0)
 
 # Auto-generated files
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cdemu-daemon-3.2.1/README 
new/cdemu-daemon-3.2.3/README
--- old/cdemu-daemon-3.2.1/README       2018-07-08 13:12:55.000000000 +0200
+++ new/cdemu-daemon-3.2.3/README       2019-08-27 17:24:39.000000000 +0200
@@ -1,5 +1,5 @@
 CDEmu Daemon
-3.2.1
+3.2.3
 ~~~~~
 
 
@@ -116,7 +116,7 @@
 CDEmu daemon has the following software requirements:
 
  - CMake >= 2.8.5
- - GLib >= 2.30
+ - GLib >= 2.38
  - libao >= 0.8.0
 
  - libMirage >= 3.2.0 (part of the suite)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cdemu-daemon-3.2.1/debian/changelog 
new/cdemu-daemon-3.2.3/debian/changelog
--- old/cdemu-daemon-3.2.1/debian/changelog     2018-07-08 13:12:55.000000000 
+0200
+++ new/cdemu-daemon-3.2.3/debian/changelog     2019-08-27 17:24:39.000000000 
+0200
@@ -1,3 +1,3 @@
-cdemu-daemon (3.2.1-1) debian; urgency=low
+cdemu-daemon (3.2.3-1) debian; urgency=low
   * Initial Release. Closes: #705409
  -- Henrik Stokseth <[email protected]>  Sat, 05 Apr 2014 
12:00:00 +0100
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cdemu-daemon-3.2.1/debian/control 
new/cdemu-daemon-3.2.3/debian/control
--- old/cdemu-daemon-3.2.1/debian/control       2018-07-08 13:12:55.000000000 
+0200
+++ new/cdemu-daemon-3.2.3/debian/control       2019-08-27 17:24:39.000000000 
+0200
@@ -5,15 +5,15 @@
 Maintainer: Henrik Stokseth <[email protected]>
 Build-Depends: libglib2.0-dev (>= 2.30), libao-dev (>= 0.8.0),
  libmirage11-dev (>= 3.2.0), debhelper (>= 9), intltool,
- cmake (>= 2.8.5)
-Standards-Version: 3.9.7
+ cmake (>= 2.8.5), ninja-build
+Standards-Version: 4.3.0
 
 
 Package: cdemu-daemon
 Section: misc
 Architecture: any
 Depends: vhba-dkms (>= 20170610), ${shlibs:Depends}, ${misc:Depends}
-Description: CDEmu daemon
+Description: Main CDEmu daemon
  This is CDEmu daemon, the daemon part of the CDEmu suite,
  a free, GPL CD/DVD-ROM device emulator for Linux.
  .
@@ -31,8 +31,8 @@
 Package: cdemu-daemon-dbg
 Section: debug
 Architecture: any
-Priority: extra
+Priority: optional
 Depends: cdemu-daemon (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
-Description: CDEmu daemon (debugging symbols)
+Description: Main CDEmu daemon (debugging symbols)
  This package provides detached debugging symbols.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cdemu-daemon-3.2.1/debian/rules 
new/cdemu-daemon-3.2.3/debian/rules
--- old/cdemu-daemon-3.2.1/debian/rules 2018-07-08 13:12:55.000000000 +0200
+++ new/cdemu-daemon-3.2.3/debian/rules 2019-08-27 17:24:39.000000000 +0200
@@ -5,6 +5,11 @@
 #export DH_VERBOSE=1
 
 
+override_dh_auto_configure:
+       dh_auto_configure -- -G Ninja
+
+override_dh_auto_test:
+
 override_dh_strip:
        dh_strip --dbg-package="cdemu-daemon-dbg"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cdemu-daemon-3.2.1/man/cdemu-daemon.8 
new/cdemu-daemon-3.2.3/man/cdemu-daemon.8
--- old/cdemu-daemon-3.2.1/man/cdemu-daemon.8   2018-07-08 13:12:55.000000000 
+0200
+++ new/cdemu-daemon-3.2.3/man/cdemu-daemon.8   2019-08-27 17:24:39.000000000 
+0200
@@ -5,13 +5,13 @@
 .B cdemu-daemon
 [options]
 .SH DESCRIPTION
-This is CDEmu daemon, the userspace daemon part of the userspace-cdemu suite, a
+This is CDEmu daemon, the userspace part of the cdemu suite, a
 free, GPL CD/DVD-ROM device emulator for linux.
 
 It receives SCSI commands from kernel module and processes them, passing the
 requested data back to the kernel. Daemon implements the actual virtual device;
 one instance per each device registered by kernel module. It uses libMirage, an
-image access library that is part of userspace-cdemu suite, for the image 
access
+image access library that is part of the cdemu suite, for the image access
 (e.g. sector reading).
 
 The daemon registers itself on D-BUS' system or session bus (depending on the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cdemu-daemon-3.2.1/src/audio-private.h 
new/cdemu-daemon-3.2.3/src/audio-private.h
--- old/cdemu-daemon-3.2.1/src/audio-private.h  2018-07-08 13:12:55.000000000 
+0200
+++ new/cdemu-daemon-3.2.3/src/audio-private.h  2019-08-27 17:24:39.000000000 
+0200
@@ -20,8 +20,6 @@
 #ifndef __CDEMU_AUDIO_PRIVATE_H__
 #define __CDEMU_AUDIO_PRIVATE_H__
 
-#define CDEMU_AUDIO_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), 
CDEMU_TYPE_AUDIO, CdemuAudioPrivate))
-
 struct _CdemuAudioPrivate
 {
     /* Thread */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cdemu-daemon-3.2.1/src/audio.c 
new/cdemu-daemon-3.2.3/src/audio.c
--- old/cdemu-daemon-3.2.1/src/audio.c  2018-07-08 13:12:55.000000000 +0200
+++ new/cdemu-daemon-3.2.3/src/audio.c  2019-08-27 17:24:39.000000000 +0200
@@ -307,11 +307,11 @@
 /**********************************************************************\
  *                             Object init                            *
 \**********************************************************************/
-G_DEFINE_TYPE(CdemuAudio, cdemu_audio, MIRAGE_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_PRIVATE(CdemuAudio, cdemu_audio, MIRAGE_TYPE_OBJECT)
 
 static void cdemu_audio_init (CdemuAudio *self)
 {
-    self->priv = CDEMU_AUDIO_GET_PRIVATE(self);
+    self->priv = cdemu_audio_get_instance_private(self);
 
     self->priv->playback_thread = NULL;
     self->priv->device = NULL;
@@ -335,8 +335,4 @@
     GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
 
     gobject_class->finalize = cdemu_audio_finalize;
-
-    /* Register private structure */
-    g_type_class_add_private(klass, sizeof(CdemuAudioPrivate));
 }
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cdemu-daemon-3.2.1/src/daemon-private.h 
new/cdemu-daemon-3.2.3/src/daemon-private.h
--- old/cdemu-daemon-3.2.1/src/daemon-private.h 2018-07-08 13:12:55.000000000 
+0200
+++ new/cdemu-daemon-3.2.3/src/daemon-private.h 2019-08-27 17:24:39.000000000 
+0200
@@ -20,8 +20,6 @@
 #ifndef __CDEMU_DAEMON_PRIVATE_H__
 #define __CDEMU_DAEMON_PRIVATE_H__
 
-#define CDEMU_DAEMON_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), 
CDEMU_TYPE_DAEMON, CdemuDaemonPrivate))
-
 struct _CdemuDaemonPrivate
 {
     gchar *version;
@@ -32,6 +30,9 @@
     gchar *ctl_device;
     gchar *audio_driver;
 
+    guint cdemu_debug_mask; /* Default debug mask for CDEmu devices */
+    guint mirage_debug_mask; /* Default debug mask for underlying libMirage 
context */
+
     /* Devices */
     GList *devices;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cdemu-daemon-3.2.1/src/daemon.c 
new/cdemu-daemon-3.2.3/src/daemon.c
--- old/cdemu-daemon-3.2.1/src/daemon.c 2018-07-08 13:12:55.000000000 +0200
+++ new/cdemu-daemon-3.2.3/src/daemon.c 2019-08-27 17:24:39.000000000 +0200
@@ -91,7 +91,7 @@
 
/******************************************************************************\
  *                                 Public API                                 *
 
\******************************************************************************/
-gboolean cdemu_daemon_initialize_and_start (CdemuDaemon *self, gint 
num_devices, gchar *ctl_device, gchar *audio_driver, gboolean system_bus)
+gboolean cdemu_daemon_initialize_and_start (CdemuDaemon *self, gint 
num_devices, gchar *ctl_device, gchar *audio_driver, gboolean system_bus, guint 
cdemu_debug_mask, guint mirage_debug_mask)
 {
     MirageContext *context;
     GBusType bus_type = system_bus ? G_BUS_TYPE_SYSTEM : G_BUS_TYPE_SESSION;
@@ -99,6 +99,9 @@
     self->priv->ctl_device = g_strdup(ctl_device);
     self->priv->audio_driver = g_strdup(audio_driver);
 
+    self->priv->cdemu_debug_mask = cdemu_debug_mask;
+    self->priv->mirage_debug_mask = mirage_debug_mask;
+
     /* Create a MirageContext and use it as debug context */
     context = g_object_new(MIRAGE_TYPE_CONTEXT, NULL);
     mirage_context_set_debug_name(context, "cdemu");
@@ -160,7 +163,7 @@
 
     /* Create and initialize device object */
     device = g_object_new(CDEMU_TYPE_DEVICE, NULL);
-    if (!cdemu_device_initialize(device, device_number, 
self->priv->audio_driver)) {
+    if (!cdemu_device_initialize(device, device_number, 
self->priv->audio_driver, self->priv->cdemu_debug_mask, 
self->priv->mirage_debug_mask)) {
         CDEMU_DEBUG(self, DAEMON_DEBUG_WARNING, "%s: failed to initialize 
device #%i\n", __debug__, device_number);
         g_object_unref(device);
         return FALSE;
@@ -225,17 +228,20 @@
 /**********************************************************************\
  *                             Object init                            *
 \**********************************************************************/
-G_DEFINE_TYPE(CdemuDaemon, cdemu_daemon, MIRAGE_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_PRIVATE(CdemuDaemon, cdemu_daemon, MIRAGE_TYPE_OBJECT)
 
 static void cdemu_daemon_init (CdemuDaemon *self)
 {
-    self->priv = CDEMU_DAEMON_GET_PRIVATE(self);
+    self->priv = cdemu_daemon_get_instance_private(self);
 
     self->priv->main_loop = NULL;
     self->priv->devices = NULL;
     self->priv->ctl_device = NULL;
     self->priv->audio_driver = NULL;
 
+    self->priv->cdemu_debug_mask = 0;
+    self->priv->mirage_debug_mask = 0;
+
     /* Set version string */
     self->priv->version = g_strdup(CDEMU_DAEMON_VERSION);
 
@@ -290,7 +296,4 @@
 
     gobject_class->dispose = cdemu_daemon_dispose;
     gobject_class->finalize = cdemu_daemon_finalize;
-
-    /* Register private structure */
-    g_type_class_add_private(klass, sizeof(CdemuDaemonPrivate));
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cdemu-daemon-3.2.1/src/daemon.h 
new/cdemu-daemon-3.2.3/src/daemon.h
--- old/cdemu-daemon-3.2.1/src/daemon.h 2018-07-08 13:12:55.000000000 +0200
+++ new/cdemu-daemon-3.2.3/src/daemon.h 2019-08-27 17:24:39.000000000 +0200
@@ -54,7 +54,7 @@
 GType cdemu_daemon_get_type (void);
 
 /* Public API */
-gboolean cdemu_daemon_initialize_and_start (CdemuDaemon *self, gint 
num_devices, gchar *ctl_device, gchar *audio_driver, gboolean system_bus);
+gboolean cdemu_daemon_initialize_and_start (CdemuDaemon *self, gint 
num_devices, gchar *ctl_device, gchar *audio_driver, gboolean system_bus, guint 
cdemu_debug_mask, guint mirage_debug_mask);
 void cdemu_daemon_stop_daemon (CdemuDaemon *self);
 CdemuDevice *cdemu_daemon_get_device (CdemuDaemon *self, gint device_number, 
GError **error);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cdemu-daemon-3.2.1/src/device-commands.c 
new/cdemu-daemon-3.2.3/src/device-commands.c
--- old/cdemu-daemon-3.2.1/src/device-commands.c        2018-07-08 
13:12:55.000000000 +0200
+++ new/cdemu-daemon-3.2.3/src/device-commands.c        2019-08-27 
17:24:39.000000000 +0200
@@ -561,6 +561,63 @@
 }
 
 /* INQUIRY*/
+static gboolean command_inquiry_vpd (CdemuDevice *self, const struct 
INQUIRY_CDB *cdb)
+{
+    switch (cdb->page_code) {
+        case 0x00: {
+            /* Supported VPD pages */
+            struct INQUIRY_VPD_Header *ret_header = (struct INQUIRY_VPD_Header 
*)self->priv->buffer;
+            self->priv->buffer_size = sizeof(struct INQUIRY_VPD_Header);
+            ret_header->per_dev = 0x05; /* CD-ROM device */
+            ret_header->page_code = 0; /* Page 0x00: Supported VPD pages */
+            ret_header->page_length = 0;
+
+            /* List the pages */
+            gint num_pages = 0;
+            guint8 *ret_list = (guint8 *)(ret_header + 1);
+
+            ret_list[num_pages++] = 0x00; /* Supported VPD pages (mandatory) */
+            ret_list[num_pages++] = 0x80; /* Unit serial number (optional) */
+            /*ret_list[num_pages++] = 0x83;*/ /* Device identification 
(mandatory) */
+
+            /* Modify reported length */
+            self->priv->buffer_size += num_pages;
+            ret_header->page_length = num_pages;
+
+            break;
+        }
+        case 0x80: {
+            /* Serial number */
+            struct INQUIRY_VPD_Header *ret_header = (struct INQUIRY_VPD_Header 
*)self->priv->buffer;
+            self->priv->buffer_size = sizeof(struct INQUIRY_VPD_Header);
+            ret_header->per_dev = 0x05; /* CD-ROM device */
+            ret_header->page_code = 0x80; /* Page 0x80: Serial number */
+            ret_header->page_length = 0;
+
+            /* Serial number */
+            gchar *ret_serial = (gchar *)(ret_header + 1);
+            gint serial_len = g_sprintf(ret_serial, "CDEMU%03d", 
self->priv->number);
+
+            /* Modify reported length */
+            self->priv->buffer_size += serial_len;
+            ret_header->page_length += serial_len;
+            break;
+        }
+        default: {
+            /* Unsupported; as stated in SPC, return CHECK CONDITION,
+               ILLEGAL REQUEST and INVALID FIELD IN CDB */
+            CDEMU_DEBUG(self, DAEMON_DEBUG_WARNING, "%s: VPD page %02Xh not 
implemented!\n", __debug__, cdb->page_code);
+            cdemu_device_write_sense(self, ILLEGAL_REQUEST, 
INVALID_FIELD_IN_CDB);
+            return FALSE;
+        }
+    }
+
+    /* Write data */
+    cdemu_device_write_buffer(self, GUINT16_FROM_BE(cdb->length));
+
+    return TRUE;
+}
+
 static gboolean command_inquiry (CdemuDevice *self, const guint8 *raw_cdb)
 {
     struct INQUIRY_CDB *cdb = (struct INQUIRY_CDB *)raw_cdb;
@@ -568,14 +625,20 @@
     struct INQUIRY_Data *ret_data = (struct INQUIRY_Data *)self->priv->buffer;
     self->priv->buffer_size = sizeof(struct INQUIRY_Data);
 
-    if (cdb->evpd || cdb->page_code) {
-        /* We don't support either; so as stated in SPC, return CHECK 
CONDITION,
-           ILLEGAL REQUEST and INVALID FIELD IN CDB */
-        CDEMU_DEBUG(self, DAEMON_DEBUG_MMC, "%s: invalid field in CDB\n", 
__debug__);
+    CDEMU_DEBUG(self, DAEMON_DEBUG_MMC, "%s: INQUIRY: EVPD=%d, PAGE 
CODE=02%Xh)\n", __debug__, cdb->evpd, cdb->page_code);
+
+    /* Non-zero page code and zero EVPD is illegal as per SPC */
+    if (!cdb->evpd && cdb->page_code) {
+        CDEMU_DEBUG(self, DAEMON_DEBUG_MMC, "%s: invalid field in CDB (EVPD=0 
and non-zero PAGE CODE is illegal)\n", __debug__);
         cdemu_device_write_sense(self, ILLEGAL_REQUEST, INVALID_FIELD_IN_CDB);
         return FALSE;
     }
 
+    /* Vital product data */
+    if (cdb->evpd) {
+        return command_inquiry_vpd(self, cdb);
+    }
+
     /* Values here are more or less what my DVD-ROM drive gives me
        (and in accord with INF8090) */
     ret_data->per_dev = 0x05; /* CD-ROM device */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cdemu-daemon-3.2.1/src/device-private.h 
new/cdemu-daemon-3.2.3/src/device-private.h
--- old/cdemu-daemon-3.2.1/src/device-private.h 2018-07-08 13:12:55.000000000 
+0200
+++ new/cdemu-daemon-3.2.3/src/device-private.h 2019-08-27 17:24:39.000000000 
+0200
@@ -20,8 +20,6 @@
 #ifndef __CDEMU_DEVICE_PRIVATE_H__
 #define __CDEMU_DEVICE_PRIVATE_H__
 
-#define CDEMU_DEVICE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), 
CDEMU_TYPE_DEVICE, CdemuDevicePrivate))
-
 struct _CdemuCommand
 {
     guint8 cdb[12];
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cdemu-daemon-3.2.1/src/device-recording.c 
new/cdemu-daemon-3.2.3/src/device-recording.c
--- old/cdemu-daemon-3.2.1/src/device-recording.c       2018-07-08 
13:12:55.000000000 +0200
+++ new/cdemu-daemon-3.2.3/src/device-recording.c       2019-08-27 
17:24:39.000000000 +0200
@@ -346,7 +346,7 @@
 
     /* If there is no opened track, open one */
     if (!self->priv->open_track) {
-        CDEMU_DEBUG(self, DAEMON_DEBUG_RECORDING, "%s: no track opened; 
opening one!\n", __debug__);
+        CDEMU_DEBUG(self, DAEMON_DEBUG_RECORDING, "%s: no track opened; 
opening one (sector type: %d)!\n", __debug__, 
mirage_sector_get_sector_type(sector));
 
         if (!cdemu_device_tao_recording_open_track(self, 
mirage_sector_get_sector_type(sector))) {
             CDEMU_DEBUG(self, DAEMON_DEBUG_WARNING, "%s: failed to open new 
track!\n", __debug__);
@@ -366,7 +366,16 @@
 static gboolean cdemu_device_tao_recording_write_sectors (CdemuDevice *self, 
gint start_address, gint num_sectors)
 {
     const struct ModePage_0x05 *p_0x05 = cdemu_device_get_mode_page(self, 
0x05, MODE_PAGE_CURRENT);
-    const struct RECORDING_DataFormat *format = 
&recording_data_formats[p_0x05->data_block_type]; /* FIXME: we should force 
validity of this with mode page validation! */
+    gboolean is_cd_rom = mirage_disc_get_medium_type(self->priv->disc) == 
MIRAGE_MEDIUM_CD;
+
+    const struct RECORDING_DataFormat *format;
+    if (is_cd_rom) {
+        format = &recording_data_formats[p_0x05->data_block_type]; /* FIXME: 
we should force validity of this with mode page validation! */
+        CDEMU_DEBUG(self, DAEMON_DEBUG_RECORDING, "%s: write %d sectors at 
address 0x%X; sector type %d (data block type %d as per mode page 0x05)\n", 
__debug__, num_sectors, start_address, format->sector_type, 
p_0x05->data_block_type);
+    } else {
+        format = &recording_data_formats[8]; /* Force format 8: 2048 bytes - 
Mode 1 user data */
+        CDEMU_DEBUG(self, DAEMON_DEBUG_RECORDING, "%s: write %d sectors at 
address 0x%X; sector type %d (forcing data block type 8 due to medium type)\n", 
__debug__, num_sectors, start_address, format->sector_type);
+    }
     gint sector_type = format->sector_type;
 
     MirageSector *sector = g_object_new(MIRAGE_TYPE_SECTOR, NULL);
@@ -397,7 +406,7 @@
 
         /* If data type is 10 or 12, we need to copy subheader from
            write parameters page */
-        if (p_0x05->data_block_type == 10 || p_0x05->data_block_type == 12) {
+        if (is_cd_rom && (p_0x05->data_block_type == 10 || 
p_0x05->data_block_type == 12)) {
             mirage_sector_set_subheader(sector, p_0x05->subheader, 
sizeof(p_0x05->subheader), NULL);
         }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cdemu-daemon-3.2.1/src/device.c 
new/cdemu-daemon-3.2.3/src/device.c
--- old/cdemu-daemon-3.2.1/src/device.c 2018-07-08 13:12:55.000000000 +0200
+++ new/cdemu-daemon-3.2.3/src/device.c 2019-08-27 17:24:39.000000000 +0200
@@ -45,7 +45,7 @@
 /**********************************************************************\
  *                            Device init                             *
 \**********************************************************************/
-gboolean cdemu_device_initialize (CdemuDevice *self, gint number, const gchar 
*audio_driver)
+gboolean cdemu_device_initialize (CdemuDevice *self, gint number, const gchar 
*audio_driver, guint cdemu_debug_mask, guint mirage_debug_mask)
 {
     MirageContext *context;
     GSource *source;
@@ -79,6 +79,7 @@
     context = g_object_new(MIRAGE_TYPE_CONTEXT, NULL);
     mirage_context_set_debug_name(context, self->priv->device_name);
     mirage_context_set_debug_domain(context, "CDEMU");
+    mirage_context_set_debug_mask(context, cdemu_debug_mask);
     mirage_contextual_set_context(MIRAGE_CONTEXTUAL(self), context);
     g_object_unref(context);
 
@@ -110,6 +111,7 @@
     self->priv->mirage_context = g_object_new(MIRAGE_TYPE_CONTEXT, NULL);
     mirage_context_set_debug_name(self->priv->mirage_context, 
self->priv->device_name);
     mirage_context_set_debug_domain(self->priv->mirage_context, "libMirage");
+    mirage_context_set_debug_mask(self->priv->mirage_context, 
mirage_debug_mask);
 
     /* Set up default device ID */
     cdemu_device_set_device_id(self, "CDEmu   ", "Virt. CD/DVD-ROM", "1.10", " 
   cdemu.sf.net    ");
@@ -319,11 +321,11 @@
 /**********************************************************************\
  *                             Object init                            *
 \**********************************************************************/
-G_DEFINE_TYPE(CdemuDevice, cdemu_device, MIRAGE_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_PRIVATE(CdemuDevice, cdemu_device, MIRAGE_TYPE_OBJECT)
 
 static void cdemu_device_init (CdemuDevice *self)
 {
-    self->priv = CDEMU_DEVICE_GET_PRIVATE(self);
+    self->priv = cdemu_device_get_instance_private(self);
 
     self->priv->io_channel = NULL;
     self->priv->io_thread = NULL;
@@ -459,8 +461,4 @@
     g_signal_new("option-changed", G_OBJECT_CLASS_TYPE(klass), 
G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 
1, G_TYPE_STRING, NULL);
     g_signal_new("kernel-io-error", G_OBJECT_CLASS_TYPE(klass), 
G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 
0, NULL);
     g_signal_new("mapping-ready", G_OBJECT_CLASS_TYPE(klass), 
G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 
0, NULL);
-
-
-    /* Register private structure */
-    g_type_class_add_private(klass, sizeof(CdemuDevicePrivate));
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cdemu-daemon-3.2.1/src/device.h 
new/cdemu-daemon-3.2.3/src/device.h
--- old/cdemu-daemon-3.2.1/src/device.h 2018-07-08 13:12:55.000000000 +0200
+++ new/cdemu-daemon-3.2.3/src/device.h 2019-08-27 17:24:39.000000000 +0200
@@ -54,7 +54,7 @@
 GType cdemu_device_get_type (void);
 
 /* Public API */
-gboolean cdemu_device_initialize (CdemuDevice *self, gint number, const gchar 
*audio_driver);
+gboolean cdemu_device_initialize (CdemuDevice *self, gint number, const gchar 
*audio_driver, guint cdemu_debug_mask, guint mirage_debug_mask);
 
 gint cdemu_device_get_device_number (CdemuDevice *self);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cdemu-daemon-3.2.1/src/main.c 
new/cdemu-daemon-3.2.3/src/main.c
--- old/cdemu-daemon-3.2.1/src/main.c   2018-07-08 13:12:55.000000000 +0200
+++ new/cdemu-daemon-3.2.3/src/main.c   2019-08-27 17:24:39.000000000 +0200
@@ -28,6 +28,8 @@
 static gchar *audio_driver = "null";
 static gchar *bus = "session";
 static gchar *log_filename = NULL;
+static guint cdemu_debug_mask = 0;
+static guint mirage_debug_mask = 0;
 
 static GOptionEntry option_entries[] = {
     { "num-devices", 'n', 0, G_OPTION_ARG_INT, &num_devices, N_("Number of 
devices"), N_("N") },
@@ -35,6 +37,8 @@
     { "audio-driver", 'a', 0, G_OPTION_ARG_STRING, &audio_driver, N_("Audio 
driver"), N_("driver") },
     { "bus", 'b', 0, G_OPTION_ARG_STRING, &bus, N_("Bus type to use"), 
N_("bus_type") },
     { "logfile", 'l', 0, G_OPTION_ARG_STRING, &log_filename, N_("Logfile"), 
N_("logfile") },
+    { "default-cdemu-debug-mask", 0, 0, G_OPTION_ARG_INT, &cdemu_debug_mask, 
N_("Default debug mask for CDEmu devices"), N_("mask") },
+    { "default-mirage-debug-mask", 0, 0, G_OPTION_ARG_INT, &mirage_debug_mask, 
N_("Default debug mask for underlying libMirage"), N_("mask") },
     { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
 };
 
@@ -137,6 +141,8 @@
     g_message(Q_(" - control device: %s\n"), ctl_device);
     g_message(Q_(" - audio driver: %s\n"), audio_driver);
     g_message(Q_(" - bus type: %s\n"), bus);
+    g_message(Q_(" - default CDEmu debug mask: 0x%X\n"), cdemu_debug_mask);
+    g_message(Q_(" - default libMirage debug mask: 0x%X\n"), 
mirage_debug_mask);
     g_message("\n");
 
     /* Decipher bus type */
@@ -162,7 +168,7 @@
     setup_signal_trap();
 
     /* Initialize and start daemon */
-    if (cdemu_daemon_initialize_and_start(daemon_obj, num_devices, ctl_device, 
audio_driver, use_system_bus)) {
+    if (cdemu_daemon_initialize_and_start(daemon_obj, num_devices, ctl_device, 
audio_driver, use_system_bus, cdemu_debug_mask, mirage_debug_mask)) {
         /* Printed when daemon stops */
         g_message(Q_("Stopping daemon.\n"));
     } else {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cdemu-daemon-3.2.1/src/mmc-packet-commands.h 
new/cdemu-daemon-3.2.3/src/mmc-packet-commands.h
--- old/cdemu-daemon-3.2.1/src/mmc-packet-commands.h    2018-07-08 
13:12:55.000000000 +0200
+++ new/cdemu-daemon-3.2.3/src/mmc-packet-commands.h    2019-08-27 
17:24:39.000000000 +0200
@@ -576,6 +576,21 @@
     guint8 reserved11[22];
 };
 
+struct INQUIRY_VPD_Header
+{
+    #if G_BYTE_ORDER == G_BIG_ENDIAN
+        guint8 per_qual : 3;
+        guint8 per_dev  : 5;
+    #else
+        guint8 per_dev  : 3;
+        guint8 per_qual : 5;
+    #endif
+
+    guint8 page_code;
+    guint8 reserved;
+    guint8 page_length;
+};
+
 
 /**********************************************************************\
  *                         LOAD/UNLOAD MEDIUM                         *


Reply via email to