Skip to contentSkip to conversation

9p patches 2018-12-13

GIT PULL Applied Greg Kurz 3 participants 8 messages Dec 13, 2018 – Dec 15, 2018

lore
Share & tools
lore

Greg Kurz

author
#0 lore raw

The following changes since commit bb9bf94b3e8926553290bc9a7cb84315af422086:

Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging (2018-12-11 19:18:58 +0000)

are available in the Git repository at:

https://github.com/gkurz/qemu.git tags/for-upstream

for you to fetch changes up to 93aee84f575d46699f49af3c96194012527e0b22:

9p: remove support for the "handle" backend (2018-12-12 14:18:10 +0100)

----------------------------------------------------------------
Most notable change in this PR is the full removal of the "handle" fsdev backend.

----------------------------------------------------------------
Greg Kurz (3):
9p: use g_new(T, n) instead of g_malloc(sizeof(T) * n) xen/9pfs: use g_new(T, n) instead of g_malloc(sizeof(T) * n) 9p: remove support for the "handle" backend

 fsdev/qemu-fsdev.c       |   3 -
 hw/9pfs/9p-handle.c      | 710 -----------------------------------------------
 hw/9pfs/9p.c             |   4 +-
 hw/9pfs/Makefile.objs    |   1 -
 hw/9pfs/xen-9p-backend.c |   6 +-
 qemu-deprecated.texi     |   8 -
 qemu-options.hx          |   8 +-
 7 files changed, 9 insertions(+), 731 deletions(-)
 delete mode 100644 hw/9pfs/9p-handle.c
Signature · 1 line
2.17.2
author
#1 lore raw

[Qemu-devel] [PULL 1/3] 9p: use g_new(T, n) instead of g_malloc(sizeof(T) * n)

Because it is a recommended coding practice (see HACKING).

---
 hw/9pfs/9p.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/9pfs/9p.c +2 -2
index bdf7919abfc5..55821343e594 100644
@@ -1331,8 +1331,8 @@ static void coroutine_fn v9fs_walk(void *opaque)
     trace_v9fs_walk(pdu->tag, pdu->id, fid, newfid, nwnames);
 
     if (nwnames && nwnames <= P9_MAXWELEM) {
-        wnames = g_malloc0(sizeof(wnames[0]) * nwnames);
-        qids   = g_malloc0(sizeof(qids[0]) * nwnames);
+        wnames = g_new0(V9fsString, nwnames);
+        qids   = g_new0(V9fsQID, nwnames);
         for (i = 0; i < nwnames; i++) {
             err = pdu_unmarshal(pdu, offset, "s", &wnames[i]);
             if (err < 0) {
Signature · 1 line
2.17.2
author
#2 lore raw

[Qemu-devel] [PULL 2/3] xen/9pfs: use g_new(T, n) instead of g_malloc(sizeof(T) * n)

In reply to Greg Kurz

Because it is a recommended coding practice (see HACKING).

---
 hw/9pfs/xen-9p-backend.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
hw/9pfs/xen-9p-backend.c +3 -3
index 3f54a21c7623..9015fe7773d0 100644
@@ -178,7 +178,7 @@ static void xen_9pfs_init_out_iov_from_pdu(V9fsPDU *pdu,
 
     g_free(ring->sg);
 
-    ring->sg = g_malloc0(sizeof(*ring->sg) * 2);
+    ring->sg = g_new0(struct iovec, 2);
     xen_9pfs_out_sg(ring, ring->sg, &num, pdu->idx);
     *piov = ring->sg;
     *pniov = num;
@@ -196,7 +196,7 @@ static void xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pdu,
 
     g_free(ring->sg);
 
-    ring->sg = g_malloc0(sizeof(*ring->sg) * 2);
+    ring->sg = g_new0(struct iovec, 2);
     xen_9pfs_in_sg(ring, ring->sg, &num, pdu->idx, size);
 
     buf_size = iov_size(ring->sg, num);
@@ -368,7 +368,7 @@ static int xen_9pfs_connect(struct XenDevice *xendev)
         return -1;
     }
 
-    xen_9pdev->rings = g_malloc0(xen_9pdev->num_rings * sizeof(Xen9pfsRing));
+    xen_9pdev->rings = g_new0(Xen9pfsRing, xen_9pdev->num_rings);
     for (i = 0; i < xen_9pdev->num_rings; i++) {
         char *str;
         int ring_order;
Signature · 1 line
2.17.2
author
#3 lore raw

[Qemu-devel] [PULL 3/3] 9p: remove support for the "handle" backend

In reply to Greg Kurz

The "handle" fsdev backend was deprecated in QEMU 2.12.0 with:

commit db3b3c7281ca82e2647e072a1f97db111313dd73

Author: Greg Kurz <[email protected]>
Date:   Mon Jan 8 11:18:23 2018 +0100

9pfs: deprecate handle backend

This backend raise some concerns:

- doesn't support symlinks
- fails +100 tests in the PJD POSIX file system test suite [1]
- requires the QEMU process to run with the CAP_DAC_READ_SEARCH capability, which isn't recommended for security reasons

This backend should not be used and wil be removed. The 'local' backend is the recommended alternative.

[1] https://www.tuxera.com/community/posix-test-suite/

It has passed the two release cooling period without any complaint.

Remove it now.

---
 fsdev/qemu-fsdev.c    |   3 -
 hw/9pfs/9p-handle.c   | 710 ------------------------------------------
 hw/9pfs/Makefile.objs |   1 -
 qemu-deprecated.texi  |   8 -
 qemu-options.hx       |   8 +-
 5 files changed, 4 insertions(+), 726 deletions(-)
 delete mode 100644 hw/9pfs/9p-handle.c
fsdev/qemu-fsdev.c +0 -3
index 7a3b87cc9e38..4536fd977d50 100644
@@ -23,9 +23,6 @@ static QTAILQ_HEAD(FsDriverEntry_head, FsDriverListEntry) fsdriver_entries =
 
 static FsDriverTable FsDrivers[] = {
     { .name = "local", .ops = &local_ops},
-#ifdef CONFIG_OPEN_BY_HANDLE
-    { .name = "handle", .ops = &handle_ops},
-#endif
     { .name = "synth", .ops = &synth_ops},
     { .name = "proxy", .ops = &proxy_ops},
 };
hw/9pfs/9p-handle.c deleted +0 -710

710 lines not on this page · raw message

hw/9pfs/Makefile.objs +0 -1
index e3fa673665e4..8ac04962bd13 100644
@@ -4,7 +4,6 @@ common-obj-y += 9p-local.o 9p-xattr.o
 common-obj-y += 9p-xattr-user.o 9p-posix-acl.o
 common-obj-y += coth.o cofs.o codir.o cofile.o
 common-obj-y += coxattr.o 9p-synth.o
-common-obj-$(CONFIG_OPEN_BY_HANDLE) +=  9p-handle.o
 common-obj-y += 9p-proxy.o
 endif
 
qemu-deprecated.texi +0 -8
index 72b8191d6014..e362d3722543 100644
@@ -46,14 +46,6 @@ would automatically enable USB support on the machine type.
 If using the new syntax, USB support must be explicitly
 enabled via the ``-machine usb=on'' argument.
 
-@subsection -fsdev handle (since 2.12.0)
-
-The ``handle'' fsdev backend does not support symlinks and causes the 9p
-filesystem in the guest to fail a fair amount of tests from the PJD POSIX
-filesystem test suite. Also it requires the CAP_DAC_READ_SEARCH capability,
-which is not the recommended way to run QEMU. This backend should not be
-used and it will be removed with no replacement.
-
 @subsection -no-frame (since 2.12.0)
 
 The @code{--no-frame} argument works with SDL 1.2 only. The other user
qemu-options.hx +4 -4
index 269eda7a5da3..df42116eccc7 100644
@@ -1019,7 +1019,7 @@ Define a new file system device. Valid options are:
 @table @option
 @item @var{fsdriver}
 This option specifies the fs driver backend to use.
-Currently "local", "handle" and "proxy" file system drivers are supported.
+Currently "local" and "proxy" file system drivers are supported.
 @item id=@var{id}
 Specifies identifier for this device
 @item path=@var{path}
@@ -1037,7 +1037,7 @@ hidden .virtfs_metadata directory. Directories exported by this security model c
 interact with other unix tools. "none" security model is same as
 passthrough except the sever won't report failures if it fails to
 set file attributes like ownership. Security model is mandatory
-only for local fsdriver. Other fsdrivers (like handle, proxy) don't take
+only for local fsdriver. Other fsdrivers (like proxy) don't take
 security model as a parameter.
 @item writeout=@var{writeout}
 This is an optional argument. The only supported value is "immediate".
@@ -1088,7 +1088,7 @@ The general form of a Virtual File system pass-through options are:
 @table @option
 @item @var{fsdriver}
 This option specifies the fs driver backend to use.
-Currently "local", "handle" and "proxy" file system drivers are supported.
+Currently "local" and "proxy" file system drivers are supported.
 @item id=@var{id}
 Specifies identifier for this device
 @item path=@var{path}
@@ -1106,7 +1106,7 @@ hidden .virtfs_metadata directory. Directories exported by this security model c
 interact with other unix tools. "none" security model is same as
 passthrough except the sever won't report failures if it fails to
 set file attributes like ownership. Security model is mandatory only
-for local fsdriver. Other fsdrivers (like handle, proxy) don't take security
+for local fsdriver. Other fsdrivers (like proxy) don't take security
 model as a parameter.
 @item writeout=@var{writeout}
 This is an optional argument. The only supported value is "immediate".
Signature · 1 line
2.17.2
#4 lore raw
In reply to Greg Kurz
Patchew URL: https://patchew.org/QEMU/[email protected]/

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series seems to have some coding style problems. See output below for more information:

Type: series
Message-id: [email protected]
Subject: [Qemu-devel] [PULL 0/3] 9p patches 2018-12-13

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram

commits="$(git log --format=%H --reverse $BASE..)" for c in $commits; do

    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))

done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
error: RPC failed; result=18, HTTP code = 200
fatal: The remote end hung up unexpectedly
error: Could not fetch 3c8cf5a9c21ff8782164d1def7f44bd888713384 Traceback (most recent call last):
File "patchew-tester/src/patchew-cli", line 521, in test_one

    git_clone_repo(clone, r["repo"], r["head"], logf, True)

File "patchew-tester/src/patchew-cli", line 48, in git_clone_repo
stdout=logf, stderr=logf)
File "/usr/lib64/python3.4/subprocess.py", line 558, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['git', 'remote', 'add', '-f', '--mirror=fetch', '3c8cf5a9c21ff8782164d1def7f44bd888713384', 'https://github.com/patchew-project/qemu']' returned non-zero exit status 1

The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]

author
#5 lore raw
Quoted 35 lines · On Thu, 13 Dec 2018 03:20:50 -0800 (PST) [email protected] wrote:

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series seems to have some coding style problems. See output below for more information:

Type: series
Message-id: [email protected]
Subject: [Qemu-devel] [PULL 0/3] 9p patches 2018-12-13

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram

commits="$(git log --format=%H --reverse $BASE..)" for c in $commits; do

    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))

done

Quoted 7 lines

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
error: RPC failed; result=18, HTTP code = 200
fatal: The remote end hung up unexpectedly
error: Could not fetch 3c8cf5a9c21ff8782164d1def7f44bd888713384

Huh... I really don't know where this SHA1 is coming from...

Fam, any idea what's going on here ?

Quoted 16 lines

Traceback (most recent call last):
File "patchew-tester/src/patchew-cli", line 521, in test_one

    git_clone_repo(clone, r["repo"], r["head"], logf, True)

File "patchew-tester/src/patchew-cli", line 48, in git_clone_repo
stdout=logf, stderr=logf)
File "/usr/lib64/python3.4/subprocess.py", line 558, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['git', 'remote', 'add', '-f', '--mirror=fetch', '3c8cf5a9c21ff8782164d1def7f44bd888713384', 'https://github.com/patchew-project/qemu']' returned non-zero exit status 1

The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]

#6 lore raw
In reply to Greg Kurz
Quoted 17 lines · Greg Kurz

The following changes since commit bb9bf94b3e8926553290bc9a7cb84315af422086:

Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging (2018-12-11 19:18:58 +0000)

are available in the Git repository at:

https://github.com/gkurz/qemu.git tags/for-upstream

for you to fetch changes up to 93aee84f575d46699f49af3c96194012527e0b22:

9p: remove support for the "handle" backend (2018-12-12 14:18:10 +0100)

----------------------------------------------------------------
Most notable change in this PR is the full removal of the "handle" fsdev backend.

Quoted 5 lines

----------------------------------------------------------------
Greg Kurz (3):
9p: use g_new(T, n) instead of g_malloc(sizeof(T) * n) xen/9pfs: use g_new(T, n) instead of g_malloc(sizeof(T) * n) 9p: remove support for the "handle" backend

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/4.0
for any user-visible changes.

-- PMM

author
#7 lore raw
Quoted 24 lines · On Fri, 14 Dec 2018 19:12:07 +0000 Peter Maydell <[email protected]>…
Quoted 17 lines · Greg Kurz

The following changes since commit bb9bf94b3e8926553290bc9a7cb84315af422086:

Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging (2018-12-11 19:18:58 +0000)

are available in the Git repository at:

https://github.com/gkurz/qemu.git tags/for-upstream

for you to fetch changes up to 93aee84f575d46699f49af3c96194012527e0b22:

9p: remove support for the "handle" backend (2018-12-12 14:18:10 +0100)

----------------------------------------------------------------
Most notable change in this PR is the full removal of the "handle" fsdev backend.

Quoted 5 lines

----------------------------------------------------------------
Greg Kurz (3):
9p: use g_new(T, n) instead of g_malloc(sizeof(T) * n) xen/9pfs: use g_new(T, n) instead of g_malloc(sizeof(T) * n) 9p: remove support for the "handle" backend

Quoted 5 lines

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/4.0
for any user-visible changes.

I've updated https://wiki.qemu.org/ChangeLog/4.0#Incompatible_changes
accordingly.

Cheers,

--
Greg

Quoted 1 line

-- PMM