[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] do not chdir(/) in qemu-nbd
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH] do not chdir(/) in qemu-nbd |
Date: |
Fri, 13 Jan 2012 11:57:54 +0000 |
On Fri, Jan 13, 2012 at 9:04 AM, Michael Tokarev <address@hidden> wrote:
> When qemu-nbd becomes a daemon it calls daemon(3) with
> nochdir=0, so daemon(3) changes current directory to /.
> But at this time, qemu-nbd did not open any user-specified
> files yet, so by changing current directory, all non-absolute
> paths becomes wrong. The solution is to pass nochdir=1 to
> daemon(3) function.
It's polite to chdir("/") so that file systems can be unmounted (even
more important when chroot was involved, but I think qemu-nbd doesn't
do that). Is it possible to manually do a chdir("/") later on after
we've opened necessary files?
Stefan