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

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

 



> +    
> +    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@xxxxxxxxxx
Red Hat Czech
Anaconda team / Brno, CZ

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list



[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux