google / novm

Experimental KVM-based VMM for containers, written in Go.
Apache License 2.0
1.68k stars 123 forks source link

[master] Tiny fix. (1.missing "import os" in block.py 2.parameter name t... #30

Closed Jimmy-Xu closed 9 years ago

Jimmy-Xu commented 9 years ago

Tiny fix. (1.missing "import os" in block.py 2.parameter name typo of "--disk" in shell.py)

[issue 1] $sudo novm --debug create --name test --nofork --disk file=/var/lib/libvirt/images/alice.img,dev=vda,debug=true

Traceback (most recent call last): File "./novm/cli.py", line 203, in main result = fn(*built_args) ...... File "./novm/block.py", line 41, in create "fd": os.dup(f.fileno()), NameError: global name 'os' is not defined

Missing import os here.


After fix issue1, issue2 occur: [issue 2] $sudo novm --debug create --name test --nofork --disk file=/var/lib/libvirt/images/rhel7.qcow2,dev=vda,debug=true

Traceback (most recent call last): File "/usr/bin/../lib/novm/python/novm/cli.py", line 203, in main result = fn(_built_args) ...... File "/usr/bin/../lib/novm/python/novm/virtio.py", line 65, in create *_kwargs) TypeError: create() got an unexpected keyword argument 'file'


    Disk definitions are provided as --disk [opt=val],...

        Available options are:

        file=filename     Set the backing file (raw). 
        dev=vda               Set the device name.
        debug=true            Enable debugging.

The real parameter in block.py is filename, but the description in shell.py is file.

amscanne commented 9 years ago

Hi, the fix looks fine. Please see CONTRIBUTING for instructions on the signing the CLA.

Jimmy-Xu commented 9 years ago

CLA has been submitted.

amscanne commented 9 years ago

Sorry -- I couldn't find your CLA (it doesn't seem to be associated with your username). Can you drop me a line and we'll figure it out? In the meantime, I've pushed two small commits for the errors you described.