Backport fixes and hwdb changes

Virt patch which had to be backed-out is enabled again, along with the
patch to fix the compilation issues.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2013-12-03 19:08:42 -05:00
parent 7d7fbfa3c2
commit d66047d776
25 changed files with 2099 additions and 2 deletions

View File

@ -0,0 +1,38 @@
From ad792a7d7a407e2bcdf3553290c97d3642fdaf01 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 19 Nov 2013 01:13:42 +0100
Subject: [PATCH] calendar: support 'yearly' and 'annually' names the same way
as cron
---
src/shared/calendarspec.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/src/shared/calendarspec.c b/src/shared/calendarspec.c
index 7979e23..7075159 100644
--- a/src/shared/calendarspec.c
+++ b/src/shared/calendarspec.c
@@ -686,6 +686,23 @@ int calendar_spec_from_string(const char *p, CalendarSpec **spec) {
if (r < 0)
goto fail;
+ } else if (strcaseeq(p, "anually") || strcaseeq(p, "yearly")) {
+ r = const_chain(1, &c->month);
+ if (r < 0)
+ goto fail;
+ r = const_chain(1, &c->day);
+ if (r < 0)
+ goto fail;
+ r = const_chain(0, &c->hour);
+ if (r < 0)
+ goto fail;
+ r = const_chain(0, &c->minute);
+ if (r < 0)
+ goto fail;
+ r = const_chain(0, &c->second);
+ if (r < 0)
+ goto fail;
+
} else if (strcaseeq(p, "weekly")) {
c->weekdays_bits = 1;

View File

@ -0,0 +1,57 @@
From 48335b715e811ba56f7c03199efb85a664762f5d Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 19 Nov 2013 21:02:59 +0100
Subject: [PATCH] hashmap: be a bit more conservative with pre-allocating hash
tables and items
---
src/shared/hashmap.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/shared/hashmap.c b/src/shared/hashmap.c
index f06fce6..8f5957b 100644
--- a/src/shared/hashmap.c
+++ b/src/shared/hashmap.c
@@ -66,13 +66,14 @@ static void *first_hashmap_tile = NULL;
static struct pool *first_entry_pool = NULL;
static void *first_entry_tile = NULL;
-static void* allocate_tile(struct pool **first_pool, void **first_tile, size_t tile_size) {
+static void* allocate_tile(struct pool **first_pool, void **first_tile, size_t tile_size, unsigned at_least) {
unsigned i;
/* When a tile is released we add it to the list and simply
* place the next pointer at its offset 0. */
assert(tile_size >= sizeof(void*));
+ assert(at_least > 0);
if (*first_tile) {
void *r;
@@ -88,7 +89,7 @@ static void* allocate_tile(struct pool **first_pool, void **first_tile, size_t t
struct pool *p;
n = *first_pool ? (*first_pool)->n_tiles : 0;
- n = MAX(512U, n * 2);
+ n = MAX(at_least, n * 2);
size = PAGE_ALIGN(ALIGN(sizeof(struct pool)) + n*tile_size);
n = (size - ALIGN(sizeof(struct pool))) / tile_size;
@@ -191,7 +192,7 @@ Hashmap *hashmap_new(hash_func_t hash_func, compare_func_t compare_func) {
size = ALIGN(sizeof(Hashmap)) + INITIAL_N_BUCKETS * sizeof(struct hashmap_entry*);
if (b) {
- h = allocate_tile(&first_hashmap_pool, &first_hashmap_tile, size);
+ h = allocate_tile(&first_hashmap_pool, &first_hashmap_tile, size, 8);
if (!h)
return NULL;
@@ -476,7 +477,7 @@ int hashmap_put(Hashmap *h, const void *key, void *value) {
hash = bucket_hash(h, key);
if (h->from_pool)
- e = allocate_tile(&first_entry_pool, &first_entry_tile, sizeof(struct hashmap_entry));
+ e = allocate_tile(&first_entry_pool, &first_entry_tile, sizeof(struct hashmap_entry), 64U);
else
e = new(struct hashmap_entry, 1);

View File

@ -0,0 +1,26 @@
From c74cf7621353d765a89e800c5a040fefa79e7915 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 20 Nov 2013 03:44:11 +0100
Subject: [PATCH] manager: don't do plymouth in a container
Given that plymouth listens on an abstract namespace socket and if
CLONE_NEWNET is not used the abstract namespace is shared with the host
we might actually end up send plymouth data to the host.
---
src/core/manager.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/core/manager.c b/src/core/manager.c
index ce32baf..944c196 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -1966,6 +1966,9 @@ void manager_send_unit_plymouth(Manager *m, Unit *u) {
if (m->running_as != SYSTEMD_SYSTEM)
return;
+ if (detect_container(NULL) > 0)
+ return;
+
if (u->type != UNIT_SERVICE &&
u->type != UNIT_MOUNT &&
u->type != UNIT_SWAP)

View File

@ -0,0 +1,82 @@
From c3f82c64d86432c7d4b0c3abf61b70fd88f1d9dd Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 20 Nov 2013 22:10:42 +0100
Subject: [PATCH] nspawn: add new --drop-capability= switch
---
man/systemd-nspawn.xml | 10 ++++++++++
src/nspawn/nspawn.c | 12 ++++++++++--
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/man/systemd-nspawn.xml b/man/systemd-nspawn.xml
index ba9e516..c1a5cad 100644
--- a/man/systemd-nspawn.xml
+++ b/man/systemd-nspawn.xml
@@ -304,6 +304,16 @@
</varlistentry>
<varlistentry>
+ <term><option>--drop-capability=</option></term>
+
+ <listitem><para>Specify one or more
+ additional capabilities to drop for
+ the container. This allows running the
+ container with fewer capabilities than
+ the default (see above).</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><option>--link-journal=</option></term>
<listitem><para>Control whether the
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 85bbadf..7346253 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -130,6 +130,7 @@ static int help(void) {
" --read-only Mount the root directory read-only\n"
" --capability=CAP In addition to the default, retain specified\n"
" capability\n"
+ " --drop-capability=CAP Drop the specified capability from the default set\n"
" --link-journal=MODE Link up guest journal, one of no, auto, guest, host\n"
" -j Equivalent to --link-journal=host\n"
" --bind=PATH[:PATH] Bind mount a file or directory from the host into\n"
@@ -148,6 +149,7 @@ static int parse_argv(int argc, char *argv[]) {
ARG_UUID,
ARG_READ_ONLY,
ARG_CAPABILITY,
+ ARG_DROP_CAPABILITY,
ARG_LINK_JOURNAL,
ARG_BIND,
ARG_BIND_RO
@@ -163,6 +165,7 @@ static int parse_argv(int argc, char *argv[]) {
{ "uuid", required_argument, NULL, ARG_UUID },
{ "read-only", no_argument, NULL, ARG_READ_ONLY },
{ "capability", required_argument, NULL, ARG_CAPABILITY },
+ { "drop-capability", required_argument, NULL, ARG_DROP_CAPABILITY },
{ "link-journal", required_argument, NULL, ARG_LINK_JOURNAL },
{ "bind", required_argument, NULL, ARG_BIND },
{ "bind-ro", required_argument, NULL, ARG_BIND_RO },
@@ -247,7 +250,8 @@ static int parse_argv(int argc, char *argv[]) {
arg_read_only = true;
break;
- case ARG_CAPABILITY: {
+ case ARG_CAPABILITY:
+ case ARG_DROP_CAPABILITY: {
char *state, *word;
size_t length;
@@ -266,7 +270,11 @@ static int parse_argv(int argc, char *argv[]) {
}
free(t);
- arg_retain |= 1ULL << (uint64_t) cap;
+
+ if (c == ARG_CAPABILITY)
+ arg_retain |= 1ULL << (uint64_t) cap;
+ else
+ arg_retain &= ~(1ULL << (uint64_t) cap);
}
break;

View File

@ -0,0 +1,59 @@
From 246592d8f7eaf899ec6292cac4985f7bcc8b65fd Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 20 Nov 2013 22:11:10 +0100
Subject: [PATCH] valgrind: make running PID 1 in valgrind useful
Since valgrind only generates useful output on exit() (rather than
exec()) we need to explicitly exit when valgrind is detected.
Conflicts:
src/core/main.c
---
configure.ac | 2 +-
src/core/main.c | 13 +++++++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 9904e25..6232cf8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -814,7 +814,7 @@ AC_DEFINE_UNQUOTED(TELINIT, ["$TELINIT"], [Path to telinit])
AC_SUBST(TELINIT)
-AC_CHECK_HEADERS_ONCE([valgrind/memcheck.h])
+AC_CHECK_HEADERS_ONCE([valgrind/memcheck.h valgrind/valgrind.h])
# ------------------------------------------------------------------------------
have_myhostname=no
diff --git a/src/core/main.c b/src/core/main.c
index 00fd394..58c3a9e 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -34,6 +34,10 @@
#include <sys/prctl.h>
#include <sys/mount.h>
+#ifdef HAVE_VALGRIND_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
+
#include "manager.h"
#include "log.h"
#include "load-fragment.h"
@@ -1855,6 +1859,15 @@ finish:
if (fds)
fdset_free(fds);
+#ifdef HAVE_VALGRIND_VALGRIND_H
+ /* If we are PID 1 and running under valgrind, then let's exit
+ * here explicitly. valgrind will only generate nice output on
+ * exit(), not on exec(), hence let's do the former not the
+ * latter here. */
+ if (getpid() == 1 && RUNNING_ON_VALGRIND)
+ return 0;
+#endif
+
if (shutdown_verb) {
const char * command_line[] = {
SYSTEMD_SHUTDOWN_BINARY_PATH,

View File

@ -0,0 +1,22 @@
From 1530d333580859301dc57ca1a602d1ccd9cd594f Mon Sep 17 00:00:00 2001
From: Tom Gundersen <teg@jklm.no>
Date: Thu, 21 Nov 2013 12:35:46 +0100
Subject: [PATCH] efi-boot-generator: don't mount /boot eagerly
---
src/efi-boot-generator/efi-boot-generator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/efi-boot-generator/efi-boot-generator.c b/src/efi-boot-generator/efi-boot-generator.c
index 05b95ed..5e5c682 100644
--- a/src/efi-boot-generator/efi-boot-generator.c
+++ b/src/efi-boot-generator/efi-boot-generator.c
@@ -82,7 +82,7 @@ int main(int argc, char *argv[]) {
"[Mount]\n"
"Where=/boot\n"
"What=/dev/disk/by-partuuid/%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x\n"
- "Options=umask=0077\n",
+ "Options=umask=0077,noauto\n",
SD_ID128_FORMAT_VAL(id));
free(name);

View File

@ -0,0 +1,327 @@
From 542aea95d13a4e88add77b3a473557dc2f47bb61 Mon Sep 17 00:00:00 2001
From: Marcel Holtmann <marcel@holtmann.org>
Date: Sat, 21 Sep 2013 11:45:05 -0700
Subject: [PATCH] hwdb: Update database of Bluetooth company identifiers
---
hwdb/20-bluetooth-vendor-product.hwdb | 209 +++++++++++++++++++++++++++++++---
1 file changed, 193 insertions(+), 16 deletions(-)
diff --git a/hwdb/20-bluetooth-vendor-product.hwdb b/hwdb/20-bluetooth-vendor-product.hwdb
index c8cb322..faecf42 100644
--- a/hwdb/20-bluetooth-vendor-product.hwdb
+++ b/hwdb/20-bluetooth-vendor-product.hwdb
@@ -46,7 +46,7 @@ bluetooth:v000D*
ID_VENDOR_FROM_DATABASE=Texas Instruments Inc.
bluetooth:v000E*
- ID_VENDOR_FROM_DATABASE=Ceva, Inc. (formerly Parthus Technologies Inc.)
+ ID_VENDOR_FROM_DATABASE=Ceva, Inc. (formerly Parthus Technologies, Inc.)
bluetooth:v000F*
ID_VENDOR_FROM_DATABASE=Broadcom Corporation
@@ -55,7 +55,7 @@ bluetooth:v0010*
ID_VENDOR_FROM_DATABASE=Mitel Semiconductor
bluetooth:v0011*
- ID_VENDOR_FROM_DATABASE=Widcomm, Inc.
+ ID_VENDOR_FROM_DATABASE=Widcomm, Inc
bluetooth:v0012*
ID_VENDOR_FROM_DATABASE=Zeevo, Inc.
@@ -73,13 +73,13 @@ bluetooth:v0016*
ID_VENDOR_FROM_DATABASE=KC Technology Inc.
bluetooth:v0017*
- ID_VENDOR_FROM_DATABASE=Newlogic
+ ID_VENDOR_FROM_DATABASE=NewLogic
bluetooth:v0018*
ID_VENDOR_FROM_DATABASE=Transilica, Inc.
bluetooth:v0019*
- ID_VENDOR_FROM_DATABASE=Rohde & Schwartz GmbH & Co. KG
+ ID_VENDOR_FROM_DATABASE=Rohde & Schwarz GmbH & Co. KG
bluetooth:v001A*
ID_VENDOR_FROM_DATABASE=TTPCom Limited
@@ -151,7 +151,7 @@ bluetooth:v0030*
ID_VENDOR_FROM_DATABASE=ST Microelectronics
bluetooth:v0031*
- ID_VENDOR_FROM_DATABASE=Synopsys
+ ID_VENDOR_FROM_DATABASE=Synopsis
bluetooth:v0032*
ID_VENDOR_FROM_DATABASE=Red-M (Communications) Ltd
@@ -190,16 +190,16 @@ bluetooth:v003D*
ID_VENDOR_FROM_DATABASE=IPextreme, Inc.
bluetooth:v003E*
- ID_VENDOR_FROM_DATABASE=Systems and Chips, Inc
+ ID_VENDOR_FROM_DATABASE=Systems and Chips, Inc.
bluetooth:v003F*
- ID_VENDOR_FROM_DATABASE=Bluetooth SIG, Inc
+ ID_VENDOR_FROM_DATABASE=Bluetooth SIG, Inc.
bluetooth:v0040*
ID_VENDOR_FROM_DATABASE=Seiko Epson Corporation
bluetooth:v0041*
- ID_VENDOR_FROM_DATABASE=Integrated Silicon Solution Taiwain, Inc.
+ ID_VENDOR_FROM_DATABASE=Integrated Silicon Solution Taiwan, Inc.
bluetooth:v0042*
ID_VENDOR_FROM_DATABASE=CONWISE Technology Corporation Ltd
@@ -244,7 +244,7 @@ bluetooth:v004F*
ID_VENDOR_FROM_DATABASE=APT Licensing Ltd.
bluetooth:v0050*
- ID_VENDOR_FROM_DATABASE=SiRF Technology, Inc.
+ ID_VENDOR_FROM_DATABASE=SiRF Technology
bluetooth:v0051*
ID_VENDOR_FROM_DATABASE=Tzero Technologies, Inc.
@@ -379,7 +379,7 @@ bluetooth:v007C*
ID_VENDOR_FROM_DATABASE=A & R Cambridge
bluetooth:v007D*
- ID_VENDOR_FROM_DATABASE=Seers Technology Co. Ltd.
+ ID_VENDOR_FROM_DATABASE=Seers Technology Co. Ltd
bluetooth:v007E*
ID_VENDOR_FROM_DATABASE=Sports Tracking Technologies Ltd.
@@ -406,7 +406,7 @@ bluetooth:v0085*
ID_VENDOR_FROM_DATABASE=BlueRadios, Inc.
bluetooth:v0086*
- ID_VENDOR_FROM_DATABASE=equinux AG
+ ID_VENDOR_FROM_DATABASE=equinox AG
bluetooth:v0087*
ID_VENDOR_FROM_DATABASE=Garmin International, Inc.
@@ -421,7 +421,7 @@ bluetooth:v008A*
ID_VENDOR_FROM_DATABASE=Jawbone
bluetooth:v008B*
- ID_VENDOR_FROM_DATABASE=Topcon Positioning Systems, LLC
+ ID_VENDOR_FROM_DATABASE=Topcorn Positioning Systems, LLC
bluetooth:v008C*
ID_VENDOR_FROM_DATABASE=Qualcomm Labs, Inc.
@@ -433,13 +433,13 @@ bluetooth:v008E*
ID_VENDOR_FROM_DATABASE=Quintic Corp.
bluetooth:v008F*
- ID_VENDOR_FROM_DATABASE=Stollmann E+V GmbH
+ ID_VENDOR_FROM_DATABASE=Stollman E+V GmbH
bluetooth:v0090*
ID_VENDOR_FROM_DATABASE=Funai Electric Co., Ltd.
bluetooth:v0091*
- ID_VENDOR_FROM_DATABASE=Advanced PANMOBIL systems GmbH & Co. KG
+ ID_VENDOR_FROM_DATABASE=Advanced PANMOBIL Systems GmbH & Co. KG
bluetooth:v0092*
ID_VENDOR_FROM_DATABASE=ThinkOptics, Inc.
@@ -460,7 +460,7 @@ bluetooth:v0097*
ID_VENDOR_FROM_DATABASE=Bluetrek Technologies Limited
bluetooth:v0098*
- ID_VENDOR_FROM_DATABASE=zero1.tv GmbH
+ ID_VENDOR_FROM_DATABASE=zer01.tv GmbH
bluetooth:v0099*
ID_VENDOR_FROM_DATABASE=i.Tech Dynamic Global Distribution Ltd.
@@ -511,7 +511,7 @@ bluetooth:v00A8*
ID_VENDOR_FROM_DATABASE=ARP Devices Limited
bluetooth:v00A9*
- ID_VENDOR_FROM_DATABASE=Magneti Marelli S.p.A.
+ ID_VENDOR_FROM_DATABASE=Magneti Marelli S.p.A
bluetooth:v00AA*
ID_VENDOR_FROM_DATABASE=CAEN RFID srl
@@ -539,3 +539,180 @@ bluetooth:v00B1*
bluetooth:v00B2*
ID_VENDOR_FROM_DATABASE=Bekey A/S
+
+bluetooth:v00B3*
+ ID_VENDOR_FROM_DATABASE=Clarinox Technologies Pty. Ltd.
+
+bluetooth:v00B4*
+ ID_VENDOR_FROM_DATABASE=BDE Technology Co., Ltd.
+
+bluetooth:v00B5*
+ ID_VENDOR_FROM_DATABASE=Swirl Networks
+
+bluetooth:v00B6*
+ ID_VENDOR_FROM_DATABASE=Meso international
+
+bluetooth:v00B7*
+ ID_VENDOR_FROM_DATABASE=TreLab Ltd
+
+bluetooth:v00B8*
+ ID_VENDOR_FROM_DATABASE=Qualcomm Innovation Center, Inc. (QuIC)
+
+bluetooth:v00B9*
+ ID_VENDOR_FROM_DATABASE=Johnson Controls, Inc.
+
+bluetooth:v00BA*
+ ID_VENDOR_FROM_DATABASE=Starkey Laboratories Inc.
+
+bluetooth:v00BB*
+ ID_VENDOR_FROM_DATABASE=S-Power Electronics Limited
+
+bluetooth:v00BC*
+ ID_VENDOR_FROM_DATABASE=Ace Sensor Inc
+
+bluetooth:v00BD*
+ ID_VENDOR_FROM_DATABASE=Aplix Corporation
+
+bluetooth:v00BE*
+ ID_VENDOR_FROM_DATABASE=AAMP of America
+
+bluetooth:v00BF*
+ ID_VENDOR_FROM_DATABASE=Stalmart Technology Limited
+
+bluetooth:v00C0*
+ ID_VENDOR_FROM_DATABASE=AMICCOM Electronics Corporation
+
+bluetooth:v00C1*
+ ID_VENDOR_FROM_DATABASE=Shenzhen Excelsecu Data Technology Co.,Ltd
+
+bluetooth:v00C2*
+ ID_VENDOR_FROM_DATABASE=Geneq Inc.
+
+bluetooth:v00C3*
+ ID_VENDOR_FROM_DATABASE=adidas AG
+
+bluetooth:v00C4*
+ ID_VENDOR_FROM_DATABASE=LG Electronics
+
+bluetooth:v00C5*
+ ID_VENDOR_FROM_DATABASE=Onset Computer Corporation
+
+bluetooth:v00C6*
+ ID_VENDOR_FROM_DATABASE=Selfly BV
+
+bluetooth:v00C7*
+ ID_VENDOR_FROM_DATABASE=Quuppa Oy.
+
+bluetooth:v00C8*
+ ID_VENDOR_FROM_DATABASE=GeLo Inc
+
+bluetooth:v00C9*
+ ID_VENDOR_FROM_DATABASE=Evluma
+
+bluetooth:v00CA*
+ ID_VENDOR_FROM_DATABASE=MC10
+
+bluetooth:v00CB*
+ ID_VENDOR_FROM_DATABASE=Binauric SE
+
+bluetooth:v00CC*
+ ID_VENDOR_FROM_DATABASE=Beats Electronics
+
+bluetooth:v00CD*
+ ID_VENDOR_FROM_DATABASE=Microchip Technology Inc.
+
+bluetooth:v00CE*
+ ID_VENDOR_FROM_DATABASE=Elgato Systems GmbH
+
+bluetooth:v00CF*
+ ID_VENDOR_FROM_DATABASE=ARCHOS SA
+
+bluetooth:v00D1*
+ ID_VENDOR_FROM_DATABASE=Polar Electro Europe B.V.
+
+bluetooth:v00D2*
+ ID_VENDOR_FROM_DATABASE=Dialog Semiconductor B.V.
+
+bluetooth:v00D3*
+ ID_VENDOR_FROM_DATABASE=Taixingbang Technology (HK) Co,. LTD.
+
+bluetooth:v00D4*
+ ID_VENDOR_FROM_DATABASE=Kawantech
+
+bluetooth:v00D5*
+ ID_VENDOR_FROM_DATABASE=Austco Communication Systems
+
+bluetooth:v00D6*
+ ID_VENDOR_FROM_DATABASE=Timex Group USA, Inc.
+
+bluetooth:v00D7*
+ ID_VENDOR_FROM_DATABASE=Qualcomm Technologies, Inc.
+
+bluetooth:v00D8*
+ ID_VENDOR_FROM_DATABASE=Qualcomm Connected Experiences, Inc.
+
+bluetooth:v00D9*
+ ID_VENDOR_FROM_DATABASE=Voyetra Turtle Beach
+
+bluetooth:v00DA*
+ ID_VENDOR_FROM_DATABASE=txtr GmbH
+
+bluetooth:v00DB*
+ ID_VENDOR_FROM_DATABASE=Biosentronics
+
+bluetooth:v00DC*
+ ID_VENDOR_FROM_DATABASE=Procter & Gamble
+
+bluetooth:v00DD*
+ ID_VENDOR_FROM_DATABASE=Hosiden Corporation
+
+bluetooth:v00DE*
+ ID_VENDOR_FROM_DATABASE=Muzik LLC
+
+bluetooth:v00DF*
+ ID_VENDOR_FROM_DATABASE=Misfit Wearables Corp
+
+bluetooth:v00E0*
+ ID_VENDOR_FROM_DATABASE=Google
+
+bluetooth:v00E1*
+ ID_VENDOR_FROM_DATABASE=Danlers Ltd
+
+bluetooth:v00E2*
+ ID_VENDOR_FROM_DATABASE=Semilink Inc
+
+bluetooth:v00E3*
+ ID_VENDOR_FROM_DATABASE=inMusic Brands, Inc
+
+bluetooth:v00E4*
+ ID_VENDOR_FROM_DATABASE=L.S. Research Inc.
+
+bluetooth:v00E5*
+ ID_VENDOR_FROM_DATABASE=Eden Software Consultants Ltd.
+
+bluetooth:v00E6*
+ ID_VENDOR_FROM_DATABASE=Freshtemp
+
+bluetooth:v00E7*
+ ID_VENDOR_FROM_DATABASE=KS Technologies
+
+bluetooth:v00E8*
+ ID_VENDOR_FROM_DATABASE=ACTS Technologies
+
+bluetooth:v00E9*
+ ID_VENDOR_FROM_DATABASE=Vtrack Systems
+
+bluetooth:v00EA*
+ ID_VENDOR_FROM_DATABASE=Nielsen-Kellerman Company
+
+bluetooth:v00EB*
+ ID_VENDOR_FROM_DATABASE=Server Technology, Inc.
+
+bluetooth:v00EC*
+ ID_VENDOR_FROM_DATABASE=BioResearch Associates
+
+bluetooth:v00ED*
+ ID_VENDOR_FROM_DATABASE=Jolly Logic, LLC
+
+bluetooth:v00EE*
+ ID_VENDOR_FROM_DATABASE=Above Average Outcomes, Inc.

View File

@ -0,0 +1,81 @@
From c0658e1948c301177b1527227be0c18932cd7cce Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 26 Nov 2013 18:39:42 +0100
Subject: [PATCH] journal: when appending to journal file, allocate larger
blocks at once
(cherry picked from commit a676e66535e12458ea6d366a653f8dd60f982504)
Conflicts:
src/journal/journal-file.c
---
src/journal/journal-file.c | 26 +++++++++++++++++---------
1 file changed, 17 insertions(+), 9 deletions(-)
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index 425e38a..d1b8433 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -68,6 +68,9 @@
/* How many entries to keep in the entry array chain cache at max */
#define CHAIN_CACHE_MAX 20
+/* How much to increase the journal file size at once each time we allocate something new. */
+#define FILE_SIZE_INCREASE (8ULL*1024ULL*1024ULL) /* 8MB */
+
int journal_file_set_online(JournalFile *f) {
assert(f);
@@ -218,8 +221,7 @@ static int journal_file_refresh_header(JournalFile *f) {
journal_file_set_online(f);
/* Sync the online state to disk */
- msync(f->header, PAGE_ALIGN(sizeof(Header)), MS_SYNC);
- fdatasync(f->fd);
+ fsync(f->fd);
return 0;
}
@@ -313,7 +315,7 @@ static int journal_file_verify_header(JournalFile *f) {
}
static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size) {
- uint64_t old_size, new_size;
+ uint64_t old_size, new_size, file_size;
int r;
assert(f);
@@ -333,12 +335,10 @@ static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size)
if (new_size <= old_size)
return 0;
- if (f->metrics.max_size > 0 &&
- new_size > f->metrics.max_size)
+ if (f->metrics.max_size > 0 && new_size > f->metrics.max_size)
return -E2BIG;
- if (new_size > f->metrics.min_size &&
- f->metrics.keep_free > 0) {
+ if (new_size > f->metrics.min_size && f->metrics.keep_free > 0) {
struct statvfs svfs;
if (fstatvfs(f->fd, &svfs) >= 0) {
@@ -363,8 +363,16 @@ static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size)
if (r != 0)
return -r;
- if (fstat(f->fd, &f->last_stat) < 0)
- return -errno;
+ /* Increase the file size a bit further than this, so that we
+ * we can create larger memory maps to cache */
+ file_size = ((new_size+FILE_SIZE_INCREASE-1) / FILE_SIZE_INCREASE) * FILE_SIZE_INCREASE;
+ if (file_size > (uint64_t) f->last_stat.st_size) {
+ if (file_size > new_size)
+ ftruncate(f->fd, file_size);
+
+ if (fstat(f->fd, &f->last_stat) < 0)
+ return -errno;
+ }
f->header->arena_size = htole64(new_size - le64toh(f->header->header_size));

View File

@ -0,0 +1,44 @@
From 1ae9614a4373029f3f2464cf4d8e61641f1a50a6 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 26 Nov 2013 18:40:23 +0100
Subject: [PATCH] journal: make table const
(cherry picked from commit b8e891e699e1336c5527f8203e4e8f67c9bbeb84)
---
src/journal/journal-file.c | 2 +-
src/journal/journal-file.h | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index d1b8433..d3bdaea 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -401,7 +401,7 @@ static int journal_file_move_to(JournalFile *f, int context, bool keep_always, u
static uint64_t minimum_header_size(Object *o) {
- static uint64_t table[] = {
+ static const uint64_t table[] = {
[OBJECT_DATA] = sizeof(DataObject),
[OBJECT_FIELD] = sizeof(FieldObject),
[OBJECT_ENTRY] = sizeof(EntryObject),
diff --git a/src/journal/journal-file.h b/src/journal/journal-file.h
index 5cc2c2d..50bdb67 100644
--- a/src/journal/journal-file.h
+++ b/src/journal/journal-file.h
@@ -54,11 +54,11 @@ typedef struct JournalFile {
int flags;
int prot;
- bool writable;
- bool compress;
- bool seal;
+ bool writable:1;
+ bool compress:1;
+ bool seal:1;
- bool tail_entry_monotonic_valid;
+ bool tail_entry_monotonic_valid:1;
direction_t last_direction;

View File

@ -0,0 +1,92 @@
From dd186998dd408c54ffe30df1cc35422e645e0ca2 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 26 Nov 2013 18:58:44 +0100
Subject: [PATCH] journald: keep statistics on how of we hit/miss the mmap
cache
(cherry picked from commit bf807d4dbf27c783db8dfd7f4eca321ae4be5b00)
---
src/journal/mmap-cache.c | 25 +++++++++++++++++++++++--
src/journal/mmap-cache.h | 3 +++
src/journal/sd-journal.c | 4 +++-
3 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/src/journal/mmap-cache.c b/src/journal/mmap-cache.c
index 03b57be..42a8a7d 100644
--- a/src/journal/mmap-cache.c
+++ b/src/journal/mmap-cache.c
@@ -72,6 +72,9 @@ struct MMapCache {
int n_ref;
unsigned n_windows;
+ unsigned n_hit, n_missed;
+
+
Hashmap *fds;
Hashmap *contexts;
@@ -542,13 +545,19 @@ int mmap_cache_get(
/* Check whether the current context is the right one already */
r = try_context(m, fd, prot, context, keep_always, offset, size, ret);
- if (r != 0)
+ if (r != 0) {
+ m->n_hit ++;
return r;
+ }
/* Search for a matching mmap */
r = find_mmap(m, fd, prot, context, keep_always, offset, size, ret);
- if (r != 0)
+ if (r != 0) {
+ m->n_hit ++;
return r;
+ }
+
+ m->n_missed++;
/* Create a new mmap */
return add_mmap(m, fd, prot, context, keep_always, offset, size, st, ret);
@@ -578,3 +587,15 @@ void mmap_cache_close_context(MMapCache *m, unsigned context) {
context_free(c);
}
+
+unsigned mmap_cache_get_hit(MMapCache *m) {
+ assert(m);
+
+ return m->n_hit;
+}
+
+unsigned mmap_cache_get_missed(MMapCache *m) {
+ assert(m);
+
+ return m->n_missed;
+}
diff --git a/src/journal/mmap-cache.h b/src/journal/mmap-cache.h
index 0c42fb8..912336d 100644
--- a/src/journal/mmap-cache.h
+++ b/src/journal/mmap-cache.h
@@ -34,3 +34,6 @@ MMapCache* mmap_cache_unref(MMapCache *m);
int mmap_cache_get(MMapCache *m, int fd, int prot, unsigned context, bool keep_always, uint64_t offset, size_t size, struct stat *st, void **ret);
void mmap_cache_close_fd(MMapCache *m, int fd);
void mmap_cache_close_context(MMapCache *m, unsigned context);
+
+unsigned mmap_cache_get_hit(MMapCache *m);
+unsigned mmap_cache_get_missed(MMapCache *m);
diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
index 9676f0f..52abbe9 100644
--- a/src/journal/sd-journal.c
+++ b/src/journal/sd-journal.c
@@ -1831,8 +1831,10 @@ _public_ void sd_journal_close(sd_journal *j) {
if (j->inotify_fd >= 0)
close_nointr_nofail(j->inotify_fd);
- if (j->mmap)
+ if (j->mmap) {
+ log_debug("mmap cache statistics: %u hit, %u miss", mmap_cache_get_hit(j->mmap), mmap_cache_get_missed(j->mmap));
mmap_cache_unref(j->mmap);
+ }
free(j->path);
free(j->unique_field);

View File

@ -0,0 +1,246 @@
From a460644e808ed7671e28ef8231ee590317371fed Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 26 Nov 2013 20:37:53 +0100
Subject: [PATCH] journal: optimize bisection logic a bit by caching the last
position
This way we can do a quick restart limiting a bit how wildly we need to
jump around during the bisection process.
(cherry picked from commit f268980d2cee694fa4118a71402a47c316af0425)
---
src/journal/journal-file.c | 134 +++++++++++++++++++++++++++++++++------------
1 file changed, 99 insertions(+), 35 deletions(-)
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index d3bdaea..02f7554 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -1366,6 +1366,7 @@ typedef struct ChainCacheItem {
uint64_t array; /* the cached array */
uint64_t begin; /* the first item in the cached array */
uint64_t total; /* the total number of items in all arrays before this one in the chain */
+ uint64_t last_index; /* the last index we looked at, to optimize locality when bisecting */
} ChainCacheItem;
static void chain_cache_put(
@@ -1374,7 +1375,8 @@ static void chain_cache_put(
uint64_t first,
uint64_t array,
uint64_t begin,
- uint64_t total) {
+ uint64_t total,
+ uint64_t last_index) {
if (!ci) {
/* If the chain item to cache for this chain is the
@@ -1402,12 +1404,14 @@ static void chain_cache_put(
ci->array = array;
ci->begin = begin;
ci->total = total;
+ ci->last_index = last_index;
}
-static int generic_array_get(JournalFile *f,
- uint64_t first,
- uint64_t i,
- Object **ret, uint64_t *offset) {
+static int generic_array_get(
+ JournalFile *f,
+ uint64_t first,
+ uint64_t i,
+ Object **ret, uint64_t *offset) {
Object *o;
uint64_t p = 0, a, t = 0;
@@ -1448,7 +1452,7 @@ static int generic_array_get(JournalFile *f,
found:
/* Let's cache this item for the next invocation */
- chain_cache_put(f->chain_cache, ci, first, a, o->entry_array.items[0], t);
+ chain_cache_put(f->chain_cache, ci, first, a, o->entry_array.items[0], t, i);
r = journal_file_move_to_object(f, OBJECT_ENTRY, p, &o);
if (r < 0)
@@ -1463,11 +1467,12 @@ found:
return 1;
}
-static int generic_array_get_plus_one(JournalFile *f,
- uint64_t extra,
- uint64_t first,
- uint64_t i,
- Object **ret, uint64_t *offset) {
+static int generic_array_get_plus_one(
+ JournalFile *f,
+ uint64_t extra,
+ uint64_t first,
+ uint64_t i,
+ Object **ret, uint64_t *offset) {
Object *o;
@@ -1498,17 +1503,18 @@ enum {
TEST_RIGHT
};
-static int generic_array_bisect(JournalFile *f,
- uint64_t first,
- uint64_t n,
- uint64_t needle,
- int (*test_object)(JournalFile *f, uint64_t p, uint64_t needle),
- direction_t direction,
- Object **ret,
- uint64_t *offset,
- uint64_t *idx) {
-
- uint64_t a, p, t = 0, i = 0, last_p = 0;
+static int generic_array_bisect(
+ JournalFile *f,
+ uint64_t first,
+ uint64_t n,
+ uint64_t needle,
+ int (*test_object)(JournalFile *f, uint64_t p, uint64_t needle),
+ direction_t direction,
+ Object **ret,
+ uint64_t *offset,
+ uint64_t *idx) {
+
+ uint64_t a, p, t = 0, i = 0, last_p = 0, last_index = (uint64_t) -1;
bool subtract_one = false;
Object *o, *array = NULL;
int r;
@@ -1533,7 +1539,7 @@ static int generic_array_bisect(JournalFile *f,
return r;
if (r == TEST_LEFT) {
- /* OK, what we are looking for is right of th
+ /* OK, what we are looking for is right of the
* begin of this EntryArray, so let's jump
* straight to previously cached array in the
* chain */
@@ -1541,6 +1547,7 @@ static int generic_array_bisect(JournalFile *f,
a = ci->array;
n -= ci->total;
t = ci->total;
+ last_index = ci->last_index;
}
}
@@ -1571,6 +1578,60 @@ static int generic_array_bisect(JournalFile *f,
if (r == TEST_RIGHT) {
left = 0;
right -= 1;
+
+ if (last_index != (uint64_t) -1) {
+ assert(last_index <= right);
+
+ /* If we cached the last index we
+ * looked at, let's try to not to jump
+ * too wildly around and see if we can
+ * limit the range to look at early to
+ * the immediate neighbors of the last
+ * index we looked at. */
+
+ if (last_index > 0) {
+ uint64_t x = last_index - 1;
+
+ p = le64toh(array->entry_array.items[x]);
+ if (p <= 0)
+ return -EBADMSG;
+
+ r = test_object(f, p, needle);
+ if (r < 0)
+ return r;
+
+ if (r == TEST_FOUND)
+ r = direction == DIRECTION_DOWN ? TEST_RIGHT : TEST_LEFT;
+
+ if (r == TEST_RIGHT)
+ right = x;
+ else
+ left = x + 1;
+ }
+
+ if (last_index < right) {
+ uint64_t y = last_index + 1;
+
+ p = le64toh(array->entry_array.items[y]);
+ if (p <= 0)
+ return -EBADMSG;
+
+ r = test_object(f, p, needle);
+ if (r < 0)
+ return r;
+
+ if (r == TEST_FOUND)
+ r = direction == DIRECTION_DOWN ? TEST_RIGHT : TEST_LEFT;
+
+ if (r == TEST_RIGHT)
+ right = y;
+ else
+ left = y + 1;
+ }
+
+ last_index = (uint64_t) -1;
+ }
+
for (;;) {
if (left == right) {
if (direction == DIRECTION_UP)
@@ -1581,8 +1642,8 @@ static int generic_array_bisect(JournalFile *f,
}
assert(left < right);
-
i = (left + right) / 2;
+
p = le64toh(array->entry_array.items[i]);
if (p <= 0)
return -EBADMSG;
@@ -1615,6 +1676,7 @@ static int generic_array_bisect(JournalFile *f,
n -= k;
t += k;
+ last_index = (uint64_t) -1;
a = le64toh(array->entry_array.next_entry_array_offset);
}
@@ -1625,7 +1687,7 @@ found:
return 0;
/* Let's cache this item for the next invocation */
- chain_cache_put(f->chain_cache, ci, first, a, array->entry_array.items[0], t);
+ chain_cache_put(f->chain_cache, ci, first, a, array->entry_array.items[0], t, i + (subtract_one ? -1 : 0));
if (subtract_one && i == 0)
p = last_p;
@@ -1650,16 +1712,18 @@ found:
return 1;
}
-static int generic_array_bisect_plus_one(JournalFile *f,
- uint64_t extra,
- uint64_t first,
- uint64_t n,
- uint64_t needle,
- int (*test_object)(JournalFile *f, uint64_t p, uint64_t needle),
- direction_t direction,
- Object **ret,
- uint64_t *offset,
- uint64_t *idx) {
+
+static int generic_array_bisect_plus_one(
+ JournalFile *f,
+ uint64_t extra,
+ uint64_t first,
+ uint64_t n,
+ uint64_t needle,
+ int (*test_object)(JournalFile *f, uint64_t p, uint64_t needle),
+ direction_t direction,
+ Object **ret,
+ uint64_t *offset,
+ uint64_t *idx) {
int r;
bool step_back = false;

View File

@ -0,0 +1,24 @@
From 6ddc0196df2400e440e4bddbcc4ce32c636a7ec1 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 27 Nov 2013 00:58:39 +0100
Subject: [PATCH] journal: fix iteration when we go backwards from the
beginning of an array chain element
(cherry picked from commit e5462cd80e5328a769137c261c93931ea0c27bab)
---
src/journal/journal-file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index 02f7554..4e22e08 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -1687,7 +1687,7 @@ found:
return 0;
/* Let's cache this item for the next invocation */
- chain_cache_put(f->chain_cache, ci, first, a, array->entry_array.items[0], t, i + (subtract_one ? -1 : 0));
+ chain_cache_put(f->chain_cache, ci, first, a, array->entry_array.items[0], t, subtract_one ? (i > 0 ? i-1 : (uint64_t) -1) : i);
if (subtract_one && i == 0)
p = last_p;

View File

@ -0,0 +1,26 @@
From 00a827da3737dc95c2561292c03468fc96f53f14 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 27 Nov 2013 00:59:07 +0100
Subject: [PATCH] journal: allow journal_file_copy_entry() to work on non-local
files
(cherry picked from commit 248c78c79c5cca9b981800d816a77591e504066a)
---
src/journal/journal-file.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index 4e22e08..e0abddf 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -2739,10 +2739,6 @@ int journal_file_copy_entry(JournalFile *from, JournalFile *to, Object *o, uint6
ts.monotonic = le64toh(o->entry.monotonic);
ts.realtime = le64toh(o->entry.realtime);
- if (to->tail_entry_monotonic_valid &&
- ts.monotonic < le64toh(to->header->tail_entry_monotonic))
- return -EINVAL;
-
n = journal_file_entry_n_items(o);
items = alloca(sizeof(EntryItem) * n);

View File

@ -0,0 +1,60 @@
From ab3ada57a761fde9050d7452f6bd9d897b9067ec Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 27 Nov 2013 01:44:52 +0100
Subject: [PATCH] journal: simplify pre-allocation logic
let's just do a single fallocate() as far as possible, and don't
distuingish between allocated space and file size.
This way we can save a syscall for each append, which makes quite some
benefits.
(cherry picked from commit eda4b58b50509dc8ad0428a46e20f6c5cf516d58)
---
src/journal/journal-file.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index e0abddf..090cf97 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -315,7 +315,7 @@ static int journal_file_verify_header(JournalFile *f) {
}
static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size) {
- uint64_t old_size, new_size, file_size;
+ uint64_t old_size, new_size;
int r;
assert(f);
@@ -356,6 +356,11 @@ static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size)
}
}
+ /* Increase by larger blocks at once */
+ new_size = ((new_size+FILE_SIZE_INCREASE-1) / FILE_SIZE_INCREASE) * FILE_SIZE_INCREASE;
+ if (f->metrics.max_size > 0 && new_size > f->metrics.max_size)
+ new_size = f->metrics.max_size;
+
/* Note that the glibc fallocate() fallback is very
inefficient, hence we try to minimize the allocation area
as we can. */
@@ -363,16 +368,8 @@ static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size)
if (r != 0)
return -r;
- /* Increase the file size a bit further than this, so that we
- * we can create larger memory maps to cache */
- file_size = ((new_size+FILE_SIZE_INCREASE-1) / FILE_SIZE_INCREASE) * FILE_SIZE_INCREASE;
- if (file_size > (uint64_t) f->last_stat.st_size) {
- if (file_size > new_size)
- ftruncate(f->fd, file_size);
-
- if (fstat(f->fd, &f->last_stat) < 0)
- return -errno;
- }
+ if (fstat(f->fd, &f->last_stat) < 0)
+ return -errno;
f->header->arena_size = htole64(new_size - le64toh(f->header->header_size));

View File

@ -0,0 +1,56 @@
From f201d0f2ca7adcfcbb854a83ff9a75b40ace7967 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 27 Nov 2013 01:54:25 +0100
Subject: [PATCH] journald: mention how long we needed to flush to /var in the
logs
(cherry picked from commit fbb634117d0b0ebd5b105e65b141e75ae9af7f8f)
---
src/journal/journald-server.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index e03e413..a0a8e9c 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -968,9 +968,12 @@ static int system_journal_open(Server *s) {
}
int server_flush_to_var(Server *s) {
- int r;
sd_id128_t machine;
sd_journal *j = NULL;
+ char ts[FORMAT_TIMESPAN_MAX];
+ usec_t start;
+ unsigned n = 0;
+ int r;
assert(s);
@@ -988,6 +991,8 @@ int server_flush_to_var(Server *s) {
log_debug("Flushing to /var...");
+ start = now(CLOCK_MONOTONIC);
+
r = sd_id128_get_machine(&machine);
if (r < 0)
return r;
@@ -1007,6 +1012,8 @@ int server_flush_to_var(Server *s) {
f = j->current_file;
assert(f && f->current_offset > 0);
+ n++;
+
r = journal_file_move_to_object(f, OBJECT_ENTRY, f->current_offset, &o);
if (r < 0) {
log_error("Can't read entry: %s", strerror(-r));
@@ -1050,6 +1057,8 @@ finish:
sd_journal_close(j);
+ server_driver_message(s, SD_ID128_NULL, "Time spent on flushing to /var is %s for %u entries.", format_timespan(ts, sizeof(ts), now(CLOCK_MONOTONIC) - start, 0), n);
+
return r;
}

View File

@ -0,0 +1,26 @@
From e64e35b2f24f0a2979d435a752d2ab141c5a0cc2 Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay@vrfy.org>
Date: Thu, 28 Nov 2013 01:25:10 +0100
Subject: [PATCH] automount: log info about triggering process
Conflicts:
src/core/automount.c
---
src/core/automount.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/core/automount.c b/src/core/automount.c
index d1379e0..203104e 100644
--- a/src/core/automount.c
+++ b/src/core/automount.c
@@ -776,8 +776,8 @@ static void automount_fd_event(Unit *u, int fd, uint32_t events, Watch *w) {
_cleanup_free_ char *p = NULL;
get_process_comm(packet.v5_packet.pid, &p);
- log_debug_unit(u->id,
- "Got direct mount request on %s, triggered by %lu (%s)",
+ log_info_unit(u->id,
+ "Got automount request for %s, triggered by %lu (%s)",
a->where, (unsigned long) packet.v5_packet.pid, strna(p));
} else
log_debug_unit(u->id, "Got direct mount request on %s", a->where);

View File

@ -0,0 +1,205 @@
From 4931213c9f9fed23c4a103eda1ee19aa06b9f613 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Thu, 28 Nov 2013 13:34:08 -0500
Subject: [PATCH] virt: split detect_vm into separate functions
It didn't build on arm. Let's simplify it a bit by
splitting x86 specific parts out, which should also make
things easier when arm virtualization support is added.
---
src/shared/virt.c | 140 +++++++++++++++++++++++++++++++-----------------------
1 file changed, 81 insertions(+), 59 deletions(-)
diff --git a/src/shared/virt.c b/src/shared/virt.c
index 537ccda..4e18638 100644
--- a/src/shared/virt.c
+++ b/src/shared/virt.c
@@ -27,30 +27,10 @@
#include "virt.h"
#include "fileio.h"
-/* Returns a short identifier for the various VM implementations */
-int detect_vm(const char **id) {
- _cleanup_free_ char *cpuinfo_contents = NULL;
- int r;
-
-#if defined(__i386__) || defined(__x86_64__)
+static int detect_vm_cpuid(const char **_id) {
/* Both CPUID and DMI are x86 specific interfaces... */
-
- static const char *const dmi_vendors[] = {
- "/sys/class/dmi/id/sys_vendor",
- "/sys/class/dmi/id/board_vendor",
- "/sys/class/dmi/id/bios_vendor"
- };
-
- static const char dmi_vendor_table[] =
- "QEMU\0" "qemu\0"
- /* http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1009458 */
- "VMware\0" "vmware\0"
- "VMW\0" "vmware\0"
- "Microsoft Corporation\0" "microsoft\0"
- "innotek GmbH\0" "oracle\0"
- "Xen\0" "xen\0"
- "Bochs\0" "bochs\0";
+#if defined(__i386__) || defined(__x86_64__)
static const char cpuid_vendor_table[] =
"XenVMMXenVMM\0" "xen\0"
@@ -60,40 +40,13 @@ int detect_vm(const char **id) {
/* http://msdn.microsoft.com/en-us/library/ff542428.aspx */
"Microsoft Hv\0" "microsoft\0";
- static __thread int cached_found = -1;
- static __thread const char *cached_id = NULL;
-
uint32_t eax, ecx;
union {
uint32_t sig32[3];
char text[13];
} sig = {};
- unsigned i;
const char *j, *k;
bool hypervisor;
- _cleanup_free_ char *hvtype = NULL;
- const char *_id = NULL;
-
- if (_likely_(cached_found >= 0)) {
-
- if (id)
- *id = cached_id;
-
- return cached_found;
- }
-
- /* Try high-level hypervisor sysfs file first:
- *
- * https://bugs.freedesktop.org/show_bug.cgi?id=61491 */
- r = read_one_line_file("/sys/hypervisor/type", &hvtype);
- if (r >= 0) {
- if (streq(hvtype, "xen")) {
- _id = "xen";
- r = 1;
- goto finish;
- }
- } else if (r != -ENOENT)
- return r;
/* http://lwn.net/Articles/301888/ */
@@ -136,14 +89,44 @@ int detect_vm(const char **id) {
NULSTR_FOREACH_PAIR(j, k, cpuid_vendor_table)
if (streq(sig.text, j)) {
- _id = k;
- r = 1;
- goto finish;
+ *_id = k;
+ return 1;
}
+
+ *_id = "other";
+ return 0;
}
+#endif
+
+ return 0;
+}
+
+static int detect_vm_dmi(const char **_id) {
+
+ /* Both CPUID and DMI are x86 specific interfaces... */
+#if defined(__i386__) || defined(__x86_64__)
+
+ static const char *const dmi_vendors[] = {
+ "/sys/class/dmi/id/sys_vendor",
+ "/sys/class/dmi/id/board_vendor",
+ "/sys/class/dmi/id/bios_vendor"
+ };
+
+ static const char dmi_vendor_table[] =
+ "QEMU\0" "qemu\0"
+ /* http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1009458 */
+ "VMware\0" "vmware\0"
+ "VMW\0" "vmware\0"
+ "Microsoft Corporation\0" "microsoft\0"
+ "innotek GmbH\0" "oracle\0"
+ "Xen\0" "xen\0"
+ "Bochs\0" "bochs\0";
+ unsigned i;
for (i = 0; i < ELEMENTSOF(dmi_vendors); i++) {
_cleanup_free_ char *s = NULL;
+ const char *j, *k;
+ int r;
r = read_one_line_file(dmi_vendors[i], &s);
if (r < 0) {
@@ -155,20 +138,59 @@ int detect_vm(const char **id) {
NULSTR_FOREACH_PAIR(j, k, dmi_vendor_table)
if (startswith(s, j)) {
- _id = k;
- r = 1;
- goto finish;
+ *_id = k;
+ return 1;
}
}
+#endif
- if (hypervisor || hvtype) {
- _id = "other";
+ return 0;
+}
+
+/* Returns a short identifier for the various VM implementations */
+int detect_vm(const char **id) {
+ _cleanup_free_ char *hvtype = NULL, *cpuinfo_contents = NULL;
+ static __thread int cached_found = -1;
+ static __thread const char *cached_id = NULL;
+ const char *_id = NULL;
+ int r;
+
+ if (_likely_(cached_found >= 0)) {
+
+ if (id)
+ *id = cached_id;
+
+ return cached_found;
+ }
+
+ /* Try high-level hypervisor sysfs file first:
+ *
+ * https://bugs.freedesktop.org/show_bug.cgi?id=61491 */
+ r = read_one_line_file("/sys/hypervisor/type", &hvtype);
+ if (r >= 0) {
+ if (streq(hvtype, "xen")) {
+ _id = "xen";
+ r = 1;
+ goto finish;
+ }
+ } else if (r != -ENOENT)
+ return r;
+
+ /* this will set _id to "other" and return 0 for unknown hypervisors */
+ r = detect_vm_cpuid(&_id);
+ if (r != 0)
+ goto finish;
+
+ r = detect_vm_dmi(&_id);
+ if (r != 0)
+ goto finish;
+
+ if (_id) {
+ /* "other" */
r = 1;
goto finish;
}
-#endif
-
/* Detect User-Mode Linux by reading /proc/cpuinfo */
r = read_full_file("/proc/cpuinfo", &cpuinfo_contents, NULL);
if (r < 0)

View File

@ -0,0 +1,147 @@
From 123cc4b594188a5caed955e77228a37001ee451f Mon Sep 17 00:00:00 2001
From: Marcel Holtmann <marcel@holtmann.org>
Date: Fri, 29 Nov 2013 07:26:47 -0800
Subject: [PATCH] hwdb: Update database of Bluetooth company identifiers
---
hwdb/20-bluetooth-vendor-product.hwdb | 109 +++++++++++++++++++++++++++++++++-
1 file changed, 107 insertions(+), 2 deletions(-)
diff --git a/hwdb/20-bluetooth-vendor-product.hwdb b/hwdb/20-bluetooth-vendor-product.hwdb
index faecf42..dcc25bb 100644
--- a/hwdb/20-bluetooth-vendor-product.hwdb
+++ b/hwdb/20-bluetooth-vendor-product.hwdb
@@ -366,6 +366,9 @@ bluetooth:v0077*
bluetooth:v0078*
ID_VENDOR_FROM_DATABASE=Nike, Inc.
+bluetooth:v0078p0001*
+ ID_PRODUCT_FROM_DATABASE=Nike+ FuelBand
+
bluetooth:v0079*
ID_VENDOR_FROM_DATABASE=lesswire AG
@@ -457,7 +460,7 @@ bluetooth:v0096*
ID_VENDOR_FROM_DATABASE=ODM Technology, Inc.
bluetooth:v0097*
- ID_VENDOR_FROM_DATABASE=Bluetrek Technologies Limited
+ ID_VENDOR_FROM_DATABASE=ConnecteDevice Ltd.
bluetooth:v0098*
ID_VENDOR_FROM_DATABASE=zer01.tv GmbH
@@ -634,7 +637,7 @@ bluetooth:v00D2*
ID_VENDOR_FROM_DATABASE=Dialog Semiconductor B.V.
bluetooth:v00D3*
- ID_VENDOR_FROM_DATABASE=Taixingbang Technology (HK) Co,. LTD.
+ ID_VENDOR_FROM_DATABASE=Taixingbang Technology (HK) Co,. LTD.
bluetooth:v00D4*
ID_VENDOR_FROM_DATABASE=Kawantech
@@ -716,3 +719,105 @@ bluetooth:v00ED*
bluetooth:v00EE*
ID_VENDOR_FROM_DATABASE=Above Average Outcomes, Inc.
+
+bluetooth:v00EF*
+ ID_VENDOR_FROM_DATABASE=Bitsplitters GmbH
+
+bluetooth:v00F0*
+ ID_VENDOR_FROM_DATABASE=PayPal, Inc.
+
+bluetooth:v00F1*
+ ID_VENDOR_FROM_DATABASE=Witron Technology Limited
+
+bluetooth:v00F2*
+ ID_VENDOR_FROM_DATABASE=Morse Project Inc.
+
+bluetooth:v00F3*
+ ID_VENDOR_FROM_DATABASE=Kent Displays Inc.
+
+bluetooth:v00F4*
+ ID_VENDOR_FROM_DATABASE=Nautilus Inc.
+
+bluetooth:v00F5*
+ ID_VENDOR_FROM_DATABASE=Smartifier Oy
+
+bluetooth:v00F6*
+ ID_VENDOR_FROM_DATABASE=Elcometer Limited
+
+bluetooth:v00F7*
+ ID_VENDOR_FROM_DATABASE=VSN Technologies Inc.
+
+bluetooth:v00F8*
+ ID_VENDOR_FROM_DATABASE=AceUni Corp., Ltd.
+
+bluetooth:v00F9*
+ ID_VENDOR_FROM_DATABASE=StickNFind
+
+bluetooth:v00FA*
+ ID_VENDOR_FROM_DATABASE=Crystal Code AB
+
+bluetooth:v00FB*
+ ID_VENDOR_FROM_DATABASE=KOUKAAM a.s.
+
+bluetooth:v00FC*
+ ID_VENDOR_FROM_DATABASE=Delphi Corporation
+
+bluetooth:v00FD*
+ ID_VENDOR_FROM_DATABASE=ValenceTech Limited
+
+bluetooth:v00FE*
+ ID_VENDOR_FROM_DATABASE=Reserved
+
+bluetooth:v00FF*
+ ID_VENDOR_FROM_DATABASE=Typo Products, LLC
+
+bluetooth:v0100*
+ ID_VENDOR_FROM_DATABASE=TomTom International BV
+
+bluetooth:v0101*
+ ID_VENDOR_FROM_DATABASE=Fugoo, Inc
+
+bluetooth:v0102*
+ ID_VENDOR_FROM_DATABASE=Keiser Corporation
+
+bluetooth:v0103*
+ ID_VENDOR_FROM_DATABASE=Bang & Olufsen A/S
+
+bluetooth:v0104*
+ ID_VENDOR_FROM_DATABASE=PLUS Locations Systems Pty Ltd
+
+bluetooth:v0105*
+ ID_VENDOR_FROM_DATABASE=Ubiquitous Computing Technology Corporation
+
+bluetooth:v0106*
+ ID_VENDOR_FROM_DATABASE=Innovative Yachtter Solutions
+
+bluetooth:v0107*
+ ID_VENDOR_FROM_DATABASE=William Demant Holding A/S
+
+bluetooth:v0108*
+ ID_VENDOR_FROM_DATABASE=Chicony Electronics Co., Ltd.
+
+bluetooth:v0109*
+ ID_VENDOR_FROM_DATABASE=Atus BV
+
+bluetooth:v010A*
+ ID_VENDOR_FROM_DATABASE=Codegate Ltd.
+
+bluetooth:v010B*
+ ID_VENDOR_FROM_DATABASE=ERi, Inc.
+
+bluetooth:v010C*
+ ID_VENDOR_FROM_DATABASE=Transducers Direct, LLC
+
+bluetooth:v010D*
+ ID_VENDOR_FROM_DATABASE=Fujitsu Ten Limited
+
+bluetooth:v010E*
+ ID_VENDOR_FROM_DATABASE=Audi AG
+
+bluetooth:v010F*
+ ID_VENDOR_FROM_DATABASE=HiSilicon Technologies Co., Ltd.
+
+bluetooth:v0110*
+ ID_VENDOR_FROM_DATABASE=Nippon Seiki Co., Ltd.

View File

@ -0,0 +1,23 @@
From cd0e1552ad5d5dffdd0f8a01fa9b451d3e14a60d Mon Sep 17 00:00:00 2001
From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
Date: Sat, 30 Nov 2013 21:59:40 +0100
Subject: [PATCH] sysfs-show.c: return negative error
introduced in 1ca208fb4f93e5869704af1812cbff7130a2fc03
---
src/login/sysfs-show.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/login/sysfs-show.c b/src/login/sysfs-show.c
index 7c1adfa..f7d11dd 100644
--- a/src/login/sysfs-show.c
+++ b/src/login/sysfs-show.c
@@ -164,7 +164,7 @@ int show_sysfs(const char *seat, const char *prefix, unsigned n_columns) {
e = udev_enumerate_new(udev);
if (!e)
- return ENOMEM;
+ return -ENOMEM;
if (!streq(seat, "seat0"))
r = udev_enumerate_add_match_tag(e, seat);

View File

@ -0,0 +1,28 @@
From 05175fd678f6f7f09ff9543cd11bbd7ebf14fe58 Mon Sep 17 00:00:00 2001
From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
Date: Sat, 30 Nov 2013 23:45:31 +0100
Subject: [PATCH] util.c: check if return value from ttyname_r is > 0 instead
of != 0
We must return a negative error code from getttyname_malloc but
that would not be the case if ttyname_r returned a negative value.
ttyname_r should only return EBADF, ENOTTY, or ERANGE so it should
be safe to change.
---
src/shared/util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/shared/util.c b/src/shared/util.c
index 3fc080a..1510c5e 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -2561,7 +2561,7 @@ int getttyname_malloc(int fd, char **r) {
assert(r);
k = ttyname_r(fd, path, sizeof(path));
- if (k != 0)
+ if (k > 0)
return -k;
char_array_0(path);

View File

@ -0,0 +1,38 @@
From bbf5b0815c2561c3a98903160f3193953ba962c6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sat, 30 Nov 2013 20:27:54 -0500
Subject: [PATCH] docs: remove unneeded the's in gudev docs
https://bugs.freedesktop.org/show_bug.cgi?id=72164
---
src/libudev/libudev-device.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/libudev/libudev-device.c b/src/libudev/libudev-device.c
index a644904..161181a 100644
--- a/src/libudev/libudev-device.c
+++ b/src/libudev/libudev-device.c
@@ -980,9 +980,8 @@ static struct udev_device *device_new_from_parent(struct udev_device *udev_devic
* Find the next parent device, and fill in information from the sys
* device and the udev database entry.
*
- * The returned the device is not referenced. It is attached to the
- * child device, and will be cleaned up when the child device
- * is cleaned up.
+ * Returned device is not referenced. It is attached to the child
+ * device, and will be cleaned up when the child device is cleaned up.
*
* It is not necessarily just the upper level directory, empty or not
* recognized sys directories are ignored.
@@ -1016,9 +1015,8 @@ _public_ struct udev_device *udev_device_get_parent(struct udev_device *udev_dev
* If devtype is #NULL, only subsystem is checked, and any devtype will
* match.
*
- * The returned the device is not referenced. It is attached to the
- * child device, and will be cleaned up when the child device
- * is cleaned up.
+ * Returned device is not referenced. It is attached to the child
+ * device, and will be cleaned up when the child device is cleaned up.
*
* It can be called as many times as needed, without caring about
* references.

View File

@ -0,0 +1,235 @@
From 06c5b7a9f3d47834ea4dbbfb24f169b6893dd338 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sat, 30 Nov 2013 21:23:01 -0500
Subject: [PATCH] man: explicitly say when multiple units can be specified
itistoday> how do you specify multiple dependencies in a unit file? i've been
googling and can't find this basic thing :-\
itistoday> do you use a comma, or use multiple After= statements?
---
man/systemd.unit.xml | 128 ++++++++++++++++++++++++++++-----------------------
1 file changed, 70 insertions(+), 58 deletions(-)
diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml
index 5c8b8e8..029392c 100644
--- a/man/systemd.unit.xml
+++ b/man/systemd.unit.xml
@@ -410,10 +410,12 @@
of the other units gets deactivated or
its activation fails, this unit will
be deactivated. This option may be
- specified more than once, in which
- case requirement dependencies for all
- listed names are created. Note that
- requirement dependencies do not
+ specified more than once or multiple
+ space-separated units may be specified
+ in one option in which case
+ requirement dependencies for all
+ listed names will be created. Note
+ that requirement dependencies do not
influence the order in which services
are started or stopped. This has to be
configured independently with the
@@ -476,22 +478,23 @@
<term><varname>RequisiteOverridable=</varname></term>
<listitem><para>Similar to
- <varname>Requires=</varname>
- and <varname>RequiresOverridable=</varname>, respectively. However,
- if a unit listed here is not started
- already it will not be started and the
- transaction fails
- immediately.</para></listitem>
+ <varname>Requires=</varname> and
+ <varname>RequiresOverridable=</varname>,
+ respectively. However, if the units
+ listed here are not started already
+ they will not be started and the
+ transaction will fail immediately.
+ </para></listitem>
</varlistentry>
<varlistentry>
<term><varname>Wants=</varname></term>
<listitem><para>A weaker version of
- <varname>Requires=</varname>. A unit
+ <varname>Requires=</varname>. Units
listed in this option will be started
if the configuring unit is. However,
- if the listed unit fails to start up
+ if the listed units fail to start
or cannot be added to the transaction
this has no impact on the validity of
the transaction as a whole. This is
@@ -501,8 +504,8 @@
<para>Note that dependencies of this
type may also be configured outside of
- the unit configuration file by
- adding a symlink to a
+ the unit configuration file by adding
+ symlinks to a
<filename>.wants/</filename> directory
accompanying the unit file. For
details see above.</para></listitem>
@@ -534,7 +537,7 @@
of units. When systemd stops or restarts
the units listed here, the action is
propagated to this unit.
- Note that this is a one way dependency -
+ Note that this is a one way dependency —
changes to this unit do not affect the
listed units.
</para></listitem>
@@ -543,12 +546,12 @@
<varlistentry>
<term><varname>Conflicts=</varname></term>
- <listitem><para>Configures negative
+ <listitem><para>A space-separated list
+ of unit names. Configures negative
requirement dependencies. If a unit
- has a
- <varname>Conflicts=</varname> setting
- on another unit, starting the former
- will stop the latter and vice
+ has a <varname>Conflicts=</varname>
+ setting on another unit, starting the
+ former will stop the latter and vice
versa. Note that this setting is
independent of and orthogonal to the
<varname>After=</varname> and
@@ -575,7 +578,8 @@
<term><varname>Before=</varname></term>
<term><varname>After=</varname></term>
- <listitem><para>Configures ordering
+ <listitem><para>A space-separated list
+ of unit names. Configures ordering
dependencies between units. If a unit
<filename>foo.service</filename>
contains a setting
@@ -624,18 +628,18 @@
type <varname>After=</varname> or
<varname>Before=</varname>. If two
units have no ordering dependencies
- between them, they are shut down
- or started up simultaneously, and
- no ordering takes
+ between them, they are shut down or
+ started up simultaneously, and no
+ ordering takes
place. </para></listitem>
</varlistentry>
<varlistentry>
<term><varname>OnFailure=</varname></term>
- <listitem><para>Lists one or more
- units that are activated when this
- unit enters the
+ <listitem><para>A space-separated list
+ of one or more units that are
+ activated when this unit enters the
<literal>failed</literal>
state.</para></listitem>
</varlistentry>
@@ -644,16 +648,17 @@
<term><varname>PropagatesReloadTo=</varname></term>
<term><varname>ReloadPropagatedFrom=</varname></term>
- <listitem><para>Lists one or more
- units where reload requests on the
- unit will be propagated to/on the
- other unit will be propagated
- from. Issuing a reload request on a
- unit will automatically also enqueue a
- reload request on all units that the
- reload request shall be propagated to
- via these two
- settings.</para></listitem>
+ <listitem><para>A space-separated list
+ of one or more units where reload
+ requests on this unit will be
+ propagated to, or reload requests on
+ the other unit will be propagated to
+ this unit, respectively. Issuing a
+ reload request on a unit will
+ automatically also enqueue a reload
+ request on all units that the reload
+ request shall be propagated to via
+ these two settings.</para></listitem>
</varlistentry>
<varlistentry>
@@ -1089,32 +1094,34 @@
<varlistentry>
<term><varname>Alias=</varname></term>
- <listitem><para>Additional names this
- unit shall be installed under. The
- names listed here must have the same
- suffix (i.e. type) as the unit file
- name. This option may be specified
- more than once, in which case all
- listed names are used. At installation
- time,
- <command>systemctl enable</command>
- will create symlinks from these names
- to the unit filename.</para></listitem>
+ <listitem><para>A space-seperated list
+ of additional names this unit shall be
+ installed under. The names listed here
+ must have the same suffix (i.e. type)
+ as the unit file name. This option may
+ be specified more than once, in which
+ case all listed names are used. At
+ installation time, <command>systemctl
+ enable</command> will create symlinks
+ from these names to the unit
+ filename.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>WantedBy=</varname></term>
<term><varname>RequiredBy=</varname></term>
- <listitem><para>A symbolic link is
- created in the
- <filename>.wants/</filename> or
- <filename>.requires/</filename> directory
- of the listed unit when this unit is
- activated by <command>systemctl
- enable</command>. This has the effect
- that a dependency of type
- <varname>Wants=</varname> or
+ <listitem><para>This option may be
+ used more than once, or a
+ space-separated list of unit names may
+ be given. A symbolic link is created
+ in the <filename>.wants/</filename> or
+ <filename>.requires/</filename>
+ directory of each of the listed units
+ when this unit is installed by
+ <command>systemctl enable</command>.
+ This has the effect that a dependency
+ of type <varname>Wants=</varname> or
<varname>Requires=</varname> is added
from the listed unit to the current
unit. The primary result is that the
@@ -1160,7 +1167,12 @@
and <command>systemctl
disable</command> will automatically
install/uninstall units listed in this option as
- well.</para></listitem>
+ well.</para>
+
+ <para>This option may be used more
+ than once, or a space-separated list
+ of unit names may be
+ given.</para></listitem>
</varlistentry>
</variablelist>

View File

@ -0,0 +1,90 @@
From 99e4b98b064042a2c1cea103941a7895b183821e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Mon, 2 Dec 2013 21:52:51 -0500
Subject: [PATCH] systemd: treat reload failure as failure
systemctl reload "suceeded" on stopped units, but it is documented
to fail in this case.
https://bugzilla.redhat.com/show_bug.cgi?id=1036845
---
src/core/job.c | 11 +++++++----
src/core/job.h | 3 ++-
src/core/unit.c | 5 ++++-
3 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/src/core/job.c b/src/core/job.c
index dc3bc12..7d2b994 100644
--- a/src/core/job.c
+++ b/src/core/job.c
@@ -528,7 +528,7 @@ int job_run_and_invalidate(Job *j) {
else if (t == UNIT_ACTIVATING)
r = -EAGAIN;
else
- r = -ENOEXEC;
+ r = -EBADR;
break;
}
@@ -557,8 +557,10 @@ int job_run_and_invalidate(Job *j) {
if (j) {
if (r == -EALREADY)
r = job_finish_and_invalidate(j, JOB_DONE, true);
- else if (r == -ENOEXEC)
+ else if (r == -EBADR)
r = job_finish_and_invalidate(j, JOB_SKIPPED, true);
+ else if (r == -ENOEXEC)
+ r = job_finish_and_invalidate(j, JOB_INVALID, true);
else if (r == -EAGAIN) {
j->state = JOB_WAITING;
m->n_running_jobs--;
@@ -784,7 +786,7 @@ int job_finish_and_invalidate(Job *j, JobResult result, bool recursive) {
goto finish;
}
- if (result == JOB_FAILED)
+ if (result == JOB_FAILED || result == JOB_INVALID)
j->manager->n_failed_jobs ++;
job_uninstall(j);
@@ -1143,7 +1145,8 @@ static const char* const job_result_table[_JOB_RESULT_MAX] = {
[JOB_TIMEOUT] = "timeout",
[JOB_FAILED] = "failed",
[JOB_DEPENDENCY] = "dependency",
- [JOB_SKIPPED] = "skipped"
+ [JOB_SKIPPED] = "skipped",
+ [JOB_INVALID] = "invalid",
};
DEFINE_STRING_TABLE_LOOKUP(job_result, JobResult);
diff --git a/src/core/job.h b/src/core/job.h
index d90bc96..4237529 100644
--- a/src/core/job.h
+++ b/src/core/job.h
@@ -97,7 +97,8 @@ enum JobResult {
JOB_TIMEOUT, /* JobTimeout elapsed */
JOB_FAILED, /* Job failed */
JOB_DEPENDENCY, /* A required dependency job did not result in JOB_DONE */
- JOB_SKIPPED, /* JOB_RELOAD of inactive unit; negative result of JOB_VERIFY_ACTIVE */
+ JOB_SKIPPED, /* Negative result of JOB_VERIFY_ACTIVE */
+ JOB_INVALID, /* JOB_RELOAD of inactive unit */
_JOB_RESULT_MAX,
_JOB_RESULT_INVALID = -1
};
diff --git a/src/core/unit.c b/src/core/unit.c
index b65e798..6c2c4a0 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -1239,8 +1239,11 @@ int unit_reload(Unit *u) {
if (state == UNIT_RELOADING)
return -EALREADY;
- if (state != UNIT_ACTIVE)
+ if (state != UNIT_ACTIVE) {
+ log_warning_unit(u->id, "Unit %s cannot be reloaded because it is inactive.",
+ u->id);
return -ENOEXEC;
+ }
if ((following = unit_following(u))) {
log_debug_unit(u->id, "Redirecting reload request from %s to %s.",

View File

@ -0,0 +1,34 @@
From 9c6964b0a23852353aaa0ca0c30586c3f19502b7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Tue, 3 Dec 2013 08:07:32 -0500
Subject: [PATCH] journal: fail silently in sd_j_sendv() if journal is
unavailable
"syslog(3) and sd_journal_print() may largely be used interchangeably
functionality-wise" according to sd_journal_print(3). This socket
should be always available except in rare circumstatances, and we
don't random applications to fail on logging, so let's do what syslog
did. The alternative of forcing all callers to do error handling for
this rare case doesn't really have any benefits, since if they can't
log there isn't much they can do anyway.
https://bugzilla.redhat.com/show_bug.cgi?id=1023041
---
src/journal/journal-send.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c
index d00e26f..d99ff0c 100644
--- a/src/journal/journal-send.c
+++ b/src/journal/journal-send.c
@@ -305,6 +305,10 @@ _public_ int sd_journal_sendv(const struct iovec *iov, int n) {
if (k >= 0)
return 0;
+ /* Fail silently if the journal is not available */
+ if (errno == ENOENT)
+ return 0;
+
if (errno != EMSGSIZE && errno != ENOBUFS)
return -errno;

View File

@ -16,7 +16,7 @@
Name: systemd Name: systemd
Url: http://www.freedesktop.org/wiki/Software/systemd Url: http://www.freedesktop.org/wiki/Software/systemd
Version: 208 Version: 208
Release: 6%{?gitcommit:.git%{gitcommit}}%{?dist} Release: 7%{?gitcommit:.git%{gitcommit}}%{?dist}
# For a breakdown of the licensing, see README # For a breakdown of the licensing, see README
License: LGPLv2+ and MIT and GPLv2+ License: LGPLv2+ and MIT and GPLv2+
Summary: A System and Service Manager Summary: A System and Service Manager
@ -97,7 +97,7 @@ Patch057: 0057-libudev-default-log_priority-to-INFO.patch
Patch058: 0058-nspawn-only-pass-in-slice-setting-if-it-is-set.patch Patch058: 0058-nspawn-only-pass-in-slice-setting-if-it-is-set.patch
Patch059: 0059-zsh-completion-add-systemd-run.patch Patch059: 0059-zsh-completion-add-systemd-run.patch
Patch060: 0060-man-explain-NAME-in-systemctl-man-page.patch Patch060: 0060-man-explain-NAME-in-systemctl-man-page.patch
#Patch061: 0061-virt-move-caching-of-virtualization-check-results-in.patch Patch061: 0061-virt-move-caching-of-virtualization-check-results-in.patch
Patch062: 0062-systemctl-fix-typo-in-help-text.patch Patch062: 0062-systemctl-fix-typo-in-help-text.patch
Patch063: 0063-analyze-plot-place-the-text-on-the-side-with-most-sp.patch Patch063: 0063-analyze-plot-place-the-text-on-the-side-with-most-sp.patch
Patch064: 0064-detect_virtualization-returns-NULL-pass-empty-string.patch Patch064: 0064-detect_virtualization-returns-NULL-pass-empty-string.patch
@ -152,6 +152,30 @@ Patch112: 0112-tmpfiles-adjust-excludes-for-the-new-per-service-pri.patch
Patch113: 0113-core-socket-fix-SO_REUSEPORT.patch Patch113: 0113-core-socket-fix-SO_REUSEPORT.patch
Patch114: 0114-localed-match-converted-keymaps-before-legacy.patch Patch114: 0114-localed-match-converted-keymaps-before-legacy.patch
Patch115: 0115-keymap-Add-Toshiba-Satellite-U940.patch Patch115: 0115-keymap-Add-Toshiba-Satellite-U940.patch
Patch116: 0116-calendar-support-yearly-and-annually-names-the-same-.patch
Patch117: 0117-hashmap-be-a-bit-more-conservative-with-pre-allocati.patch
Patch118: 0118-manager-don-t-do-plymouth-in-a-container.patch
Patch119: 0119-nspawn-add-new-drop-capability-switch.patch
Patch120: 0120-valgrind-make-running-PID-1-in-valgrind-useful.patch
Patch121: 0121-efi-boot-generator-don-t-mount-boot-eagerly.patch
Patch122: 0122-hwdb-Update-database-of-Bluetooth-company-identifier.patch
Patch123: 0123-journal-when-appending-to-journal-file-allocate-larg.patch
Patch124: 0124-journal-make-table-const.patch
Patch125: 0125-journald-keep-statistics-on-how-of-we-hit-miss-the-m.patch
Patch126: 0126-journal-optimize-bisection-logic-a-bit-by-caching-th.patch
Patch127: 0127-journal-fix-iteration-when-we-go-backwards-from-the-.patch
Patch128: 0128-journal-allow-journal_file_copy_entry-to-work-on-non.patch
Patch129: 0129-journal-simplify-pre-allocation-logic.patch
Patch130: 0130-journald-mention-how-long-we-needed-to-flush-to-var-.patch
Patch131: 0131-automount-log-info-about-triggering-process.patch
Patch132: 0132-virt-split-detect_vm-into-separate-functions.patch
Patch133: 0133-hwdb-Update-database-of-Bluetooth-company-identifier.patch
Patch134: 0134-sysfs-show.c-return-negative-error.patch
Patch135: 0135-util.c-check-if-return-value-from-ttyname_r-is-0-ins.patch
Patch136: 0136-docs-remove-unneeded-the-s-in-gudev-docs.patch
Patch137: 0137-man-explicitly-say-when-multiple-units-can-be-specif.patch
Patch138: 0138-systemd-treat-reload-failure-as-failure.patch
Patch139: 0139-journal-fail-silently-in-sd_j_sendv-if-journal-is-un.patch
# kernel-install patch for grubby, drop if grubby is obsolete # kernel-install patch for grubby, drop if grubby is obsolete
Patch1000: kernel-install-grubby.patch Patch1000: kernel-install-grubby.patch
@ -800,6 +824,13 @@ getent passwd systemd-journal-gateway >/dev/null 2>&1 || useradd -r -l -u 191 -g
%{_datadir}/systemd/gatewayd %{_datadir}/systemd/gatewayd
%changelog %changelog
* Tue Dec 03 2013 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 208-7
- Backport patches (#1023041, #1036845, #1006386?)
- HWDB update
- Some small new features: nspawn --drop-capability=, running PID 1 under
valgrind, "yearly" and "annually" in calendar specifications
- Some small documentation and logging updates
* Tue Nov 19 2013 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 208-6 * Tue Nov 19 2013 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 208-6
- Bump version to stay ahead of f20 - Bump version to stay ahead of f20