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.
.");
> + sleep(5);
> + } else {
> + printf("done.
");
> + }
> + }
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
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
07-14-2010, 02:16 PM
Chris Lumens
logging: support logging through virtio-serial (#576439).
> >Why didn't you use mlLoadModuleSet directly? This duplicates code a bit..
> >
>
> Good question! I thought about and then found out it called
> _doLoadModule which is calling logging functions. But at that point
> logging is yet to be set up.
Perhaps you can conditionalize logging in _doLoadModule to not be called
if it's not set up, then? I think that would be much preferred to
duplicating module loading code.
- Chris
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
07-16-2010, 02:27 PM
Chris Lumens
logging: support logging through virtio-serial (#576439).
> Okay, there is one more problem I think: init.c is not linked
> against modules.c. I would have to add modules.c and all it's
> dependencies (including isys) to init.c. Should I still go for it?
It's worth testing out and seeing what results. From looking at
modules.c real quick, the first major problem I see is
loadKickstartModule which introduces a requirement on newt. I guess
it's not such a big deal anymore in the land of dynamically linked
init/loader, but it's still pretty gross.
- Chris
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
07-17-2010, 12:57 AM
David Cantrell
logging: support logging through virtio-serial (#576439).
On Fri, 16 Jul 2010, Chris Lumens wrote:
Okay, there is one more problem I think: init.c is not linked
against modules.c. I would have to add modules.c and all it's
dependencies (including isys) to init.c. Should I still go for it?
It's worth testing out and seeing what results. From looking at
modules.c real quick, the first major problem I see is
loadKickstartModule which introduces a requirement on newt. I guess
it's not such a big deal anymore in the land of dynamically linked
init/loader, but it's still pretty gross.
Hopefully we won't care about this much longer if we can get anaconda moved to
using the system /sbin/init rather than our own.
--
David Cantrell <dcantrell@redhat.com>
Red Hat / Honolulu, HI
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list