Skip to contentSkip to conversation

kvm tools: ignore nonexisting custom stage2

PATCH In review Konstantin Khlebnikov 2 participants 6 messages Dec 21, 2011 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kvm tools: ignore nonexisting custom stage2

fix permanent failing with message "Fatal: Failed linking stage 2 of init." if there is no custom init_stage2.

---
 tools/kvm/builtin-run.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tools/kvm/builtin-run.c +1 -1
index fac274c..094c0fa2 100644
@@ -752,7 +752,7 @@ static int kvm_custom_stage2(void)
 
 	src = realpath("guest/init_stage2", NULL);
 	if (src == NULL)
-		return -ENOMEM;
+		return errno == ENOENT ? 0 : -errno;
 
 	snprintf(tmp, PATH_MAX, "%s%s/virt/init_stage2", kvm__get_dir(), rootfs);
 	remove(tmp);
#1 lore raw
Quoted 2 lines · Konstantin Khlebnikov

fix permanent failing with message "Fatal: Failed linking stage 2 of init." if there is no custom init_stage2.

Why would it happen? whats the usecase?

Signature · 1 line
Sasha.
#2 lore raw
Quoted 6 lines · Sasha Levin
Quoted 2 lines · Konstantin Khlebnikov

fix permanent failing with message "Fatal: Failed linking stage 2 of init." if there is no custom init_stage2.

Why would it happen? whats the usecase?

run "lkvm run" in dir there is no "guest" subdirectory

#3 lore raw
Quoted 9 lines · Konstantin Khlebnikov
Quoted 6 lines · Sasha Levin
Quoted 2 lines · Konstantin Khlebnikov

fix permanent failing with message "Fatal: Failed linking stage 2 of init." if there is no custom init_stage2.

Why would it happen? whats the usecase?

run "lkvm run" in dir there is no "guest" subdirectory

Yup, but how would that happen? 'guest' is part of the git tree and the makefile builds the executables in it.

Signature · 1 line
Sasha.
#4 lore raw
Quoted 6 lines · Sasha Levin
Quoted 5 lines · Konstantin Khlebnikov
Quoted 4 lines · Sasha Levin
Quoted 2 lines · Konstantin Khlebnikov

fix permanent failing with message "Fatal: Failed linking stage 2 of init." if there is no custom init_stage2.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Why would it happen? whats the usecase?

run "lkvm run" in dir there is no "guest" subdirectory

Yup, but how would that happen? 'guest' is part of the git tree and the makefile builds the executables in it.

Current wokring directory can be anything,
or lkvm supposed to work only if cwd is .../linux-kvm/tools/kvm ? =)

#5 lore raw
Quoted 10 lines · Konstantin Khlebnikov
Quoted 9 lines · Sasha Levin
Quoted 8 lines · Konstantin Khlebnikov
Quoted 6 lines · Sasha Levin
Quoted 2 lines · Konstantin Khlebnikov

fix permanent failing with message "Fatal: Failed linking stage 2 of init." if there is no custom init_stage2.

Why would it happen? whats the usecase?

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

run "lkvm run" in dir there is no "guest" subdirectory

Yup, but how would that happen? 'guest' is part of the git tree and the makefile builds the executables in it.

Current wokring directory can be anything,
or lkvm supposed to work only if cwd is .../linux-kvm/tools/kvm ? =)

Right, so this is the issue that should really be fixed.

If you omit the 'guest' directory, custom rootfs won't work at all either, so just ignoring that check would lead to breakage later on.

Signature · 1 line
Sasha.