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

Re: [master 1/2] logging: support logging through virtio-serial (#576439).



> +    
> +    if (strlen(virtiolog)) {
> +        /* virtio_console doesn't work until virtio_pci is loaded */
> +        int childpid;
> +        int waitstatus;
> +        childpid = fork();
> +        printf("Loading virtio_pci module... ");
> +        if (!childpid) {
> +            int fd;
> +            /* suppress stdout */
> +            fd = open("/dev/null", O_WRONLY);
> +            dup2(fd, STDOUT_FILENO);
> +            close(fd);
> +            /* now run modprobe */
> +            ret = execl("/sbin/modprobe", "/sbin/modprobe",
> "virtio_pci", NULL);
> +        }
> +        waitpid(childpid, &waitstatus, 0);
> +        if (!WIFEXITED(waitstatus) || 
> +            (WIFEXITED(waitstatus) && WEXITSTATUS(waitstatus))) {
> +            printf("Error loading virtio_pci module. ");
> +            printf("Virtio logging will not work.\n.");
> +            sleep(5);
> +        } else {
> +            printf("done.\n");
> +        }
> +    }

Why didn't you use mlLoadModuleSet directly? This duplicates code a bit..


--
Martin Sivák
msivak redhat com
Red Hat Czech
Anaconda team / Brno, CZ


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