qemu-block
[Top][All Lists]
Advanced

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

Re: [PATCH v7 2/8] file-posix: introduce get_sysfs_str_val for device zo


From: Sam Li
Subject: Re: [PATCH v7 2/8] file-posix: introduce get_sysfs_str_val for device zoned model
Date: Tue, 23 Aug 2022 12:31:05 +0800

Stefan Hajnoczi <stefanha@redhat.com> 于2022年8月23日周二 07:05写道:
>
> On Tue, Aug 16, 2022 at 02:25:16PM +0800, Sam Li wrote:
> > +static int hdev_get_max_segments(int fd, struct stat *st) {
> > +    int ret;
> > +    if (S_ISCHR(st->st_mode)) {
> > +        if (ioctl(fd, SG_GET_SG_TABLESIZE, &ret) == 0) {
>
> The ioctl must be within #ifdef CONFIG_LINUX since SG_GET_SG_TABLESIZE
> will be undefined on other operating systems and a compiler error will
> be encountered. Maybe keep the #ifdef around the entire body of this
> hdev_get_max_segments().
>
> > +            return ret;
> > +        }
> > +        return -ENOTSUP;
> >      }
> > -    g_free(sysfspath);
> > -    return ret;
> > -#else
> > -    return -ENOTSUP;
> > -#endif
> > +    return get_sysfs_long_val(st, "max_segments");
>
> Where is get_sysfs_long_val() defined? Maybe in a later patch? The code
> must compile after each patch. You can test this with "git rebase -i
> origin/master" and then adding "x make" lines after each commit in the
> interactive rebase file. When rebase runs it will execute make after
> each commit and will stop if make fails.

Explained in the next patch. I will make sure the patches compile in future.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]