FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 07-13-2010, 03:58 PM
Martin Sivak
 
Default 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
 
Old 07-14-2010, 02:16 PM
Chris Lumens
 
Default 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
 
Old 07-16-2010, 02:27 PM
Chris Lumens
 
Default 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
 
Old 07-17-2010, 12:57 AM
David Cantrell
 
Default 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
 

Thread Tools




All times are GMT. The time now is 09:07 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org