Hello community, here is the log from the commit of package cdemu-daemon for openSUSE:Factory checked in at 2020-05-02 22:18:18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/cdemu-daemon (Old) and /work/SRC/openSUSE:Factory/.cdemu-daemon.new.2738 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cdemu-daemon" Sat May 2 22:18:18 2020 rev:24 rq:799560 version:3.2.4 Changes: -------- --- /work/SRC/openSUSE:Factory/cdemu-daemon/cdemu-daemon.changes 2019-10-24 23:10:47.420636161 +0200 +++ /work/SRC/openSUSE:Factory/.cdemu-daemon.new.2738/cdemu-daemon.changes 2020-05-02 22:18:23.304668154 +0200 @@ -1,0 +2,11 @@ +Fri May 1 13:57:00 UTC 2020 - Aaron Stern <[email protected]> + +- Update to release 3.2.4 + * Updated the list of commands that interrupt audio play. + * Generate device serial number using global device number + instead of local one. + * Delay emulation: removed the use of deprecated GTimeVal. + * Tweak default device identifier in standard INQUIRY response. + * Implemented INQUIRY EVPD 0x83 page. + +------------------------------------------------------------------- Old: ---- cdemu-daemon-3.2.3.tar.bz2 New: ---- cdemu-daemon-3.2.4.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ cdemu-daemon.spec ++++++ --- /var/tmp/diff_new_pack.DrJzA8/_old 2020-05-02 22:18:24.604670877 +0200 +++ /var/tmp/diff_new_pack.DrJzA8/_new 2020-05-02 22:18:24.608670886 +0200 @@ -1,7 +1,7 @@ # # spec file for package cdemu-daemon # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -22,15 +22,15 @@ %endif Name: cdemu-daemon -Version: 3.2.3 +Version: 3.2.4 Release: 0 Summary: Device daemon for cdemu, a virtual CD-ROM device emulator License: GPL-2.0-or-later Group: System/Daemons -Url: http://cdemu.sf.net/about/daemon/ +URL: https://cdemu.sourceforge.io/about/daemon/ #Git-Clone: git://git.code.sf.net/p/cdemu/code -Source: http://downloads.sf.net/cdemu/%name-%version.tar.bz2 +Source: https://downloads.sf.net/cdemu/%name-%version.tar.bz2 Source2: 60-vhba.rules Source3: cdemu-daemon.sysconfig Patch1: logfile.diff ++++++ cdemu-daemon-3.2.3.tar.bz2 -> cdemu-daemon-3.2.4.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cdemu-daemon-3.2.3/CMakeLists.txt new/cdemu-daemon-3.2.4/CMakeLists.txt --- old/cdemu-daemon-3.2.3/CMakeLists.txt 2019-08-27 17:24:39.000000000 +0200 +++ new/cdemu-daemon-3.2.4/CMakeLists.txt 2020-01-06 17:23:51.000000000 +0100 @@ -7,7 +7,7 @@ list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) # Versioning -set (CDEMU_DAEMON_VERSION 3.2.3) +set (CDEMU_DAEMON_VERSION 3.2.4) set (CDEMU_DAEMON_INTERFACE_VERSION_MAJOR 7) set (CDEMU_DAEMON_INTERFACE_VERSION_MINOR 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cdemu-daemon-3.2.3/README new/cdemu-daemon-3.2.4/README --- old/cdemu-daemon-3.2.3/README 2019-08-27 17:24:39.000000000 +0200 +++ new/cdemu-daemon-3.2.4/README 2020-01-06 17:23:51.000000000 +0100 @@ -1,5 +1,5 @@ CDEmu Daemon -3.2.3 +3.2.4 ~~~~~ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cdemu-daemon-3.2.3/debian/changelog new/cdemu-daemon-3.2.4/debian/changelog --- old/cdemu-daemon-3.2.3/debian/changelog 2019-08-27 17:24:39.000000000 +0200 +++ new/cdemu-daemon-3.2.4/debian/changelog 2020-01-06 17:23:51.000000000 +0100 @@ -1,3 +1,3 @@ -cdemu-daemon (3.2.3-1) debian; urgency=low +cdemu-daemon (3.2.4-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.3/debian/control new/cdemu-daemon-3.2.4/debian/control --- old/cdemu-daemon-3.2.3/debian/control 2019-08-27 17:24:39.000000000 +0200 +++ new/cdemu-daemon-3.2.4/debian/control 2020-01-06 17:23:51.000000000 +0100 @@ -5,7 +5,7 @@ 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), ninja-build + cmake (>= 2.8.5) Standards-Version: 4.3.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cdemu-daemon-3.2.3/debian/rules new/cdemu-daemon-3.2.4/debian/rules --- old/cdemu-daemon-3.2.3/debian/rules 2019-08-27 17:24:39.000000000 +0200 +++ new/cdemu-daemon-3.2.4/debian/rules 2020-01-06 17:23:51.000000000 +0100 @@ -5,9 +5,6 @@ #export DH_VERBOSE=1 -override_dh_auto_configure: - dh_auto_configure -- -G Ninja - override_dh_auto_test: override_dh_strip: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cdemu-daemon-3.2.3/debian/source/options new/cdemu-daemon-3.2.4/debian/source/options --- old/cdemu-daemon-3.2.3/debian/source/options 2019-08-27 17:24:39.000000000 +0200 +++ new/cdemu-daemon-3.2.4/debian/source/options 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -compression = "xz" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cdemu-daemon-3.2.3/debian/watch new/cdemu-daemon-3.2.4/debian/watch --- old/cdemu-daemon-3.2.3/debian/watch 2019-08-27 17:24:39.000000000 +0200 +++ new/cdemu-daemon-3.2.4/debian/watch 2020-01-06 17:23:51.000000000 +0100 @@ -1,4 +1,4 @@ version=3 -http://sf.net/cdemu/ cdemu-daemon-(.+)\.tar\.bz2 +http://sf.net/cdemu/ @PACKAGE@@ANY_VERSION@@ARCHIVE_EXT@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cdemu-daemon-3.2.3/src/audio.c new/cdemu-daemon-3.2.4/src/audio.c --- old/cdemu-daemon-3.2.3/src/audio.c 2019-08-27 17:24:39.000000000 +0200 +++ new/cdemu-daemon-3.2.4/src/audio.c 2020-01-06 17:23:51.000000000 +0100 @@ -153,11 +153,7 @@ /* Start the playback thread; thread must be joinable, so we can wait for it to end */ -#if !GLIB_CHECK_VERSION(2, 32, 0) - self->priv->playback_thread = g_thread_create((GThreadFunc)cdemu_audio_playback_thread, self, TRUE, &local_error); -#else self->priv->playback_thread = g_thread_try_new("CDEmu Device Audio Play thread", (GThreadFunc)cdemu_audio_playback_thread, self, &local_error); -#endif if (!self->priv->playback_thread) { CDEMU_DEBUG(self, DAEMON_DEBUG_WARNING, "%s: failed to create audio playback thread: %s\n", __debug__, local_error->message); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cdemu-daemon-3.2.3/src/device-commands.c new/cdemu-daemon-3.2.4/src/device-commands.c --- old/cdemu-daemon-3.2.3/src/device-commands.c 2019-08-27 17:24:39.000000000 +0200 +++ new/cdemu-daemon-3.2.4/src/device-commands.c 2020-01-06 17:23:51.000000000 +0100 @@ -578,7 +578,7 @@ 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) */ + ret_list[num_pages++] = 0x83; /* Device identification (mandatory) */ /* Modify reported length */ self->priv->buffer_size += num_pages; @@ -595,14 +595,67 @@ ret_header->page_length = 0; /* Serial number */ + /* NOTE: g_strlcpy() should add a trailing NULL to destination. + This is not a problem, because a) it is not counted in the + return value, and b) because we are writing directly to + cache buffer, and hence this additional NULL is effectively + discarded from the response. */ gchar *ret_serial = (gchar *)(ret_header + 1); - gint serial_len = g_sprintf(ret_serial, "CDEMU%03d", self->priv->number); + gint serial_len = g_strlcpy(ret_serial, self->priv->device_serial, self->priv->buffer_capacity - self->priv->buffer_size); /* Modify reported length */ self->priv->buffer_size += serial_len; ret_header->page_length += serial_len; break; } + case 0x83: { + /* Device identification */ + 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 = 0x83; /* Page 0x80: Serial number */ + ret_header->page_length = 0; + + /* Identifier header */ + struct INQUIRY_VPD_IdentificationDescriptorHeader *id_header = (struct INQUIRY_VPD_IdentificationDescriptorHeader *)(self->priv->buffer + self->priv->buffer_size); + self->priv->buffer_size += sizeof(struct INQUIRY_VPD_IdentificationDescriptorHeader); + ret_header->page_length += sizeof(struct INQUIRY_VPD_IdentificationDescriptorHeader); + + id_header->protocol_id = 8; /* ATA/ATAPI */ + id_header->code_set = 2; /* ASCII */ + + id_header->association = 0; /* Logical unit*/ + id_header->identifier_type = 1; /* T-10 vendor ID based */ + + id_header->identifier_length = 0; + + /* T10 vendor identification (8-byte) */ + gchar *vendor_id = (gchar *)(self->priv->buffer + self->priv->buffer_size); + + /* Fill with spaces and copy the vendor string; the lenght + of the latter is guaranteed not to exceed 8 characters + (see comment in command_inquiry()) */ + memset(vendor_id, 32, 8); + memcpy(vendor_id, self->priv->id_vendor_id, strlen(self->priv->id_vendor_id)); + + self->priv->buffer_size += 8; + ret_header->page_length += 8; + id_header->identifier_length += 8; + + /* Vendor-specific identifier */ + /* SPC: "A recommended method of constructing a unique + IDENTIFIER field is to concatenate the PRODUCT IDENTIFICATION + field from the standard INQUIRY data and the PRODUCT SERIAL + NUMBER field from the Unit Serial Number VPD page */ + gchar *id_string = (gchar *)(self->priv->buffer + self->priv->buffer_size); + gint id_len = g_snprintf(id_string, self->priv->buffer_capacity - self->priv->buffer_size, "%s %s", self->priv->id_product_id, self->priv->device_serial); + + self->priv->buffer_size += id_len; + ret_header->page_length += id_len; + id_header->identifier_length += id_len; + + break; + } default: { /* Unsupported; as stated in SPC, return CHECK CONDITION, ILLEGAL REQUEST and INVALID FIELD IN CDB */ @@ -647,10 +700,23 @@ ret_data->atapi_version = 3; /* Should be 3 according to INF8090 */ ret_data->response_fmt = 0x02; /* Should be 2 according to INF8090 */ ret_data->length = sizeof(struct INQUIRY_Data) - 5; - memcpy(ret_data->vendor_id, self->priv->id_vendor_id, 8); - memcpy(ret_data->product_id, self->priv->id_product_id, 16); - memcpy(ret_data->product_rev, self->priv->id_revision, 4); - memcpy(ret_data->vendor_spec1, self->priv->id_vendor_specific, 20); + + /* NOTE: the length of source strings is guaranteed to not exceed + the corresponding buffer size due to limits imposed during + storing procedure in cdemu_device_set_device_id() */ + /* First, fill all bytes with whitespace, then copy the string + without terminating NULL */ + memset(ret_data->vendor_id, 32, 8); + memcpy(ret_data->vendor_id, self->priv->id_vendor_id, strlen(self->priv->id_vendor_id)); + + memset(ret_data->product_id, 32, 16); + memcpy(ret_data->product_id, self->priv->id_product_id, strlen(self->priv->id_product_id)); + + memset(ret_data->product_rev, 32, 4); + memcpy(ret_data->product_rev, self->priv->id_revision, strlen(self->priv->id_revision)); + + memset(ret_data->vendor_spec1, 32, 20); + memcpy(ret_data->vendor_spec1, self->priv->id_vendor_specific, strlen(self->priv->id_vendor_specific)); ret_data->ver_desc1 = GUINT16_TO_BE(0x02A0); /* We'll try to pass as MMC-3 device */ @@ -2639,7 +2705,7 @@ PacketCommand cmd; gchar *debug_name; gboolean (*implementation)(CdemuDevice *, const guint8 *); - gboolean disturbs_audio_play; + gboolean interrupt_audio_play; } packet_commands[] = { { CLOSE_TRACK_SESSION, "CLOSE TRACK/SESSION", @@ -2652,7 +2718,7 @@ { GET_CONFIGURATION, "GET CONFIGURATION", command_get_configuration, - TRUE, }, + FALSE, }, { GET_PERFORMANCE, "GET PERFORMANCE", command_get_performance, @@ -2664,19 +2730,19 @@ { MODE_SELECT_6, "MODE SELECT (6)", command_mode_select, - TRUE }, + FALSE }, { MODE_SELECT_10, "MODE SELECT (10)", command_mode_select, - TRUE }, + FALSE }, { MODE_SENSE_6, "MODE SENSE (6)", command_mode_sense, - TRUE }, + FALSE }, { MODE_SENSE_10, "MODE SENSE (10)", command_mode_sense, - TRUE }, + FALSE }, { PAUSE_RESUME, "PAUSE/RESUME", command_pause_resume, @@ -2696,7 +2762,7 @@ { PREVENT_ALLOW_MEDIUM_REMOVAL, "PREVENT/ALLOW MEDIUM REMOVAL", command_prevent_allow_medium_removal, - TRUE }, + FALSE }, { READ_10, "READ (10)", command_read, @@ -2716,11 +2782,11 @@ { READ_CD, "READ CD", command_read_cd, - TRUE }, + FALSE }, { READ_CD_MSF, "READ CD MSF", command_read_cd, - TRUE }, + FALSE }, { READ_DISC_INFORMATION, "READ DISC INFORMATION", command_read_disc_information, @@ -2732,7 +2798,7 @@ { READ_TOC_PMA_ATIP, "READ TOC/PMA/ATIP", command_read_toc_pma_atip, - TRUE }, + FALSE }, { READ_TRACK_INFORMATION, "READ TRACK INFORMATION", command_read_track_information, @@ -2756,7 +2822,7 @@ { SEEK_10, "SEEK (10)", command_seek, - FALSE }, + TRUE }, { SEND_CUE_SHEET, "SEND CUE SHEET", command_send_cue_sheet, @@ -2776,7 +2842,7 @@ { SYNCHRONIZE_CACHE, "SYNCHRONIZE CACHE", command_synchronize_cache, - TRUE }, + FALSE }, { TEST_UNIT_READY, "TEST UNIT READY", command_test_unit_ready, @@ -2804,8 +2870,8 @@ /* FIXME: If there is deferred error sense available, return CHECK CONDITION with that sense. We do not execute requested command. */ - /* Stop audio play if command disturbs it */ - if (packet_commands[i].disturbs_audio_play) { + /* Stop audio play if command interrupts it */ + if (packet_commands[i].interrupt_audio_play) { gint audio_status = cdemu_audio_get_status(CDEMU_AUDIO(self->priv->audio_play)); if (audio_status == AUDIO_STATUS_PLAYING || audio_status == AUDIO_STATUS_PAUSED) { cdemu_audio_stop(CDEMU_AUDIO(self->priv->audio_play)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cdemu-daemon-3.2.3/src/device-delay.c new/cdemu-daemon-3.2.4/src/device-delay.c --- old/cdemu-daemon-3.2.3/src/device-delay.c 2019-08-27 17:24:39.000000000 +0200 +++ new/cdemu-daemon-3.2.4/src/device-delay.c 2020-01-06 17:23:51.000000000 +0100 @@ -119,7 +119,7 @@ { /* Simply get current time here; we'll need it to compensate for processing time when performing actual delay */ - g_get_current_time(&self->priv->delay_begin); + self->priv->delay_begin = g_get_monotonic_time(); /* Reset delay */ self->priv->delay_amount = 0; @@ -130,11 +130,6 @@ void cdemu_device_delay_finalize (CdemuDevice *self) { - GTimeVal delay_now; - GTimeVal delay_diff; - - gint delay; - /* If there's no delay to perform, don't bother doing anything... */ if (!self->priv->delay_amount) { CDEMU_DEBUG(self, DAEMON_DEBUG_DELAY, "%s: no delay to perform\n", __debug__); @@ -142,18 +137,17 @@ } /* Get current time */ - g_get_current_time(&delay_now); + gint64 delay_now = g_get_monotonic_time(); /* Calculate time difference */ - delay_diff.tv_sec = delay_now.tv_sec - self->priv->delay_begin.tv_sec; - delay_diff.tv_usec = delay_now.tv_usec - self->priv->delay_begin.tv_usec; + gint64 delay_diff = delay_now - self->priv->delay_begin; - CDEMU_DEBUG(self, DAEMON_DEBUG_DELAY, "%s: calculated delay: %i microseconds\n", __debug__, self->priv->delay_amount); - CDEMU_DEBUG(self, DAEMON_DEBUG_DELAY, "%s: processing time: %li seconds, %li microseconds\n", __debug__, delay_diff.tv_sec, delay_diff.tv_usec); + CDEMU_DEBUG(self, DAEMON_DEBUG_DELAY, "%s: calculated delay: %" G_GINT64_FORMAT " microseconds\n", __debug__, self->priv->delay_amount); + CDEMU_DEBUG(self, DAEMON_DEBUG_DELAY, "%s: processing time: %" G_GINT64_FORMAT " microseconds\n", __debug__, delay_diff); /* Compensate for the processing time */ - delay = self->priv->delay_amount - (delay_diff.tv_sec * G_USEC_PER_SEC + delay_diff.tv_usec); - CDEMU_DEBUG(self, DAEMON_DEBUG_DELAY, "%s: actual delay: %i microseconds\n", __debug__, delay); + gint64 delay = self->priv->delay_amount - delay_diff; + CDEMU_DEBUG(self, DAEMON_DEBUG_DELAY, "%s: actual delay: %" G_GINT64_FORMAT " microseconds\n", __debug__, delay); if (delay < 0) { CDEMU_DEBUG(self, DAEMON_DEBUG_DELAY, "%s: spent too much time processing, bailing out!\n", __debug__); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cdemu-daemon-3.2.3/src/device-kernel-io.c new/cdemu-daemon-3.2.4/src/device-kernel-io.c --- old/cdemu-daemon-3.2.3/src/device-kernel-io.c 2019-08-27 17:24:39.000000000 +0200 +++ new/cdemu-daemon-3.2.4/src/device-kernel-io.c 2020-01-06 17:23:51.000000000 +0100 @@ -248,17 +248,31 @@ g_error_free(local_error); } + /* Generate device serial number based on the global device number + obtained from the kernel */ + if (TRUE) { + gint ioctl_ret; + gint32 device_number = self->priv->number; /* Use local device number as fallback */ + + /* Perform IOCTL */ + ioctl_ret = ioctl(g_io_channel_unix_get_fd(self->priv->io_channel), 0xBEEF002, &device_number); + + if (ioctl_ret < 0) { + /* Other errors */ + CDEMU_DEBUG(self, DAEMON_DEBUG_WARNING, "%s: error while performing ioctl 0x%X (%d); device serial number will be generated using local device number!\n", __debug__, 0xBEEF002, ioctl_ret); + } + + /* Generate serial number */ + self->priv->device_serial = g_strdup_printf("%03d", device_number); + } + /* Create I/O watch */ self->priv->io_watch = g_io_create_watch(self->priv->io_channel, G_IO_IN); g_source_set_callback(self->priv->io_watch, (GSourceFunc)cdemu_device_io_handler, self, NULL); g_source_attach(self->priv->io_watch, self->priv->main_context); /* Start I/O thread */ -#if !GLIB_CHECK_VERSION(2, 32, 0) - self->priv->io_thread = g_thread_create((GThreadFunc)cdemu_device_io_thread, self, TRUE, &local_error); -#else self->priv->io_thread = g_thread_try_new("I/O thread", (GThreadFunc)cdemu_device_io_thread, self, &local_error); -#endif if (!self->priv->io_thread) { CDEMU_DEBUG(self, DAEMON_DEBUG_WARNING, "%s: failed to start I/O thread: %s\n", __debug__, local_error->message); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cdemu-daemon-3.2.3/src/device-private.h new/cdemu-daemon-3.2.4/src/device-private.h --- old/cdemu-daemon-3.2.3/src/device-private.h 2019-08-27 17:24:39.000000000 +0200 +++ new/cdemu-daemon-3.2.4/src/device-private.h 2020-01-06 17:23:51.000000000 +0100 @@ -43,6 +43,8 @@ gint number; gchar *device_name; + gchar *device_serial; + /* Device mutex */ GMutex *device_mutex; @@ -84,8 +86,8 @@ GList *features_list; /* Delay emulation */ - GTimeVal delay_begin; - gint delay_amount; + gint64 delay_begin; + gint64 delay_amount; gdouble current_angle; gboolean dpm_emulation; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cdemu-daemon-3.2.3/src/device.c new/cdemu-daemon-3.2.4/src/device.c --- old/cdemu-daemon-3.2.3/src/device.c 2019-08-27 17:24:39.000000000 +0200 +++ new/cdemu-daemon-3.2.4/src/device.c 2020-01-06 17:23:51.000000000 +0100 @@ -57,13 +57,13 @@ self->priv->number = number; self->priv->device_name = g_strdup_printf("cdemu%i", number); + /* NOTE: self->priv->device_serial is generated in cdemu_device_start(), + once the control device is opened and global device number is + obtained from it */ + /* Init device mutex */ -#if !GLIB_CHECK_VERSION(2, 32, 0) - self->priv->device_mutex = g_mutex_new(); -#else self->priv->device_mutex = g_new(GMutex, 1); g_mutex_init(self->priv->device_mutex); -#endif /* Create GLib main context and main loop for events */ self->priv->main_context = g_main_context_new(); @@ -114,7 +114,7 @@ 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 "); + cdemu_device_set_device_id(self, "CDEmu", "CD-ROM", "1.0", "cdemu.sf.net"); /* Initialize mode pages and features and set profile */ cdemu_device_mode_pages_init(self); @@ -334,6 +334,8 @@ self->priv->io_watch = NULL; self->priv->device_name = NULL; + self->priv->device_serial = NULL; + self->priv->device_mutex = NULL; self->priv->kernel_io_buffer = NULL; @@ -431,6 +433,9 @@ /* Free device name */ g_free(self->priv->device_name); + /* Free device serial */ + g_free(self->priv->device_serial); + /* Free device ID */ g_free(self->priv->id_vendor_id); g_free(self->priv->id_product_id); @@ -438,12 +443,8 @@ g_free(self->priv->id_vendor_specific); /* Free mutex */ -#if !GLIB_CHECK_VERSION(2, 32, 0) - g_mutex_free(self->priv->device_mutex); -#else g_mutex_clear(self->priv->device_mutex); g_free(self->priv->device_mutex); -#endif /* Chain up to the parent class */ return G_OBJECT_CLASS(cdemu_device_parent_class)->finalize(gobject); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cdemu-daemon-3.2.3/src/main.c new/cdemu-daemon-3.2.4/src/main.c --- old/cdemu-daemon-3.2.3/src/main.c 2019-08-27 17:24:39.000000000 +0200 +++ new/cdemu-daemon-3.2.4/src/main.c 2020-01-06 17:23:51.000000000 +0100 @@ -89,15 +89,6 @@ bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); textdomain(GETTEXT_PACKAGE); - /* Glib type system and threading system initialization; needed - only in older glib versions */ -#if !GLIB_CHECK_VERSION(2, 36, 0) - g_type_init(); -#endif -#if !GLIB_CHECK_VERSION(2, 32, 0) - g_thread_init(NULL); -#endif - /* Default log handler is local */ g_log_set_default_handler(log_handler_stdout, NULL); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cdemu-daemon-3.2.3/src/mmc-packet-commands.h new/cdemu-daemon-3.2.4/src/mmc-packet-commands.h --- old/cdemu-daemon-3.2.3/src/mmc-packet-commands.h 2019-08-27 17:24:39.000000000 +0200 +++ new/cdemu-daemon-3.2.4/src/mmc-packet-commands.h 2020-01-06 17:23:51.000000000 +0100 @@ -592,6 +592,33 @@ }; +struct INQUIRY_VPD_IdentificationDescriptorHeader +{ + #if G_BYTE_ORDER == G_BIG_ENDIAN + guint8 protocol_id : 3; + guint8 code_set : 5; + #else + guint8 code_set : 3; + guint8 protocol_id : 5; + #endif + + #if G_BYTE_ORDER == G_BIG_ENDIAN + guint8 piv : 1; + guint8 reserved1 : 1; + guint8 association : 2; + guint8 identifier_type : 4; + #else + guint8 identifier_type : 4; + guint8 association : 2; + guint8 reserved1 : 1; + guint8 piv : 1; + #endif + + guint8 reserved2; + guint8 identifier_length; +}; + + /**********************************************************************\ * LOAD/UNLOAD MEDIUM * \**********************************************************************/
