Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

capstan doesnt start qemu, invalid argument #118

Closed
maci0 opened this issue Sep 6, 2014 · 11 comments · Fixed by #119
Closed

capstan doesnt start qemu, invalid argument #118

maci0 opened this issue Sep 6, 2014 · 11 comments · Fixed by #119

Comments

@maci0
Copy link

maci0 commented Sep 6, 2014

capstan run cloudius/osv
Created instance: cloudius-osv
qemu-system-x86_64: -drive file=/home/maci/.capstan/instances/qemu/cloudius-osv/disk.qcow2,if=none,id=hd0,aio=native,cache=none: could not open disk image /home/maci/.capstan/instances/qemu/cloudius-osv/disk.qcow2: Invalid argument

exit status 1
@maci0
Copy link
Author

maci0 commented Sep 8, 2014

FIY my /home is on zfs maybe thats the culprint ?

@dorlaor
Copy link

dorlaor commented Sep 8, 2014

On Mon, Sep 8, 2014 at 10:22 AM, Marcel Wysocki notifications@github.com
wrote:

FIY my /home is on zfs maybe thats the culprint ?

It's not a local filesystem issue.
It's either a bug or something happened to this image.
Can you run 'capstan rmi cloudius/osv'
and run it again?

Is this file present? I check and it works for me.
What happens when you run 'qemu-system-x86_64' directly w/o any parameter?
I like to see it can run (expect a pxe prompt)


Reply to this email directly or view it on GitHub
#118 (comment)
.

@penberg
Copy link
Contributor

penberg commented Sep 8, 2014

@maci0 AFAICT, that error is coming from QEMU and actually might be related to ZFS. If removing the image and downloading it again like @dorlaor suggested doesn't fix it, can you please run capstan with strace -f and post the results here?

@maci0
Copy link
Author

maci0 commented Sep 9, 2014

[pid 27835] rt_sigaction(SIGBUS, {0x7f94d88c9fb0, [], SA_RESTORER|SA_SIGINFO, 0x7f94d68d6720}, NULL, 8) = 0
[pid 27835] prctl(PR_MCE_KILL, 0x1, 0x1, 0, 0) = 0
[pid 27835] brk(0)                      = 0x7f94d97d6000
[pid 27835] brk(0x7f94d97f7000)         = 0x7f94d97f7000
[pid 27835] open("/home/maci/.capstan/instances/qemu/cloudius-osv/disk.qcow2", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = 9
[pid 27835] fstat(9, {st_mode=S_IFREG|0644, st_size=197120, ...}) = 0
[pid 27835] close(9)                    = 0
[pid 27835] open("/home/maci/.capstan/instances/qemu/cloudius-osv/disk.qcow2", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = 9
[pid 27835] fstat(9, {st_mode=S_IFREG|0644, st_size=197120, ...}) = 0
[pid 27835] close(9)                    = 0
[pid 27835] stat("/home/maci/.capstan/instances/qemu/cloudius-osv/disk.qcow2", {st_mode=S_IFREG|0644, st_size=197120, ...}) = 0
[pid 27835] open("/home/maci/.capstan/instances/qemu/cloudius-osv/disk.qcow2", O_RDWR|O_DIRECT|O_CLOEXEC) = -1 EINVAL (Invalid argument)
[pid 27835] rt_sigprocmask(SIG_BLOCK, NULL, [BUS USR1 ALRM IO], 8) = 0
[pid 27835] mmap(NULL, 1052672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f94d84f1000
[pid 27835] rt_sigprocmask(SIG_SETMASK, [BUS USR1 ALRM IO], [BUS USR1 ALRM IO], 8) = 0
[pid 27835] brk(0)                      = 0x7f94d97f7000
[pid 27835] brk(0)                      = 0x7f94d97f7000
[pid 27835] brk(0x7f94d97f6000)         = 0x7f94d97f6000
[pid 27835] brk(0)                      = 0x7f94d97f6000
[pid 27835] write(2, "qemu-system-x86_64:", 19qemu-system-x86_64:) = 19
[pid 27835] write(2, " -drive", 7 -drive)      = 7
[pid 27835] write(2, " file=/home/maci/.capstan/instan"..., 101 file=/home/maci/.capstan/instances/qemu/cloudius-osv/disk.qcow2,if=none,id=hd0,aio=native,cache=none) = 101
[pid 27835] write(2, ": ", 2: )           = 2
[pid 27835] write(2, "could not open disk image /home/"..., 102could not open disk image /home/maci/.capstan/instances/qemu/cloudius-osv/disk.qcow2: Invalid argument) = 102
[pid 27835] write(2, "\n", 1
)           = 1

i think the problem is O_DIRECT openzfs/zfs#224
which comes from the cache=none option

@dorlaor
Copy link

dorlaor commented Sep 9, 2014

On Tue, Sep 9, 2014 at 11:37 AM, Marcel Wysocki notifications@github.com
wrote:

[pid 27835] rt_sigaction(SIGBUS, {0x7f94d88c9fb0, [], SA_RESTORER|SA_SIGINFO, 0x7f94d68d6720}, NULL, 8) = 0
[pid 27835] prctl(PR_MCE_KILL, 0x1, 0x1, 0, 0) = 0
[pid 27835] brk(0) = 0x7f94d97d6000
[pid 27835] brk(0x7f94d97f7000) = 0x7f94d97f7000
[pid 27835] open("/home/maci/.capstan/instances/qemu/cloudius-osv/disk.qcow2", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = 9
[pid 27835] fstat(9, {st_mode=S_IFREG|0644, st_size=197120, ...}) = 0
[pid 27835] close(9) = 0
[pid 27835] open("/home/maci/.capstan/instances/qemu/cloudius-osv/disk.qcow2", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = 9
[pid 27835] fstat(9, {st_mode=S_IFREG|0644, st_size=197120, ...}) = 0
[pid 27835] close(9) = 0
[pid 27835] stat("/home/maci/.capstan/instances/qemu/cloudius-osv/disk.qcow2", {st_mode=S_IFREG|0644, st_size=197120, ...}) = 0
[pid 27835] open("/home/maci/.capstan/instances/qemu/cloudius-osv/disk.qcow2", O_RDWR|O_DIRECT|O_CLOEXEC) = -1 EINVAL (Invalid argument)
[pid 27835] rt_sigprocmask(SIG_BLOCK, NULL, [BUS USR1 ALRM IO], 8) = 0
[pid 27835] mmap(NULL, 1052672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f94d84f1000
[pid 27835] rt_sigprocmask(SIG_SETMASK, [BUS USR1 ALRM IO], [BUS USR1 ALRM IO], 8) = 0
[pid 27835] brk(0) = 0x7f94d97f7000
[pid 27835] brk(0) = 0x7f94d97f7000
[pid 27835] brk(0x7f94d97f6000) = 0x7f94d97f6000
[pid 27835] brk(0) = 0x7f94d97f6000
[pid 27835] write(2, "qemu-system-x86_64:", 19qemu-system-x86_64:) = 19
[pid 27835] write(2, " -drive", 7 -drive) = 7
[pid 27835] write(2, " file=/home/maci/.capstan/instan"..., 101 file=/home/maci/.capstan/instances/qemu/cloudius-osv/disk.qcow2,if=none,id=hd0,aio=native,cache=none) = 101
[pid 27835] write(2, ": ", 2: ) = 2
[pid 27835] write(2, "could not open disk image /home/"..., 102could not open disk image /home/maci/.capstan/instances/qemu/cloudius-osv/disk.qcow2: Invalid argument) = 102
[pid 27835] write(2, "\n", 1
) = 1

i think the problem is O_DIRECT openzfs/zfs#224
openzfs/zfs#224
which comes from the cache=none option

You are correct. Too bad...
@penberg, how about adding an option to use cache=writethrough|none ?
In the mean time, just patch Capstan manually.


Reply to this email directly or view it on GitHub
#118 (comment)
.

@tgrabiec
Copy link
Member

tgrabiec commented Sep 9, 2014

@dOr I think this decision could be automated in the same way as OSv's run.py automates it since commit cloudius-systems/osv@1989d9e

@dorlaor
Copy link

dorlaor commented Sep 9, 2014

On Tue, Sep 9, 2014 at 5:59 PM, Tomasz Grabiec notifications@github.com
wrote:

@dOr https://github.com/dor I think this decision could be automated in
the same way as OSv's run.py automates it since commit
cloudius-systems/osv@1989d9e
cloudius-systems/osv@1989d9e

It's possible.
The error report is misleading: "raise Exception('Path not found: ' + path)"
Also, one shouldn't use cache=unsafe w/o being verbose about it.

Reply to this email directly or view it on GitHub
#118 (comment)
.

@tgrabiec
Copy link
Member

tgrabiec commented Sep 9, 2014

2014-09-09 17:02 GMT+02:00 dorlaor notifications@github.com:

On Tue, Sep 9, 2014 at 5:59 PM, Tomasz Grabiec notifications@github.com
wrote:

@dOr https://github.com/dor I think this decision could be automated
in
the same way as OSv's run.py automates it since commit
cloudius-systems/osv@1989d9e
<
cloudius-systems/osv@1989d9eabc97d68c3a57181ff584f1b830705d98>

It's possible.
The error report is misleading: "raise Exception('Path not found: ' +
path)"

This error is thrown only when the path does not exist, it's unrelated to
the O_DIRECT thing.

Also, one shouldn't use cache=unsafe w/o being verbose about it.

@penberg
Copy link
Contributor

penberg commented Sep 15, 2014

@maci0 I opened pull request #119 that should fix it. If you have the time, can you please test it on your machine?

@jpeach
Copy link
Contributor

jpeach commented Oct 3, 2014

FYI, this change breaks the OS X build because sys call.O_DIRECT is not available ...

$ GOPATH=$HOME/go ./install
# github.com/cloudius-systems/capstan/hypervisor/qemu
hypervisor/qemu/qemu.go:231: undefined: syscall.O_DIRECT
# github.com/cloudius-systems/capstan/hypervisor/qemu
hypervisor/qemu/qemu.go:231: undefined: syscall.O_DIRECT

@penberg
Copy link
Contributor

penberg commented Oct 4, 2014

@jpeach I opened pull request #121 to fix that up. Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants