Revision ad2023a3

b/scripts/gnt-instance
285 285
                                file_driver=opts.file_driver,
286 286
                                hvm_acpi=hvm_acpi, hvm_pae=hvm_pae,
287 287
                                hvm_cdrom_image_path=hvm_cdrom_image_path,
288
                                vnc_bind_address=opts.vnc_bind_address)
288
                                vnc_bind_address=opts.vnc_bind_address,
289
                                hvm_nic_type=opts.hvm_nic_type,
290
                                hvm_disk_type=opts.hvm_disk_type)
289 291

  
290 292
  SubmitOpCode(op)
291 293
  return 0
......
643 645
  op = opcodes.OpQueryInstanceData(instances=args)
644 646
  result = SubmitOpCode(op)
645 647
  hvm_parameters = ("hvm_acpi", "hvm_pae", "hvm_cdrom_image_path",
646
                    "hvm_boot_order")
648
                    "hvm_boot_order", "hvm_nic_type", "hvm_disk_type")
647 649

  
648 650
  pvm_parameters = ("kernel_path", "initrd_path")
649 651

  
......
683 685
      buf.write("    - ACPI support: %s\n" % instance["hvm_acpi"])
684 686
      buf.write("    - PAE support: %s\n" % instance["hvm_pae"])
685 687
      buf.write("    - virtual CDROM: %s\n" % instance["hvm_cdrom_image_path"])
688
      buf.write("    - virtual NIC type: %s\n" %  instance["hvm_nic_type"])
689
      buf.write("    - virtual disk type: %s\n" %  instance["hvm_disk_type"])
686 690
    if instance.has_key("vnc_bind_address"):
687 691
      buf.write("  VNC bind address: %s\n" % instance["vnc_bind_address"])
688 692
    buf.write("  Hardware:\n")
......
718 722
  if not (opts.mem or opts.vcpus or opts.ip or opts.bridge or opts.mac or
719 723
          opts.kernel_path or opts.initrd_path or opts.hvm_boot_order or
720 724
          opts.hvm_acpi or opts.hvm_pae or opts.hvm_cdrom_image_path or
721
          opts.vnc_bind_address):
725
          opts.vnc_bind_address or opts.hvm_nic_type or opts.hvm_disk_type):
722 726
    logger.ToStdout("Please give at least one of the parameters.")
723 727
    return 1
724 728

  
......
739 743
  else:
740 744
    hvm_pae = opts.hvm_pae == _VALUE_TRUE
741 745

  
746
  if opts.hvm_nic_type == constants.VALUE_NONE:
747
    hvm_nic_type = None
748
  else:
749
    hvm_nic_type = opts.hvm_nic_type
750

  
751
  if opts.hvm_disk_type == constants.VALUE_NONE:
752
    hvm_disk_type = None
753
  else:
754
    hvm_disk_type = opts.hvm_disk_type
755

  
742 756
  op = opcodes.OpSetInstanceParams(instance_name=args[0], mem=opts.mem,
743 757
                                   vcpus=opts.vcpus, ip=opts.ip,
744 758
                                   bridge=opts.bridge, mac=opts.mac,
......
748 762
                                   hvm_acpi=hvm_acpi, hvm_pae=hvm_pae,
749 763
                                   hvm_cdrom_image_path=
750 764
                                   opts.hvm_cdrom_image_path,
751
                                   vnc_bind_address=opts.vnc_bind_address)
765
                                   vnc_bind_address=opts.vnc_bind_address,
766
                                   hvm_nic_type=hvm_nic_type,
767
                                   hvm_disk_type=hvm_disk_type)
752 768

  
753 769
  result = SubmitOpCode(op)
754 770

  
......
855 871
  make_option("--hvm-acpi", dest="hvm_acpi",
856 872
              help="ACPI support for HVM (true|false)",
857 873
              metavar="<BOOL>", choices=["true", "false"]),
874
  make_option("--hvm-nic-type", dest="hvm_nic_type",
875
              help="Type of virtual NIC for HVM "
876
              "(rtl8139,ne2k_pci,ne2k_isa,paravirtual)",
877
              metavar="NICTYPE", choices=[constants.HT_HVM_NIC_RTL8139,
878
                                          constants.HT_HVM_NIC_NE2K_PCI,
879
                                          constants.HT_HVM_NIC_NE2K_ISA,
880
                                          constants.HT_HVM_DEV_PARAVIRTUAL],
881
              default=constants.HT_HVM_NIC_RTL8139),
882
  make_option("--hvm-disk-type", dest="hvm_disk_type",
883
              help="Type of virtual disks for HVM (ioemu,paravirtual)",
884
              metavar="DISKTYPE", choices=[constants.HT_HVM_DEV_IOEMU,
885
                                           constants.HT_HVM_DEV_PARAVIRTUAL],
886
              default=constants.HT_HVM_DEV_IOEMU,),
858 887
  make_option("--hvm-pae", dest="hvm_pae",
859 888
              help="PAE support for HVM (true|false)",
860 889
              metavar="<BOOL>", choices=["true", "false"]),
......
982 1011
                          help="CDROM image path for HVM"
983 1012
                          "(absolute path or None)",
984 1013
                          default=None, type="string", metavar="<CDROMIMAGE>"),
1014
              make_option("--hvm-nic-type", dest="hvm_nic_type",
1015
                          help="Type of virtual NIC for HVM "
1016
                          "(rtl8139,ne2k_pci,ne2k_isa,paravirtual)",
1017
                          metavar="NICTYPE",
1018
                          choices=[constants.HT_HVM_NIC_RTL8139,
1019
                                   constants.HT_HVM_NIC_NE2K_PCI,
1020
                                   constants.HT_HVM_NIC_NE2K_ISA,
1021
                                   constants.HT_HVM_DEV_PARAVIRTUAL],
1022
                          default=None),
1023
              make_option("--hvm-disk-type", dest="hvm_disk_type",
1024
                          help="Type of virtual disks for HVM "
1025
                          "(ioemu,paravirtual)",
1026
                          metavar="DISKTYPE",
1027
                          choices=[constants.HT_HVM_DEV_IOEMU,
1028
                                   constants.HT_HVM_DEV_PARAVIRTUAL],
1029
                          default=None),
985 1030
              make_option("--vnc-bind-address", dest="vnc_bind_address",
986 1031
                          help="bind address for VNC (IP address)",
987 1032
                          default=None, type="string", metavar="<VNCADDRESS>"),

Also available in: Unified diff