pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

qemu-virtfs-netsd: add more patches



Module Name:	pkgsrc-wip
Committed By:	Tobias Nygren <tnn%NetBSD.org@localhost>
Pushed By:	tnn
Date:		Sun Sep 17 13:13:43 2023 +0200
Changeset:	2325d575538a37e5e0788bdbeb0496a706b9e3d2

Modified Files:
	qemu-virtfs-netbsd/distinfo
Added Files:
	qemu-virtfs-netbsd/patches/patch-hw_9pfs_9p-proxy.c
	qemu-virtfs-netbsd/patches/patch-hw_9pfs_9p-synth.c
	qemu-virtfs-netbsd/patches/patch-hw_9pfs_9p-util-bsd.c
	qemu-virtfs-netbsd/patches/patch-hw_9pfs_9p-util.h
	qemu-virtfs-netbsd/patches/patch-hw_9pfs_9p.c
	qemu-virtfs-netbsd/patches/patch-hw_9pfs_meson.build
Removed Files:
	qemu-virtfs-netbsd/patches/patch-fsdev_meson.build

Log Message:
qemu-virtfs-netsd: add more patches

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=2325d575538a37e5e0788bdbeb0496a706b9e3d2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 qemu-virtfs-netbsd/distinfo                        |  7 +++-
 qemu-virtfs-netbsd/patches/patch-fsdev_meson.build | 14 -------
 .../patches/patch-hw_9pfs_9p-proxy.c               | 25 +++++++++++
 .../patches/patch-hw_9pfs_9p-synth.c               | 30 ++++++++++++++
 .../patches/patch-hw_9pfs_9p-util-bsd.c            | 48 ++++++++++++++++++++++
 qemu-virtfs-netbsd/patches/patch-hw_9pfs_9p-util.h | 40 ++++++++++++++++++
 qemu-virtfs-netbsd/patches/patch-hw_9pfs_9p.c      | 47 +++++++++++++++++++++
 .../patches/patch-hw_9pfs_meson.build              | 14 +++++++
 8 files changed, 210 insertions(+), 15 deletions(-)

diffs:
diff --git a/qemu-virtfs-netbsd/distinfo b/qemu-virtfs-netbsd/distinfo
index 4053237bf5..9043168c92 100644
--- a/qemu-virtfs-netbsd/distinfo
+++ b/qemu-virtfs-netbsd/distinfo
@@ -8,10 +8,15 @@ SHA512 (qemu-8.1.0.tar.xz) = c5f5e7ce2d8e3c93a02012b136c866e8577df07da4705a00459
 Size (qemu-8.1.0.tar.xz) = 123550284 bytes
 SHA1 (patch-audio_jackaudio.c) = 771c2779e565242a500adc0223ef6b1ae5b2b91f
 SHA1 (patch-fsdev_file-op-9p.h) = 76d29b1975495f671ab5b699958c92855e5f1b67
-SHA1 (patch-fsdev_meson.build) = 39cbbcabae262f7ecfd77e5c2d61da4f37340dfe
 SHA1 (patch-hw-mips-Kconfig) = c7199ad26ac45116ab4d38252db4234ae93bdf9a
 SHA1 (patch-hw-mips-mipssim.c) = 1f682b74b34398b3ff15f9e7f24a85f4b8bb4853
+SHA1 (patch-hw_9pfs_9p-proxy.c) = ce63083f41dcee265e223e4b8a5dd843678347a0
+SHA1 (patch-hw_9pfs_9p-synth.c) = 1fa45cfc58db484a085f78859e10efd83d8719c6
+SHA1 (patch-hw_9pfs_9p-util-bsd.c) = 012bc411103fae3fbf8976803275244b55675111
+SHA1 (patch-hw_9pfs_9p-util.h) = 18a710ac88e6754b5df4b896773a433676190b1b
+SHA1 (patch-hw_9pfs_9p.c) = 2b9d312a17b1be32a1a0b5a188322a7e0fd56654
 SHA1 (patch-hw_9pfs_9p.h) = 695f764db7ba8412d790f9dff928754891a7469a
+SHA1 (patch-hw_9pfs_meson.build) = c044802ed72729e917d09307b7ddd1e6ebabaf4d
 SHA1 (patch-hw_9pfs_netbsd-statfs-compat.h) = 650d2825f34c031de9cc564fa13aa95036802376
 SHA1 (patch-hw_display_omap__dss.c) = 68f6f5e86335114de64b397959a2238de84fcde2
 SHA1 (patch-hw_mips_meson.build) = d9a07a81fe6d3c9e2bd45f41fe876cd927a40ced
diff --git a/qemu-virtfs-netbsd/patches/patch-fsdev_meson.build b/qemu-virtfs-netbsd/patches/patch-fsdev_meson.build
deleted file mode 100644
index a69fb512d2..0000000000
--- a/qemu-virtfs-netbsd/patches/patch-fsdev_meson.build
+++ /dev/null
@@ -1,14 +0,0 @@
-$NetBSD$
-
-Add NetBSD support.
-
---- fsdev/meson.build.orig	2023-08-22 15:34:01.000000000 +0000
-+++ fsdev/meson.build
-@@ -8,6 +8,7 @@ fsdev_ss.add(when: ['CONFIG_FSDEV_9P'], 
- ), if_false: files('qemu-fsdev-dummy.c'))
- system_ss.add_all(when: 'CONFIG_LINUX', if_true: fsdev_ss)
- system_ss.add_all(when: 'CONFIG_DARWIN', if_true: fsdev_ss)
-+system_ss.add_all(when: 'CONFIG_BSD', if_true: fsdev_ss)
- 
- if have_virtfs_proxy_helper
-   executable('virtfs-proxy-helper',
diff --git a/qemu-virtfs-netbsd/patches/patch-hw_9pfs_9p-proxy.c b/qemu-virtfs-netbsd/patches/patch-hw_9pfs_9p-proxy.c
new file mode 100644
index 0000000000..b96eba142a
--- /dev/null
+++ b/qemu-virtfs-netbsd/patches/patch-hw_9pfs_9p-proxy.c
@@ -0,0 +1,25 @@
+$NetBSD$
+
+Add NetBSD support.
+
+--- hw/9pfs/9p-proxy.c.orig	2023-08-22 15:34:01.000000000 +0000
++++ hw/9pfs/9p-proxy.c
+@@ -120,7 +120,9 @@ static ssize_t socket_read(int sockfd, v
+ static void prstatfs_to_statfs(struct statfs *stfs, ProxyStatFS *prstfs)
+ {
+     memset(stfs, 0, sizeof(*stfs));
++#if !defined(CONFIG_BSD)
+     stfs->f_type = prstfs->f_type;
++#endif
+     stfs->f_bsize = prstfs->f_bsize;
+     stfs->f_blocks = prstfs->f_blocks;
+     stfs->f_bfree = prstfs->f_bfree;
+@@ -131,6 +133,8 @@ static void prstatfs_to_statfs(struct st
+     /* f_namelen and f_frsize do not exist on Darwin */
+     stfs->f_fsid.val[0] = prstfs->f_fsid[0] & 0xFFFFFFFFU;
+     stfs->f_fsid.val[1] = prstfs->f_fsid[1] >> 32 & 0xFFFFFFFFU;
++#elif defined(CONFIG_BSD)
++    stfs->f_fsid = (unsigned long)prstfs->f_fsid[0];  
+ #else
+     stfs->f_fsid.__val[0] = prstfs->f_fsid[0] & 0xFFFFFFFFU;
+     stfs->f_fsid.__val[1] = prstfs->f_fsid[1] >> 32 & 0xFFFFFFFFU;
diff --git a/qemu-virtfs-netbsd/patches/patch-hw_9pfs_9p-synth.c b/qemu-virtfs-netbsd/patches/patch-hw_9pfs_9p-synth.c
new file mode 100644
index 0000000000..b384a67362
--- /dev/null
+++ b/qemu-virtfs-netbsd/patches/patch-hw_9pfs_9p-synth.c
@@ -0,0 +1,30 @@
+$NetBSD$
+
+Add NetBSD support.
+
+--- hw/9pfs/9p-synth.c.orig	2023-08-22 15:34:01.000000000 +0000
++++ hw/9pfs/9p-synth.c
+@@ -230,6 +230,8 @@ static void synth_direntry(V9fsSynthNode
+     entry->d_ino = node->attr->inode;
+ #ifdef CONFIG_DARWIN
+     entry->d_seekoff = off + 1;
++#elif defined(CONFIG_BSD)
++    /* not supported */
+ #else
+     entry->d_off = off + 1;
+ #endif
+@@ -433,11 +435,13 @@ static int synth_fsync(FsContext *ctx, i
+ static int synth_statfs(FsContext *s, V9fsPath *fs_path,
+                              struct statfs *stbuf)
+ {
++#if !defined(CONFIG_BSD)
+     stbuf->f_type = 0xABCD;
++#endif
+     stbuf->f_bsize = 512;
+     stbuf->f_blocks = 0;
+     stbuf->f_files = synth_node_count;
+-#ifndef CONFIG_DARWIN
++#ifdef CONFIG_LINUX
+     stbuf->f_namelen = NAME_MAX;
+ #endif
+     return 0;
diff --git a/qemu-virtfs-netbsd/patches/patch-hw_9pfs_9p-util-bsd.c b/qemu-virtfs-netbsd/patches/patch-hw_9pfs_9p-util-bsd.c
new file mode 100644
index 0000000000..30dc4b0b88
--- /dev/null
+++ b/qemu-virtfs-netbsd/patches/patch-hw_9pfs_9p-util-bsd.c
@@ -0,0 +1,48 @@
+$NetBSD$
+
+Add NetBSD support.
+
+--- hw/9pfs/9p-util-bsd.c.orig	2023-09-17 11:07:36.901331752 +0000
++++ hw/9pfs/9p-util-bsd.c
+@@ -0,0 +1,41 @@
++/*
++ * 9p utilities (BSD stub)
++ *
++ * This work is licensed under the terms of the GNU GPL, version 2 or later.
++ * See the COPYING file in the top-level directory.
++ */
++
++#include "qemu/osdep.h"
++#include "qemu/xattr.h"
++#include "qapi/error.h"
++#include "qemu/error-report.h"
++#include "9p-util.h"
++
++ssize_t fgetxattrat_nofollow(int dirfd, const char *filename, const char *name,
++                             void *value, size_t size)
++{
++    return ENOTSUP;
++}
++
++ssize_t flistxattrat_nofollow(int dirfd, const char *filename,
++                              char *list, size_t size)
++{
++    return ENOTSUP;
++}
++
++ssize_t fremovexattrat_nofollow(int dirfd, const char *filename,
++                                const char *name)
++{
++    return ENOTSUP;
++}
++
++int fsetxattrat_nofollow(int dirfd, const char *filename, const char *name,
++                         void *value, size_t size, int flags)
++{
++    return ENOTSUP;
++}
++
++int qemu_mknodat(int dirfd, const char *filename, mode_t mode, dev_t dev)
++{
++    return mknodat(dirfd, filename, mode, dev);
++}
diff --git a/qemu-virtfs-netbsd/patches/patch-hw_9pfs_9p-util.h b/qemu-virtfs-netbsd/patches/patch-hw_9pfs_9p-util.h
new file mode 100644
index 0000000000..a4f9a7a5b1
--- /dev/null
+++ b/qemu-virtfs-netbsd/patches/patch-hw_9pfs_9p-util.h
@@ -0,0 +1,40 @@
+$NetBSD$
+
+Add NetBSD support.
+
+--- hw/9pfs/9p-util.h.orig	2023-08-22 15:34:01.000000000 +0000
++++ hw/9pfs/9p-util.h
+@@ -64,7 +64,7 @@ static inline uint64_t host_dev_to_dotl_
+ static inline int errno_to_dotl(int err) {
+ #if defined(CONFIG_LINUX)
+     /* nothing to translate (Linux -> Linux) */
+-#elif defined(CONFIG_DARWIN)
++#elif defined(CONFIG_DARWIN) || defined(CONFIG_BSD)
+     /*
+      * translation mandatory for macOS hosts
+      *
+@@ -154,13 +154,13 @@ static inline int openat_file(int dirfd,
+ {
+     int fd, serrno, ret;
+ 
+-#ifndef CONFIG_DARWIN
++#ifdef CONFIG_LINUX
+ again:
+ #endif
+     fd = qemu_openat(dirfd, name, flags | O_NOFOLLOW | O_NOCTTY | O_NONBLOCK,
+                      mode);
+     if (fd == -1) {
+-#ifndef CONFIG_DARWIN
++#ifndef CONFIG_LINUX
+         if (errno == EPERM && (flags & O_NOATIME)) {
+             /*
+              * The client passed O_NOATIME but we lack permissions to honor it.
+@@ -213,6 +213,8 @@ static inline off_t qemu_dirent_off(stru
+ {
+ #ifdef CONFIG_DARWIN
+     return dent->d_seekoff;
++#elif defined(CONFIG_BSD)
++    return 0; /* not supported */
+ #else
+     return dent->d_off;
+ #endif
diff --git a/qemu-virtfs-netbsd/patches/patch-hw_9pfs_9p.c b/qemu-virtfs-netbsd/patches/patch-hw_9pfs_9p.c
new file mode 100644
index 0000000000..30c7b24542
--- /dev/null
+++ b/qemu-virtfs-netbsd/patches/patch-hw_9pfs_9p.c
@@ -0,0 +1,47 @@
+$NetBSD$
+
+Add NetBSD support.
+
+--- hw/9pfs/9p.c.orig	2023-08-22 15:34:01.000000000 +0000
++++ hw/9pfs/9p.c
+@@ -136,7 +136,7 @@ static int dotl_to_open_flags(int flags)
+         { P9_DOTL_NONBLOCK, O_NONBLOCK } ,
+         { P9_DOTL_DSYNC, O_DSYNC },
+         { P9_DOTL_FASYNC, FASYNC },
+-#ifndef CONFIG_DARWIN
++#ifdef CONFIG_LINUX
+         { P9_DOTL_NOATIME, O_NOATIME },
+         /*
+          *  On Darwin, we could map to F_NOCACHE, which is
+@@ -3574,7 +3574,11 @@ static int v9fs_fill_statfs(V9fsState *s
+     if (!bsize_factor) {
+         bsize_factor = 1;
+     }
++#if !defined(CONFIG_BSD)
+     f_type  = stbuf->f_type;
++#else
++    f_type = 0xef53;
++#endif
+     f_bsize = stbuf->f_bsize;
+     f_bsize *= bsize_factor;
+     /*
+@@ -3591,6 +3595,9 @@ static int v9fs_fill_statfs(V9fsState *s
+     fsid_val = (unsigned int)stbuf->f_fsid.val[0] |
+                (unsigned long long)stbuf->f_fsid.val[1] << 32;
+     f_namelen = NAME_MAX;
++#elif defined(CONFIG_BSD)
++    fsid_val = (unsigned long) stbuf->f_fsid;
++    f_namelen = NAME_MAX;
+ #else
+     fsid_val = (unsigned int) stbuf->f_fsid.__val[0] |
+                (unsigned long long)stbuf->f_fsid.__val[1] << 32;
+@@ -3979,6 +3986,9 @@ out_nofid:
+  * Linux guests.
+  */
+ #define P9_XATTR_SIZE_MAX 65536
++#elif defined(CONFIG_BSD)
++/* XXX not implemented */
++#define P9_XATTR_SIZE_MAX 65536
+ #else
+ #error Missing definition for P9_XATTR_SIZE_MAX for this host system
+ #endif
diff --git a/qemu-virtfs-netbsd/patches/patch-hw_9pfs_meson.build b/qemu-virtfs-netbsd/patches/patch-hw_9pfs_meson.build
new file mode 100644
index 0000000000..927ddf20b5
--- /dev/null
+++ b/qemu-virtfs-netbsd/patches/patch-hw_9pfs_meson.build
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Add NetBSD support.
+
+--- hw/9pfs/meson.build.orig	2023-08-22 15:34:01.000000000 +0000
++++ hw/9pfs/meson.build
+@@ -15,6 +15,7 @@ fs_ss.add(files(
+ ))
+ fs_ss.add(when: 'CONFIG_LINUX', if_true: files('9p-util-linux.c'))
+ fs_ss.add(when: 'CONFIG_DARWIN', if_true: files('9p-util-darwin.c'))
++fs_ss.add(when: 'CONFIG_BSD', if_true: files('9p-util-bsd.c'))
+ fs_ss.add(when: 'CONFIG_XEN_BUS', if_true: files('xen-9p-backend.c'))
+ system_ss.add_all(when: 'CONFIG_FSDEV_9P', if_true: fs_ss)
+ 


Home | Main Index | Thread Index | Old Index