Skip to contentSkip to conversation

Trivial patches for 2014-11-11

GIT PULL Applied Michael Tokarev 2 participants 13 messages Nov 11, 2014 Networking

lore
Share & tools
lore
#0 lore raw

Here's another week's trivial patches pull req, for 2.2 release. There's nothing exciting in there, but some patches are worth to mention.

4/11: numa: make 'info numa' take into account hotplugged memory
this one has been pinged several times, and the numa maintainer agreed to push it using other tree. It can be considered a bugfix for `info numa' output (not taking some memory into account), and while somewhat large for -trivial, it is actually rather trivial

5/11: gdbstub: Add a missing case of signal number translation in gdbstub
a bugfix to allow gdb debugging

7/11: coroutine-sigaltstack: Change jmp_buf to sigjmp_buf
this one is a bugfix discussed today

Please consider applying/pulling.

Thanks,

/mjt

The following changes since commit 7135781f65f1267a72bf554ee2b7bd605f9e59aa:

Merge remote-tracking branch 'remotes/mjt/tags/pull-trivial-patches-2014-11-02' into staging (2014-11-03 14:55:17 +0000)

are available in the git repository at:

git://git.corpit.ru/qemu.git tags/pull-trivial-patches-2014-11-11

for you to fetch changes up to 705be728c0b5546da10d8ef4239a112d1616bb97:

block: Fix comment for bdrv_co_get_block_status (2014-11-11 17:36:19 +0300)

----------------------------------------------------------------
trivial patches for 2014-11-11

----------------------------------------------------------------
Chen Fan (1):
target-i386: cpu: keeping function parameters alignment on new line

Chen Gang (2):
pc-bios: petalogix-s3adsp1800.dtb: Use 'xlnx, xps-ethernetlite-2.00.a' instead of 'xlnx, xps-ethernetlite-2.00.b'
xen-hvm: Remove redundant variable 'xstate'

Fam Zheng (1):
block: Fix comment for bdrv_co_get_block_status

Gonglei (2):
qemu-doc.texi: fix typos in x509 examples
sysbus: Correct SYSTEM_BUS(obj) defines

Martin Simmons (1):
gdbstub: Add a missing case of signal number translation in gdbstub

Peter Wu (1):
slirp/smbd: modify/set several parameters in generated smbd.conf

Willem Pinckaers (1):
coroutine-sigaltstack: Change jmp_buf to sigjmp_buf

Zhu Guihua (1):

      icc_bus: fix typo ICC_BRIGDE -> ICC_BRIDGE

zhanghailiang (1):
numa: make 'info numa' take into account hotplugged memory

 block.c                          |    6 +++---
 coroutine-sigaltstack.c          |    2 +-
 gdbstub.c                        |    5 ++++-
 hw/cpu/icc_bus.c                 |    4 ++--
 include/block/block.h            |    4 +++-
 include/hw/sysbus.h              |    2 +-
 include/sysemu/sysemu.h          |    1 +
 monitor.c                        |    6 +++++-
 net/slirp.c                      |    9 ++++++++-
 numa.c                           |   38 ++++++++++++++++++++++++++++++++++++++
 pc-bios/petalogix-s3adsp1800.dtb |  Bin 8259 -> 8259 bytes
 qemu-doc.texi                    |    4 ++--
 target-i386/cpu.c                |    6 +++---
 xen-hvm.c                        |    3 +--
 14 files changed, 72 insertions(+), 18 deletions(-)
#1 lore raw

[Qemu-devel] [PULL 01/11] icc_bus: fix typo ICC_BRIGDE -> ICC_BRIDGE

From: Zhu Guihua <[email protected]>

Rename ICC_BRIGDE for better readability.

---
 hw/cpu/icc_bus.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/cpu/icc_bus.c +2 -2
index 9575fd6..6646ea2 100644
@@ -73,11 +73,11 @@ typedef struct ICCBridgeState {
     MemoryRegion apic_container;
 } ICCBridgeState;
 
-#define ICC_BRIGDE(obj) OBJECT_CHECK(ICCBridgeState, (obj), TYPE_ICC_BRIDGE)
+#define ICC_BRIDGE(obj) OBJECT_CHECK(ICCBridgeState, (obj), TYPE_ICC_BRIDGE)
 
 static void icc_bridge_init(Object *obj)
 {
-    ICCBridgeState *s = ICC_BRIGDE(obj);
+    ICCBridgeState *s = ICC_BRIDGE(obj);
     SysBusDevice *sb = SYS_BUS_DEVICE(obj);
 
     qbus_create_inplace(&s->icc_bus, sizeof(s->icc_bus), TYPE_ICC_BUS,
Signature · 1 line
1.7.10.4
#2 lore raw

[Qemu-devel] [PULL 02/11] qemu-doc.texi: fix typos in x509 examples

In reply to Michael Tokarev

From: Gonglei <[email protected]>

---
 qemu-doc.texi |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
qemu-doc.texi +2 -2
index 9973090..ad418f8 100644
@@ -1631,7 +1631,7 @@ EOF
 # certtool --generate-certificate \
            --load-ca-certificate ca-cert.pem \
            --load-ca-privkey ca-key.pem \
-           --load-privkey server server-key.pem \
+           --load-privkey server-key.pem \
            --template server.info \
            --outfile server-cert.pem
 @end example
@@ -1654,7 +1654,7 @@ the secure CA private key:
 country = GB
 state = London
 locality = London
-organiazation = Name of your organization
+organization = Name of your organization
 cn = client.foo.example.com
 tls_www_client
 encryption_key
Signature · 1 line
1.7.10.4
#3 lore raw

[Qemu-devel] [PULL 07/11] coroutine-sigaltstack: Change jmp_buf to sigjmp_buf

In reply to Michael Tokarev

From: Willem Pinckaers <[email protected]>

This is a simple patch to change the type of old_env from jmp_buf to sigjmp_buf. old_env is used by sigsetjmp and as such should be a sigjmp_buf.

This fixes a stack_chk fail in a OSX 32bit build. Since at least on OSX sigjmp_buf is four bytes larger then a jmpbuf, resulting in an overflow in sigsetjmp. Due to variable reordering this overwrites the stack cookie.

Peter: I think I must have missed this one when I converted
all the jmp_buf to sigjmp_buf in commit 6ab7e546.

---
 coroutine-sigaltstack.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
coroutine-sigaltstack.c +1 -1
index 3de0bb3..63519ff 100644
@@ -155,7 +155,7 @@ Coroutine *qemu_coroutine_new(void)
     stack_t oss;
     sigset_t sigs;
     sigset_t osigs;
-    jmp_buf old_env;
+    sigjmp_buf old_env;
 
     /* The way to manipulate stack is with the sigaltstack function. We
      * prepare a stack, with it delivering a signal to ourselves and then
Signature · 1 line
1.7.10.4
#4 lore raw

[Qemu-devel] [PULL 11/11] block: Fix comment for bdrv_co_get_block_status

In reply to Michael Tokarev

From: Fam Zheng <[email protected]>

It returns more information than binary, fix the comment.

---
 block.c               |    6 +++---
 include/block/block.h |    4 +++-
 2 files changed, 6 insertions(+), 4 deletions(-)
block.c +3 -3
index 88f6d9b..5f5b244 100644
@@ -3877,9 +3877,9 @@ typedef struct BdrvCoGetBlockStatusData {
 } BdrvCoGetBlockStatusData;
 
 /*
- * Returns true iff the specified sector is present in the disk image. Drivers
- * not implementing the functionality are assumed to not support backing files,
- * hence all their sectors are reported as allocated.
+ * Returns the allocation status of the specified sectors.
+ * Drivers not implementing the functionality are assumed to not support
+ * backing files, hence all their sectors are reported as allocated.
  *
  * If 'sector_num' is beyond the end of the disk image the return value is 0
  * and 'pnum' is set to 0.
include/block/block.h +3 -1
index 341054d..603d4b4 100644
@@ -83,7 +83,9 @@ typedef enum {
 #define BDRV_SECTOR_SIZE   (1ULL << BDRV_SECTOR_BITS)
 #define BDRV_SECTOR_MASK   ~(BDRV_SECTOR_SIZE - 1)
 
-/* BDRV_BLOCK_DATA: data is read from bs->file or another file
+/*
+ * Allocation status flags
+ * BDRV_BLOCK_DATA: data is read from bs->file or another file
  * BDRV_BLOCK_ZERO: sectors read as zero
  * BDRV_BLOCK_OFFSET_VALID: sector stored in bs->file as raw data
  * BDRV_BLOCK_ALLOCATED: the content of the block is determined by this
Signature · 1 line
1.7.10.4
#5 lore raw

[Qemu-devel] [PULL 09/11] target-i386: cpu: keeping function parameters alignment on new line

In reply to Michael Tokarev

From: Chen Fan <[email protected]>

---
 target-i386/cpu.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
target-i386/cpu.c +3 -3
index e4ccee1..236bbee 100644
@@ -533,8 +533,8 @@ void host_cpuid(uint32_t function, uint32_t count,
  * otherwise the string is assumed to sized by a terminating nul.
  * Return lexical ordering of *s1:*s2.
  */
-static int sstrcmp(const char *s1, const char *e1, const char *s2,
-    const char *e2)
+static int sstrcmp(const char *s1, const char *e1,
+                   const char *s2, const char *e2)
 {
     for (;;) {
         if (!*s1 || !*s2 || *s1 != *s2)
@@ -1845,7 +1845,7 @@ static void x86_cpu_parse_featurestr(CPUState *cs, char *features,
  * if flags, suppress names undefined in featureset.
  */
 static void listflags(char *buf, int bufsize, uint32_t fbits,
-    const char **featureset, uint32_t flags)
+                      const char **featureset, uint32_t flags)
 {
     const char **p = &featureset[31];
     char *q, *b, bit;
Signature · 1 line
1.7.10.4
#6 lore raw

[Qemu-devel] [PULL 10/11] sysbus: Correct SYSTEM_BUS(obj) defines

In reply to Michael Tokarev

From: Gonglei <[email protected]>

---
 include/hw/sysbus.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/hw/sysbus.h +1 -1
index 9fb1782..9bddfde 100644
@@ -10,7 +10,7 @@
 #define QDEV_MAX_PIO 32
 
 #define TYPE_SYSTEM_BUS "System"
-#define SYSTEM_BUS(obj) OBJECT_CHECK(IDEBus, (obj), TYPE_IDE_BUS)
+#define SYSTEM_BUS(obj) OBJECT_CHECK(BusState, (obj), TYPE_SYSTEM_BUS)
 
 typedef struct SysBusDevice SysBusDevice;
 
Signature · 1 line
1.7.10.4
#7 lore raw

[Qemu-devel] [PULL 03/11] slirp/smbd: modify/set several parameters in generated smbd.conf

In reply to Michael Tokarev

From: Peter Wu <[email protected]>

The file sharing module should not handle printers, so disable it. The options 'load printers' and 'printing' have been available since the beginning (May 1996, commit 0e8fd3398771da2f016d72830179507f3edda51b). Option 'disable spoolss' is available since Samba 2.0.4, commit de5f42c9d9172592779fa2504d44544e3b6b1c0d).

Next, "socket address" was reported as deprecated, use a combination of "interfaces" and "bind interfaces only" instead (available since October 1997, commit 79f4fb52c1ed56fd843f81b4eb0cdd2991d4d0f4).

Override cache directory to avoid writing to a global directory. Option available since Samba 3.4.0, Jan 2009, commit 19a05bf2f485023b11b41dfae3f6459847d55ef7.

Set "usershare max shared=0" to prevent a global directory from being used. Option available since Samba 3.0.23, February 2006, commit 5831715049f2d460ce42299963a5defdc160891b.

The last option was introduced with Samba 3.4.0, but previously "state directory" was already added which exists in Samba 3.4.0. As unknown parameters are ignored (while printing a warning), it should be safe to add another option.

---
 net/slirp.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
net/slirp.c +8 -1
index 920af30..dc89e6b 100644
@@ -523,15 +523,21 @@ static int slirp_smb(SlirpState* s, const char *exported_dir,
     fprintf(f,
             "[global]\n"
             "private dir=%s\n"
-            "socket address=127.0.0.1\n"
+            "interfaces=127.0.0.1\n"
+            "bind interfaces only=yes\n"
             "pid directory=%s\n"
             "lock directory=%s\n"
             "state directory=%s\n"
+            "cache directory=%s\n"
             "ncalrpc dir=%s/ncalrpc\n"
             "log file=%s/log.smbd\n"
             "smb passwd file=%s/smbpasswd\n"
             "security = user\n"
             "map to guest = Bad User\n"
+            "load printers = no\n"
+            "printing = bsd\n"
+            "disable spoolss = yes\n"
+            "usershare max shares = 0\n"
             "[qemu]\n"
             "path=%s\n"
             "read only=no\n"
@@ -544,6 +550,7 @@ static int slirp_smb(SlirpState* s, const char *exported_dir,
             s->smb_dir,
             s->smb_dir,
             s->smb_dir,
+            s->smb_dir,
             exported_dir,
             passwd->pw_name
             );
Signature · 1 line
1.7.10.4
#8 lore raw

[Qemu-devel] [PULL 04/11] numa: make 'info numa' take into account hotplugged memory

In reply to Michael Tokarev

From: zhanghailiang <[email protected]>

When do memory hotplug, if there is numa node, we should add the memory size to the corresponding node memory size.

It affects the result of hmp command "info numa".

---
 include/sysemu/sysemu.h |    1 +
 monitor.c               |    6 +++++-
 numa.c                  |   38 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 44 insertions(+), 1 deletion(-)
include/sysemu/sysemu.h +1 -0
index 0037a69..50de1d3 100644
@@ -161,6 +161,7 @@ typedef struct node_info {
 extern NodeInfo numa_info[MAX_NODES];
 void set_numa_nodes(void);
 void set_numa_modes(void);
+void query_numa_node_mem(uint64_t node_mem[]);
 extern QemuOptsList qemu_numa_opts;
 int numa_init_func(QemuOpts *opts, void *opaque);
 
monitor.c +5 -1
index 1fc201a..32db7ee 100644
@@ -1948,7 +1948,10 @@ static void do_info_numa(Monitor *mon, const QDict *qdict)
 {
     int i;
     CPUState *cpu;
+    uint64_t *node_mem;
 
+    node_mem = g_new0(uint64_t, nb_numa_nodes);
+    query_numa_node_mem(node_mem);
     monitor_printf(mon, "%d nodes\n", nb_numa_nodes);
     for (i = 0; i < nb_numa_nodes; i++) {
         monitor_printf(mon, "node %d cpus:", i);
@@ -1959,8 +1962,9 @@ static void do_info_numa(Monitor *mon, const QDict *qdict)
         }
         monitor_printf(mon, "\n");
         monitor_printf(mon, "node %d size: %" PRId64 " MB\n", i,
-            numa_info[i].node_mem >> 20);
+                       node_mem[i] >> 20);
     }
+    g_free(node_mem);
 }
 
 #ifdef CONFIG_PROFILER
numa.c +38 -0
index 3b98135..afd2866 100644
@@ -35,6 +35,7 @@
 #include "hw/boards.h"
 #include "sysemu/hostmem.h"
 #include "qmp-commands.h"
+#include "hw/mem/pc-dimm.h"
 
 QemuOptsList qemu_numa_opts = {
     .name = "numa",
@@ -315,6 +316,43 @@ void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner,
     }
 }
 
+static void numa_stat_memory_devices(uint64_t node_mem[])
+{
+    MemoryDeviceInfoList *info_list = NULL;
+    MemoryDeviceInfoList **prev = &info_list;
+    MemoryDeviceInfoList *info;
+
+    qmp_pc_dimm_device_list(qdev_get_machine(), &prev);
+    for (info = info_list; info; info = info->next) {
+        MemoryDeviceInfo *value = info->value;
+
+        if (value) {
+            switch (value->kind) {
+            case MEMORY_DEVICE_INFO_KIND_DIMM:
+                node_mem[value->dimm->node] += value->dimm->size;
+                break;
+            default:
+                break;
+            }
+        }
+    }
+    qapi_free_MemoryDeviceInfoList(info_list);
+}
+
+void query_numa_node_mem(uint64_t node_mem[])
+{
+    int i;
+
+    if (nb_numa_nodes <= 0) {
+        return;
+    }
+
+    numa_stat_memory_devices(node_mem);
+    for (i = 0; i < nb_numa_nodes; i++) {
+        node_mem[i] += numa_info[i].node_mem;
+    }
+}
+
 static int query_memdev(Object *obj, void *opaque)
 {
     MemdevList **list = opaque;
Signature · 1 line
1.7.10.4
#9 lore raw

[Qemu-devel] [PULL 06/11] pc-bios: petalogix-s3adsp1800.dtb: Use 'xlnx, xps-ethernetlite-2.00.a' instead of 'xlnx, xps-ethernetlite-2.00.b'

In reply to Michael Tokarev

From: Chen Gang <[email protected]>

For Linux upstream kernel (e.g. 3.17-rc7), the related compatible string 'xlnx,xps-ethernetlite-2.00.a' is supported, but 'b' is not supported, so change qemu dtb file to match kernel driver.

The related operation for qemu (after this patch):

yum install libvirt
yum install tunctl
tunctl -b
ip link set tap0 up
brctl addif virbr0 tap0

   ./configure
   make
   ./microblaze-softmmu/qemu-system-microblaze -M petalogix-s3adsp1800 \
     -kernel ../linux-stable.microblaze/arch/microblaze/boot/linux.bin \
     -no-reboot -append "console=ttyUL0,115200 doreboot" -nographic \
     -net nic,vlan=0,model=xlnx.xps-ethernetlite,macaddr=00:16:35:AF:94:00 \
     -net tap,vlan=0,ifname=tap0,script=no,downscript=no

in microblaze qemu bash (guest machine):

ifconfig eth0 add 192.168.122.2 netmask 255.255.255.0 ifconfig eth0 up

Then can telnet 192.168.122.2 directly without password from the host machine.

The related operation for generating new dtb:

building Linux kernel firstly, then get dts tool "./scripts/dts/dts". "./scripts/dtc/dtc -I dtb -O dts -o ../work.dts ../qemu/petalogix-s3adsp1800.dtb" edit work.dts (replace 'xlnx,xps-ethernetlite-2.00.b') "./scripts/dtc/dtc -I dts -O dtb -o ..qemu/petalogix-s3adsp1800.dtb ../work.dts"

(Since I am not quite sure whether can read this patch or not, I put the related dtb file in attachment, please check, thanks).

---
 pc-bios/petalogix-s3adsp1800.dtb |  Bin 8259 -> 8259 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
pc-bios/petalogix-s3adsp1800.dtb binary +0 -0
index 93c5973fd81244268aace6e5e6006ad6fb4d6199..8ac80f2f2d191a8491b71182be50b3df2989551d 100644
GIT binary patch
Signature · 1 line
1.7.10.4
#10 lore raw

[Qemu-devel] [PULL 08/11] xen-hvm: Remove redundant variable 'xstate'

In reply to Michael Tokarev

From: Chen Gang <[email protected]>

In xen_hvm_change_state_handler(), we can pass 'opaque' with type cast to xen_main_loop_prepare() directly, there's no need to use additional variable for it.

---
 xen-hvm.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
xen-hvm.c +1 -2
index 21f1cbb..7548794 100644
@@ -993,9 +993,8 @@ static void xen_main_loop_prepare(XenIOState *state)
 static void xen_hvm_change_state_handler(void *opaque, int running,
                                          RunState rstate)
 {
-    XenIOState *xstate = opaque;
     if (running) {
-        xen_main_loop_prepare(xstate);
+        xen_main_loop_prepare((XenIOState *)opaque);
     }
 }
 
Signature · 1 line
1.7.10.4
#11 lore raw

[Qemu-devel] [PULL 05/11] gdbstub: Add a missing case of signal number translation in gdbstub

In reply to Michael Tokarev

From: Martin Simmons <[email protected]>

While using qemu with gdb "target remote" to debug an application that uses fork and exec, the qemu process receives SIGSTOP every time the forked process terminates (sending SIGCHLD).

This is caused by a missing call to gdb_signal_to_target in gdbstub.c, which is fixed by this patch:

---
 gdbstub.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
gdbstub.c +4 -1
index d1b5afd..0faca56 100644
@@ -823,7 +823,10 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf)
                 action = *p++;
                 signal = 0;
                 if (action == 'C' || action == 'S') {
-                    signal = strtoul(p, (char **)&p, 16);
+                    signal = gdb_signal_to_target(strtoul(p, (char **)&p, 16));
+                    if (signal == -1) {
+                        signal = 0;
+                    }
                 } else if (action != 'c' && action != 's') {
                     res = 0;
                     break;
Signature · 1 line
1.7.10.4
#12 lore raw
In reply to Michael Tokarev
Quoted 31 lines · Michael Tokarev

Here's another week's trivial patches pull req, for 2.2 release. There's nothing exciting in there, but some patches are worth to mention.

4/11: numa: make 'info numa' take into account hotplugged memory
this one has been pinged several times, and the numa maintainer agreed to push it using other tree. It can be considered a bugfix for `info numa' output (not taking some memory into account), and while somewhat large for -trivial, it is actually rather trivial

5/11: gdbstub: Add a missing case of signal number translation in gdbstub
a bugfix to allow gdb debugging

7/11: coroutine-sigaltstack: Change jmp_buf to sigjmp_buf
this one is a bugfix discussed today

Please consider applying/pulling.

Thanks,

/mjt

The following changes since commit 7135781f65f1267a72bf554ee2b7bd605f9e59aa:

Merge remote-tracking branch 'remotes/mjt/tags/pull-trivial-patches-2014-11-02' into staging (2014-11-03 14:55:17 +0000)

are available in the git repository at:

git://git.corpit.ru/qemu.git tags/pull-trivial-patches-2014-11-11

Quoted 8 lines

for you to fetch changes up to 705be728c0b5546da10d8ef4239a112d1616bb97:

block: Fix comment for bdrv_co_get_block_status (2014-11-11 17:36:19 +0300)

----------------------------------------------------------------
trivial patches for 2014-11-11

----------------------------------------------------------------

Applied, thanks.

-- PMM