On 11.01.22 21:35, Samuel Thibault wrote:
Juergen Gross, le mar. 11 janv. 2022 16:12:12 +0100, a ecrit:
+static int consfront_fstat(int fd, struct stat *buf)
+{
+struct file *file = get_file_from_fd(fd);
+
+buf->st_mode = S_IRUSR | S_IWUSR;
+buf->st_mode |= (file->type == FTYPE_CONSO
On 11.01.22 21:29, Andrew Cooper wrote:
On 11/01/2022 15:12, Juergen Gross wrote:
diff --git a/tpm_tis.c b/tpm_tis.c
index 477f555..abea7a1 100644
--- a/tpm_tis.c
+++ b/tpm_tis.c
@@ -1093,6 +1097,23 @@ ssize_t tpm_getcap(struct tpm_chip *chip, uint32_t
subcap_id, cap_t *cap,
return rc
On 11.01.22 21:26, Samuel Thibault wrote:
Juergen Gross, le mar. 11 janv. 2022 16:12:11 +0100, a ecrit:
+static struct file_ops fb_ops = {
+.name = ".fb",
Why a dot?
I had spare one lying around... ;-)
Thanks for noticing!
Juergen
OpenPGP_0xB0DE9DD628BF132F.asc
Description: OpenPGP
On 11.01.22 21:21, Andrew Cooper wrote:
On 11/01/2022 15:12, Juergen Gross wrote:
void xs_daemon_close(struct xs_handle *h)
{
-int fd = _xs_fileno(h);
-struct xenbus_event *event, *next;
-for (event = files[fd].dev; event; event = next)
-{
-next = event->next;
-
On 11.01.22 21:12, Andrew Cooper wrote:
On 11/01/2022 15:12, Juergen Gross wrote:
The event channel specific union member in struct file is no longer
Too much copy&paste from the previous patch?
Seems so, yes. :-)
Juergen
OpenPGP_0xB0DE9DD628BF132F.asc
Description: OpenPGP public key
O
On 11.01.2022 23:49, Stefano Stabellini wrote:
> On Mon, 10 Jan 2022, Jan Beulich wrote:
>> On 08.01.2022 01:49, Stefano Stabellini wrote:
>>> @@ -284,11 +285,32 @@ void evtchn_free(struct domain *d, struct evtchn *chn)
>>> xsm_evtchn_close_post(chn);
>>> }
>>>
>>> -static int evtchn_alloc_
On 11.01.22 21:05, Samuel Thibault wrote:
Juergen Gross, le mar. 11 janv. 2022 15:58:16 +0100, a ecrit:
@@ -370,8 +413,45 @@ int write(int fd, const void *buf, size_t nbytes)
return -1;
}
+off_t lseek_default(int fd, off_t offset, int whence)
+{
+switch ( whence )
+{
Is the
On 11.01.22 20:42, Andrew Cooper wrote:
On 11/01/2022 14:57, Juergen Gross wrote:
Today the layout of struct file is depending on the Mini-OS
configuration. This is especially bad as the layout is exported to
external users like the Xen libraries built for Mini-OS, and those
are being built only
On 11.01.22 20:14, Andrew Cooper wrote:
On 11/01/2022 14:58, Juergen Gross wrote:
diff --git a/lib/sys.c b/lib/sys.c
index 0e6fe5d..323a7cd 100644
--- a/lib/sys.c
+++ b/lib/sys.c
@@ -424,87 +424,82 @@ int fsync(int fd) {
int close(int fd)
{
+int res = 0;
+
printk("close(%d)\n",
On 11.01.22 19:19, Andrew Cooper wrote:
On 11/01/2022 14:58, Juergen Gross wrote:
The only reason for the file type FTYPE_XC has been gone long time
ago: it was needed for xc_map_foreign_bulk(), which has been switched
to use libxenforeignmemory and doesn't need this special file any
more.
So r
On 11.01.22 19:17, Andrew Cooper wrote:
On 11/01/2022 14:58, Juergen Gross wrote:
diff --git a/lib/sys.c b/lib/sys.c
index 6f2b026..0e6fe5d 100644
--- a/lib/sys.c
+++ b/lib/sys.c
@@ -98,6 +98,14 @@ struct file files[NOFILE] = {
{ .type = FTYPE_CONSOLE }, /* stderr */
};
+struct file *
On 11.01.22 19:11, Andrew Cooper wrote:
On 11/01/2022 14:58, Juergen Gross wrote:
diff --git a/lib/sys.c b/lib/sys.c
index 0e6fe5d..323a7cd 100644
--- a/lib/sys.c
+++ b/lib/sys.c
@@ -424,87 +424,82 @@ int fsync(int fd) {
int close(int fd)
{
+int res = 0;
+
printk("close(%d)\n",
On 11.01.22 19:08, Andrew Cooper wrote:
On 11/01/2022 14:58, Juergen Gross wrote:
Introduce file type specific function vectors for all the needed file
operations which are file type specific in order to prepare replacing
the large switch statements in each generic file function.
Add a function
On 11.01.22 21:08, Andrew Cooper wrote:
On 11/01/2022 15:03, Juergen Gross wrote:
libgnttab is using implementation details of Mini-OS. Change that by
letting libgnttab use the new alloc_file_type() and get_file_from_fd()
functions and the generic dev pointer of struct file from Mini-OS.
Signed
On 11.01.22 20:56, Andrew Cooper wrote:
On 11/01/2022 15:03, Juergen Gross wrote:
diff --git a/tools/libs/evtchn/minios.c b/tools/libs/evtchn/minios.c
index e5dfdc5ef5..c3a5ce3b98 100644
--- a/tools/libs/evtchn/minios.c
+++ b/tools/libs/evtchn/minios.c
@@ -38,29 +38,40 @@
#include "private.
flight 167663 linux-5.4 real [real]
flight 167670 linux-5.4 real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/167663/
http://logs.test-lab.xenproject.org/osstest/logs/167670/
Failures :-/ but no regressions.
Tests which are failing intermittently (not blocking):
test-amd64-amd6
Hi Thomas,
Is this fix the same as below?
https://marc.info/?l=linux-kernel&m=164061119923119&w=2
On 2022/01/11 3:12, Thomas Gleixner wrote:
The MSI entries for multi-MSI are populated en bloc for the MSI
descriptor,
but the current code invokes the population inside the per interrupt loop
whic
On second thought:
Juergen Gross, le mar. 11 janv. 2022 15:58:16 +0100, a ecrit:
> +typedef int file_read_func(int fd, void *buf, size_t nbytes);
> +typedef int file_write_func(int fd, const void *buf, size_t nbytes);
> +typedef off_t file_lseek_func(int fd, off_t offset, int whence);
> +typedef i
flight 167662 linux-linus real [real]
flight 167666 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/167662/
http://logs.test-lab.xenproject.org/osstest/logs/167666/
Failures :-/ but no regressions.
Tests which are failing intermittently (not blocking):
test-armhf-
flight 167661 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/167661/
Failures :-/ but no regressions.
Tests which did not succeed, but are not blocking:
test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stopfail like 167654
test-amd64-amd64-qemuu-nested-amd 20
On Tue, 11 Jan 2022, Volodymyr Babchuk wrote:
> Hi Stefano,
>
> Stefano Stabellini writes:
>
> > From: Stefano Stabellini
> >
> > Introduce a new "xen,enhanced" dom0less property to enable/disable PV
> > driver interfaces for dom0less guests. Currently only "enabled" and
> > "disabled" are supp
On Tue, 11 Jan 2022, David Vrabel wrote:
> On 10/01/2022 22:55, Stefano Stabellini wrote:
> >
> > I have a patch for Linux that if XENFEAT_xenstore_late_init is present
> > makes Linux wait for an event notification before initializing xenstore:
> > https://marc.info/?l=xen-devel&m=164160299315589
On Tue, 11 Jan 2022, Jan Beulich wrote:
> On 11.01.2022 00:08, Stefano Stabellini wrote:
> > On Mon, 10 Jan 2022, Jan Beulich wrote:
> >> On 08.01.2022 01:49, Stefano Stabellini wrote:
> >>> Introduce a new feature flag to signal that xenstore will not be
> >>> immediately available at boot time. I
On Mon, 10 Jan 2022, Jan Beulich wrote:
> On 08.01.2022 01:49, Stefano Stabellini wrote:
> > @@ -284,11 +285,32 @@ void evtchn_free(struct domain *d, struct evtchn *chn)
> > xsm_evtchn_close_post(chn);
> > }
> >
> > -static int evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
> > +struct
On Tue, 11 Jan 2022, Daniel P. Smith wrote:
> I would like to submit myself, Daniel P. Smith, as a reviewer of TXT support
> in
> Xen.
>
> Signed-off-by: Daniel P. Smith
Acked-by: Stefano Stabellini
> ---
> MAINTAINERS | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/MAINTAINERS b/
On Tue, Jan 11, 2022 at 3:29 PM Andrew Cooper wrote:
>
> On 11/01/2022 15:12, Juergen Gross wrote:
> > diff --git a/tpm_tis.c b/tpm_tis.c
> > index 477f555..abea7a1 100644
> > --- a/tpm_tis.c
> > +++ b/tpm_tis.c
> > @@ -1093,6 +1097,23 @@ ssize_t tpm_getcap(struct tpm_chip *chip, uint32_t
> > sub
flight 167659 qemu-mainline real [real]
flight 167664 qemu-mainline real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/167659/
http://logs.test-lab.xenproject.org/osstest/logs/167664/
Failures :-/ but no regressions.
Tests which are failing intermittently (not blocking):
test-ar
Juergen Gross, le mar. 11 janv. 2022 16:12:15 +0100, a ecrit:
> There is no user of the files[] array outside of lib/sys.c left, so
> it can be made static.
Yay!
> Signed-off-by: Juergen Gross
Reviewed-by: Samuel Thibault
> ---
> include/lib.h | 2 --
> lib/sys.c | 2 +-
> 2 files change
Juergen Gross, le mar. 11 janv. 2022 16:12:14 +0100, a ecrit:
> FTYPE_FILE is the last relevant file type without a struct file_ops.
> Add it.
>
> Signed-off-by: Juergen Gross
Reviewed-by: Samuel Thibault
> ---
> lib/sys.c | 19 +--
> 1 file changed, 9 insertions(+), 10 deleti
Samuel Thibault, le mar. 11 janv. 2022 21:05:47 +0100, a ecrit:
> Juergen Gross, le mar. 11 janv. 2022 15:58:16 +0100, a ecrit:
> > @@ -370,8 +413,45 @@ int write(int fd, const void *buf, size_t nbytes)
> > return -1;
> > }
> >
> > +off_t lseek_default(int fd, off_t offset, int whence)
> >
Juergen Gross, le mar. 11 janv. 2022 16:12:13 +0100, a ecrit:
> +static int socket_fstat(int fd, struct stat *buf)
> +{
> +buf->st_mode = S_IFSOCK | S_IRUSR | S_IWUSR;
> +buf->st_atime = buf->st_mtime = buf->st_ctime = time(NULL);
> +
> +return 0;
> +}
Similarly, this seems to be missi
Juergen Gross, le mar. 11 janv. 2022 16:12:12 +0100, a ecrit:
> +static int consfront_fstat(int fd, struct stat *buf)
> +{
> +struct file *file = get_file_from_fd(fd);
> +
> +buf->st_mode = S_IRUSR | S_IWUSR;
> +buf->st_mode |= (file->type == FTYPE_CONSOLE) ? S_IFCHR : S_IFREG;
> +b
On 11/01/2022 15:12, Juergen Gross wrote:
> diff --git a/tpm_tis.c b/tpm_tis.c
> index 477f555..abea7a1 100644
> --- a/tpm_tis.c
> +++ b/tpm_tis.c
> @@ -1093,6 +1097,23 @@ ssize_t tpm_getcap(struct tpm_chip *chip, uint32_t
> subcap_id, cap_t *cap,
> return rc;
> }
>
> +static void shut
Juergen Gross, le mar. 11 janv. 2022 16:12:11 +0100, a ecrit:
> +static struct file_ops fb_ops = {
> +.name = ".fb",
Why a dot?
Apart from that, and modulo the int fd / file * thing,
Reviewed-by: Samuel Thibault
Juergen Gross, le mar. 11 janv. 2022 16:12:10 +0100, a ecrit:
> Instead of directly accessing the files[] array use get_file_from_fd().
>
> Signed-off-by: Juergen Gross
modulo the int fd / file * thing,
Reviewed-by: Samuel Thibault
> ---
> include/lib.h | 3 +--
> lib/sys.c | 23 ---
On 11/01/2022 15:12, Juergen Gross wrote:
> void xs_daemon_close(struct xs_handle *h)
> {
> -int fd = _xs_fileno(h);
> -struct xenbus_event *event, *next;
> -for (event = files[fd].dev; event; event = next)
> -{
> -next = event->next;
> -free(event);
> -}
> +
Juergen Gross, le mar. 11 janv. 2022 16:12:09 +0100, a ecrit:
> Allocate the file type dynamically via alloc_file_type().
>
> Instead of directly accessing the files[] array use get_file_from_fd().
>
> Signed-off-by: Juergen Gross
modulo the int fd / file * thing,
Reviewed-by: Samuel Thibault
Juergen Gross, le mar. 11 janv. 2022 16:12:08 +0100, a ecrit:
> Allocate a file type dynamically via alloc_file_type().
>
> Instead of directly accessing the files[] array use get_file_from_fd().
>
> Signed-off-by: Juergen Gross
modulo the int fd / file * thing,
Reviewed-by: Samuel Thibault
On 11/01/2022 20:11, Samuel Thibault wrote:
> Samuel Thibault, le mar. 11 janv. 2022 21:06:15 +0100, a ecrit:
>> Juergen Gross, le mar. 11 janv. 2022 16:12:06 +0100, a ecrit:
>>> diff --git a/lib/xs.c b/lib/xs.c
>>> index 4af0f96..ac830d2 100644
>>> --- a/lib/xs.c
>>> +++ b/lib/xs.c
>>> @@ -18,23 +
Juergen Gross, le mar. 11 janv. 2022 16:12:07 +0100, a ecrit:
> Allocate a file type dynamically via alloc_file_type().
>
> Instead of directly accessing the files[] array use get_file_from_fd().
>
> Make some now local functions static and modify their prototypes to
> match the file_ops requirem
On 11/01/2022 15:12, Juergen Gross wrote:
> The event channel specific union member in struct file is no longer
Too much copy&paste from the previous patch?
The actual contents look fine.
~Andrew
> needed, so remove it.
>
> The gnttab file type and its associated handling can be removed, too,
>
Samuel Thibault, le mar. 11 janv. 2022 21:06:15 +0100, a ecrit:
> Juergen Gross, le mar. 11 janv. 2022 16:12:06 +0100, a ecrit:
> > Allocate the needed file type via alloc_file_type().
> >
> > Instead of directly accessing the files[] array use get_file_from_fd().
> >
> > Signed-off-by: Juergen G
On 11/01/2022 15:03, Juergen Gross wrote:
> There is no special file handling related to libxenctrl in Mini-OS
> any longer, so the close hook can be removed.
>
> Signed-off-by: Juergen Gross
Acked-by: Andrew Cooper
> ---
> V2:
> - new patch
> ---
> tools/libs/ctrl/xc_minios.c | 9 -
>
On 11/01/2022 15:03, Juergen Gross wrote:
> libgnttab is using implementation details of Mini-OS. Change that by
> letting libgnttab use the new alloc_file_type() and get_file_from_fd()
> functions and the generic dev pointer of struct file from Mini-OS.
>
> Signed-off-by: Juergen Gross
> ---
> V2
Juergen Gross, le mar. 11 janv. 2022 16:12:06 +0100, a ecrit:
> Allocate the needed file type via alloc_file_type().
>
> Instead of directly accessing the files[] array use get_file_from_fd().
>
> Signed-off-by: Juergen Gross
Reviewed-by: Samuel Thibault
> ---
> include/lib.h | 3 +--
> l
Juergen Gross, le mar. 11 janv. 2022 15:58:16 +0100, a ecrit:
> @@ -370,8 +413,45 @@ int write(int fd, const void *buf, size_t nbytes)
> return -1;
> }
>
> +off_t lseek_default(int fd, off_t offset, int whence)
> +{
> +switch ( whence )
> +{
Is there a reason for making this one a
Juergen Gross, le mar. 11 janv. 2022 15:58:16 +0100, a ecrit:
> +for ( i = FTYPE_N; i < ARRAY_SIZE(file_ops) && file_ops[i]; i++ );
For such loops, I'd rather see the ';' on its own line, to make it clear
it's an empty loop.
Samuel
On 11/01/2022 15:03, Juergen Gross wrote:
> diff --git a/tools/libs/evtchn/minios.c b/tools/libs/evtchn/minios.c
> index e5dfdc5ef5..c3a5ce3b98 100644
> --- a/tools/libs/evtchn/minios.c
> +++ b/tools/libs/evtchn/minios.c
> @@ -38,29 +38,40 @@
>
> #include "private.h"
>
> -extern void minios_ev
Juergen Gross, le mar. 11 janv. 2022 16:12:05 +0100, a ecrit:
> The event channel specific union member in struct file is no longer
> needed, so remove it.
>
> The gnttab file type and its associated handling can be removed, too,
> as libxengnttab is now supplying a struct file_ops via a call of
>
Juergen Gross, le mar. 11 janv. 2022 16:12:04 +0100, a ecrit:
> The event channel specific union member in struct file is no longer
> needed, so remove it together with the associated structure
> definitions.
>
> The event channel file type and its associated handling can be removed,
> too, as lib
On 11/01/2022 14:57, Juergen Gross wrote:
> Today the layout of struct file is depending on the Mini-OS
> configuration. This is especially bad as the layout is exported to
> external users like the Xen libraries built for Mini-OS, and those
> are being built only once for multiple stubdom configur
Andrew Cooper, le mar. 11 janv. 2022 18:08:27 +, a ecrit:
> On 11/01/2022 14:58, Juergen Gross wrote:
> > +typedef int file_read_func(int fd, void *buf, size_t nbytes);
> > +typedef int file_write_func(int fd, const void *buf, size_t nbytes);
> > +typedef off_t file_lseek_func(int fd, off_t off
On 11/01/2022 14:58, Juergen Gross wrote:
> diff --git a/lib/sys.c b/lib/sys.c
> index 0e6fe5d..323a7cd 100644
> --- a/lib/sys.c
> +++ b/lib/sys.c
> @@ -424,87 +424,82 @@ int fsync(int fd) {
>
> int close(int fd)
> {
> +int res = 0;
> +
> printk("close(%d)\n", fd);
> switch (files
On 11/01/2022 21:21, Daniel P. Smith wrote:
> I would like to submit myself, Daniel P. Smith, as a reviewer of TXT support
> in
> Xen.
>
> Signed-off-by: Daniel P. Smith
Acked-by: Andrew Cooper
On 11/01/2022 14:58, Juergen Gross wrote:
> The only reason for the file type FTYPE_XC has been gone long time
> ago: it was needed for xc_map_foreign_bulk(), which has been switched
> to use libxenforeignmemory and doesn't need this special file any
> more.
>
> So remove everything related to FTYP
On 11/01/2022 14:58, Juergen Gross wrote:
> diff --git a/lib/sys.c b/lib/sys.c
> index 6f2b026..0e6fe5d 100644
> --- a/lib/sys.c
> +++ b/lib/sys.c
> @@ -98,6 +98,14 @@ struct file files[NOFILE] = {
> { .type = FTYPE_CONSOLE }, /* stderr */
> };
>
> +struct file *get_file_from_fd(int fd)
> +
On 11/01/2022 14:58, Juergen Gross wrote:
> diff --git a/lib/sys.c b/lib/sys.c
> index 0e6fe5d..323a7cd 100644
> --- a/lib/sys.c
> +++ b/lib/sys.c
> @@ -424,87 +424,82 @@ int fsync(int fd) {
>
> int close(int fd)
> {
> +int res = 0;
> +
> printk("close(%d)\n", fd);
> switch (files
On 11/01/2022 14:58, Juergen Gross wrote:
> Introduce file type specific function vectors for all the needed file
> operations which are file type specific in order to prepare replacing
> the large switch statements in each generic file function.
>
> Add a function to allocate a new file type dynam
I would like to submit myself, Daniel P. Smith, as a reviewer of TXT support in
Xen.
Signed-off-by: Daniel P. Smith
---
MAINTAINERS | 1 +
1 file changed, 1 insertion(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 6e84a05760..4a2884dfa7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -317,6 +317
On 06/12/2021 13:25, Jan Beulich wrote:
> Top level table and intermediate table entries get explicitly set to
> INVALID_MFN when un-allocated. There's therefore no need to use the more
> expensive mfn_valid() when checking for that sentinel.
>
> Suggested-by: Andrew Cooper
> Signed-off-by: Jan Be
On 06/12/2021 13:25, Jan Beulich wrote:
> The function returning a boolean indicator, make it return bool. Also
> constify its struct domain parameter, albeit requiring to also adjust
> mm_locked_by_me(). Furthermore the function is used by shadow code only.
>
> Since mm_locked_by_me() needs touchi
On Thu, Nov 25, 2021 at 01:02:41PM +0200, Oleksandr Andrushchenko wrote:
> From: Oleksandr Andrushchenko
>
> When a vPCI is removed for a PCI device it is possible that we have
> scheduled a delayed work for map/unmap operations for that device.
> For example, the following scenario can illustrat
It is possible now to make the callback for Mini-OS static, as it is
only referenced via the file_ops vector.
Signed-off-by: Juergen Gross
---
tools/libs/gnttab/minios.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/tools/libs/gnttab/minios.c b/tools/libs/gnttab/minios.c
This is a final patch series making the callbacks static now referenced
by the file_ops vector only.
Note that this series depends on the related Mini-OS series to have
gone in:
https://lists.xen.org/archives/html/xen-devel/2022-01/threads.html#00369
Juergen Gross (2):
tools/libs/evtchn: make
It is possible now to make the callback for Mini-OS static, as it is
only referenced via the file_ops vector.
Signed-off-by: Juergen Gross
---
tools/libs/evtchn/minios.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/tools/libs/evtchn/minios.c b/tools/libs/evtchn/minios.c
Juergen Gross, le mar. 11 janv. 2022 15:58:15 +0100, a ecrit:
> Today the file type in struct file is set to FTYPE_NONE for each
> file type individually. Do that at the end of close() handling for
> all types.
>
> While at it wipe the complete struct file, too, in order to avoid
> old data creepi
Allocate file types dynamically via alloc_file_type().
Instead of directly accessing the files[] array use get_file_from_fd().
Signed-off-by: Juergen Gross
---
fbfront.c | 125 ++
include/lib.h | 4 +-
lib/sys.c | 47 ---
Even with some special handling needed in select_poll(), add a struct
file_ops for FTYPE_SOCKET. Due to the need of the special handling it
isn't possible to use a dynamically allocated file type.
Most functions calling the file_ops methods can be simplified a lot now
that no file type specific ha
On Thu, Nov 25, 2021 at 01:02:40PM +0200, Oleksandr Andrushchenko wrote:
> diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
> index 657697fe3406..ceaac4516ff8 100644
> --- a/xen/drivers/vpci/vpci.c
> +++ b/xen/drivers/vpci/vpci.c
> @@ -35,12 +35,10 @@ extern vpci_register_init_t *cons
There is no user of the files[] array outside of lib/sys.c left, so
it can be made static.
Signed-off-by: Juergen Gross
---
include/lib.h | 2 --
lib/sys.c | 2 +-
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/include/lib.h b/include/lib.h
index c171fe8..80e804b 100644
--- a/
Allocate the file type dynamically via alloc_file_type().
Instead of directly accessing the files[] array use get_file_from_fd().
Signed-off-by: Juergen Gross
---
blkfront.c | 92 ++
include/blkfront.h | 5 ---
include/lib.h | 3 +-
lib
FTYPE_FILE is the last relevant file type without a struct file_ops.
Add it.
Signed-off-by: Juergen Gross
---
lib/sys.c | 19 +--
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/lib/sys.c b/lib/sys.c
index 12deaed..0f42e97 100644
--- a/lib/sys.c
+++ b/lib/sys.c
@@
Add struct file_ops for the console related file types (FTYPE_CONSOLE
and savefile). FTYPE_CONSOLE remains statically defined, as it is used
to statically init stdin, stdout and stderr.
Instead of directly accessing the files[] array use get_file_from_fd().
With CONSOLE now handled via file_ops t
Instead of directly accessing the files[] array use get_file_from_fd().
Signed-off-by: Juergen Gross
---
include/lib.h | 3 +--
lib/sys.c | 23 --
netfront.c| 64 ---
3 files changed, 57 insertions(+), 33 deletions(-)
diff
Allocate a file type dynamically via alloc_file_type().
Instead of directly accessing the files[] array use get_file_from_fd().
Make some now local functions static and modify their prototypes to
match the file_ops requirements.
Signed-off-by: Juergen Gross
---
include/lib.h | 3 +-
incl
Allocate a file type dynamically via alloc_file_type().
Instead of directly accessing the files[] array use get_file_from_fd().
Signed-off-by: Juergen Gross
---
include/lib.h | 3 +-
include/tpmfront.h | 5 ---
lib/sys.c | 23 ---
tpmfront.c | 100
This small series is a followup to the series sent recently:
https://lists.xen.org/archives/html/xen-devel/2022-01/threads.html#00347
It contains the last cleanups related to struct file and can only be
applied after the Xen libraries have stopped using the related union
members:
https://lists.x
Allocate the needed file type via alloc_file_type().
Instead of directly accessing the files[] array use get_file_from_fd().
Signed-off-by: Juergen Gross
---
include/lib.h | 3 +--
lib/sys.c | 18 --
lib/xs.c| 64 +
xe
The event channel specific union member in struct file is no longer
needed, so remove it.
The gnttab file type and its associated handling can be removed, too,
as libxengnttab is now supplying a struct file_ops via a call of
alloc_file_type().
This removes all contents of CONFIG_LIBXENGNTTAB guar
The event channel specific union member in struct file is no longer
needed, so remove it together with the associated structure
definitions.
The event channel file type and its associated handling can be removed,
too, as libxenevtchn is now supplying a struct file_ops via a call of
alloc_file_type
Today the file type in struct file is set to FTYPE_NONE for each
file type individually. Do that at the end of close() handling for
all types.
While at it wipe the complete struct file, too, in order to avoid
old data creeping into a new allocated struct file.
Signed-off-by: Juergen Gross
---
V2
Replace the fbfront specific union member in struct file with the
common dev pointer.
Signed-off-by: Juergen Gross
Reviewed-by: Samuel Thibault
---
fbfront.c | 2 +-
include/lib.h | 3 ---
lib/sys.c | 4 ++--
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/fbfront.c b/fbf
Exporting the files[] array especially for components outside the
mini-os source tree is limiting the ability to change any file handling
in mini-os.
Introduce a new function get_file_from_fd() to return the struct file
pointer (or NULL) for a given file descriptor.
Signed-off-by: Juergen Gross
Replace the tpmfront specific union member in struct file with the
common dev pointer.
Signed-off-by: Juergen Gross
Reviewed-by: Samuel Thibault
---
include/lib.h | 5 -
lib/sys.c | 2 +-
tpmfront.c| 8
3 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/include
Replace the tpmtis specific union member in struct file with the
common dev pointer.
Signed-off-by: Juergen Gross
Reviewed-by: Samuel Thibault
---
include/lib.h | 5 -
lib/sys.c | 2 +-
tpm_tis.c | 8
3 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/include/l
The read member of struct file should be bool.
In order to have the device specific part at the end of the structure
move "read" ahead of that.
Signed-off-by: Juergen Gross
Reviewed-by: Samuel Thibault
---
blkfront.c | 4 ++--
console/xencons_ring.c | 2 +-
fbfront.c
Introduce file type specific function vectors for all the needed file
operations which are file type specific in order to prepare replacing
the large switch statements in each generic file function.
Add a function to allocate a new file type dynamically in order to
prepare removing direct dependen
The only reason for the file type FTYPE_XC has been gone long time
ago: it was needed for xc_map_foreign_bulk(), which has been switched
to use libxenforeignmemory and doesn't need this special file any
more.
So remove everything related to FTYPE_XC.
Signed-off-by: Juergen Gross
---
V2:
- new pa
Replace the xenbus specific union member in struct file with the
common dev pointer.
Signed-off-by: Juergen Gross
Reviewed-by: Samuel Thibault
---
include/lib.h | 7 ---
lib/sys.c | 2 +-
lib/xs.c | 13 +++--
3 files changed, 8 insertions(+), 14 deletions(-)
diff --git a
This small series removes some hard coupling of the Xen build with some
Mini-OS internals, especially the struct file layout and the internal
organization of the file handling.
This series depends on the Mini-OS series posted recently:
https://lists.xen.org/archives/html/xen-devel/2022-01/threads
Mini-OS and libevtchn are using implementation details of each other.
Change that by letting libevtchn use the new alloc_file_type() and
get_file_from_fd() functions and the generic dev pointer of struct
file from Mini-OS.
By using private struct declarations Mini-OS will be able to drop the
libev
libgnttab is using implementation details of Mini-OS. Change that by
letting libgnttab use the new alloc_file_type() and get_file_from_fd()
functions and the generic dev pointer of struct file from Mini-OS.
Signed-off-by: Juergen Gross
---
V2:
- add alloc_file_type() support
---
tools/libs/gntta
There is no special file handling related to libxenctrl in Mini-OS
any longer, so the close hook can be removed.
Signed-off-by: Juergen Gross
---
V2:
- new patch
---
tools/libs/ctrl/xc_minios.c | 9 -
1 file changed, 9 deletions(-)
diff --git a/tools/libs/ctrl/xc_minios.c b/tools/libs/c
Replace the netfront specific union member in struct file with the
common dev pointer.
Signed-off-by: Juergen Gross
Reviewed-by: Samuel Thibault
---
include/lib.h | 3 ---
lib/sys.c | 6 +++---
netfront.c| 2 +-
3 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/include/lib.
The type specific union in struct files contains two instances of
"int fd". Replace them by a common one.
Signed-off-by: Juergen Gross
Reviewed-by: Samuel Thibault
---
include/lib.h | 9 +
lib/sys.c | 28 ++--
2 files changed, 15 insertions(+), 22 deletions(
Currently 4 file types have an offset member in their private struct
file part. Make offset a common struct member shared by all file types.
Signed-off-by: Juergen Gross
Reviewed-by: Samuel Thibault
---
blkfront.c| 5 ++---
include/lib.h | 5 +
lib/sys.c | 14 +-
tpm_t
Replace the kbdfront specific union member in struct file with the
common dev pointer.
Signed-off-by: Juergen Gross
Reviewed-by: Samuel Thibault
---
fbfront.c | 2 +-
include/lib.h | 3 ---
lib/sys.c | 4 ++--
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/fbfront.c b/fb
Replace the blkfront specific union member in struct file with the
common dev pointer.
Signed-off-by: Juergen Gross
Reviewed-by: Samuel Thibault
---
blkfront.c| 6 +++---
include/lib.h | 3 ---
lib/sys.c | 2 +-
3 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/blkfront.c b
Replace the consfront specific union member in struct file with the
common dev pointer.
Signed-off-by: Juergen Gross
Reviewed-by: Samuel Thibault
---
include/lib.h | 3 ---
lib/sys.c | 31 +--
2 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/incl
There are many dev pointers in a union in struct file. Prepare to
switch to a single one by introducing a new common one.
Signed-off-by: Juergen Gross
Reviewed-by: Samuel Thibault
---
include/lib.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/lib.h b/include/lib.h
index dc56f52..
1 - 100 of 126 matches
Mail list logo