On 07/02/2010 06:08 AM, Amos Kong wrote:
> On Wed, Jun 30, 2010 at 09:52:47PM +0300, Michael Goldish wrote:
>> On 06/30/2010 08:42 PM, Lucas Meneghel Rodrigues wrote:
>>> On Thu, 2010-07-01 at 01:32 +0800, Amos Kong wrote:
>>>> qemu-kvm man page:
>>>> ...
>>>> -tftp dir
>>>>       When using the user mode network stack, activate a built-in TFTP 
>>>> server.
>>>>       The files in dir will be exposed as the root of a TFTP server.  The 
>>>> TFTP
>>>>       client on the guest must be configured in binary mode (use the 
>>>> command
>>>>       "bin" of the Unix TFTP client). The host IP address on the guest is 
>>>> as
>>>>       usual 10.0.2.2.
>>>
>>> Yeah, good catch! Applied, thanks.
>>>
>>>> Signed-off-by: Amos Kong <[email protected]>
>>>> ---
>>>>  0 files changed, 0 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
>>>> index a5555b9..514dfd1 100755
>>>> --- a/client/tests/kvm/kvm_vm.py
>>>> +++ b/client/tests/kvm/kvm_vm.py
>>>> @@ -390,7 +390,7 @@ class VM:
>>>>              qemu_cmd += add_floppy(help, floppy)
>>>>  
>>>>          tftp = params.get("tftp")
>>>> -        if tftp:
>>>> +        if tftp and nic_params.get("nic_mode") == "user":
>>
>> nic_params happens to be the params dict of the last NIC.  It's defined
>> in a loop earlier in the function and this tftp code is outside that
>> loop.  I don't think it's correct to enable/disable tftp based on the
>> nic_mode of just one NIC, let alone the last NIC.  Of course this is
>> fine for the common case where only a single NIC exists, but maybe it
>> would be more correct to check all NICs.
> 
> Oh, yes. 
> 
> I try to change unattended_install for supporting with private bridge.
> 'tftp' is defined in configure file, it is used in unattended.py and 
> make_qemu_command().
> '-tftp' is also added when I using bridge net. So I have to define tftp path 
> with different
> names for user net and bridge net, it's not so good.
> 
> Hi Lucas, Michael
> 
> Only control in configure file ?  or limit in make_qemu_command() (check all 
> nic mode) ?

I suppose it's OK to check all NICs (using
kvm_utils.get_sub_dict_names() and kvm_utils.get_sub_dict()), even
though it's not perfectly correct either: theoretically a VM can be
started with no NICs at all, and user mode NICs can be hot-added later
AFAIK.  In that case checking all NICs in VM.create() is incorrect.  I
don't think this scenario is likely though.  It's also possible to just
always add -tftp because it's harmless.

How are you planning to use tftp in unattended.py?  How will you know if
user mode or TAP mode is being used?
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to