1. 12 11月, 2015 1 次提交
    • K
      qga: fix append file open modes for win32 · 52074d0f
      Kirk Allan 提交于
      For append file open modes, use FILE_APPEND_DATA for the desired access
      for writing at the end of the file.
      
      Version 2:
      For "a+", "ab+", and "a+b" modes use FILE_APPEND_DATA|GENERIC_READ.
      ORing in GENERIC_READ starts a read at the begining of the file.  All
      writes will append to the end fo the file.
      
      Added white space to maintain the alignment of the guest_file_open_modes[].
      Signed-off-by: NKirk Allan <kallan@suse.com>
      Cc: qemu-stable@nongnu.org
      * use FILE_GENERIC_APPEND macro, which provides same semantics as
        FILE_APPEND_DATA, but retains other flags from GENERIC_WRITE
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      52074d0f
  2. 04 11月, 2015 2 次提交
  3. 20 10月, 2015 2 次提交
  4. 11 9月, 2015 1 次提交
  5. 02 9月, 2015 2 次提交
  6. 08 7月, 2015 6 次提交
    • M
      qga: added GuestPCIAddress information · c54e1eb4
      Michael Roth 提交于
      PCIAddress inforfation is obtained via SetupApi, which provides the
      information about address, bus, etc. We look throught entire device tree
      in the system and try to find device object for given volume. For this PDO
      SetupDiGetDeviceRegistryProperty is called, which reads PCI configuration
      for a given devicei if it is possible.
      
      This is the most convinient way for a userspace service. The lookup is
      performed for every volume available. However, this information is
      not mandatory for vss-provider.
      
      In order to use SetupApi we need to notify linker about it. We do not need
      to install additional libs, so we do not make separate configuration
      option to use libsetupapi.su
      
      SetupApi gives as the same information as kernel driver
      with IRP_MN_QUERY_INTERFACE.
      https://support.microsoft.com/en-us/kb/253232Signed-off-by: NOlga Krishtal <okrishtal@virtuozzo.com>
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      CC: Eric Blake <eblake@redhat.com>
      CC: Michael Roth <mdroth@linux.vnet.ibm.com>
      * stub out get_pci_info if !CONFIG_QGA_NTDDSCSI
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      c54e1eb4
    • O
      qga: added bus type and disk location path · a3ef3b22
      Olga Krishtal 提交于
      According to Microsoft disk location path can be obtained via
      IOCTL_SCSI_GET_ADDRESS. Unfortunately this ioctl can not be used for all
      devices. There are certain bus types which could be obtained with this
      API. Please, refer to the following link for more details
      https://technet.microsoft.com/en-us/library/ee851589(v=ws.10).aspx
      
      Bus type could be obtained using IOCTL_STORAGE_QUERY_PROPERTY. Enum
      STORAGE_BUS_TYPE describes all buses supported by OS.
      
      Windows defines more bus types than Linux. Thus some values have been added
      to GuestDiskBusType.
      Signed-off-by: NOlga Krishtal <okrishtal@virtuozzo.com>
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      CC: Eric Blake <eblake@redhat.com>
      CC: Michael Roth <mdroth@linux.vnet.ibm.com>
      * fixed warning in CreateFile due to use of NULL instead of 0
      * only provide disk info when CONFIG_QGA_NTDDSCSI=y
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      a3ef3b22
    • O
      qga: added mountpoint and filesystem type for single volume · d2b3f390
      Olga Krishtal 提交于
      We should use GetVolumeXXX api to work with volumes. This will help us to
      resolve the situation with volumes without drive letter, i.e. when the
      volume is mounted as a folder. Such volume is called mounted folder.
      This volume is a regular mounted volume from all other points of view.
      The information about non mounted volume is reported as System Reserved.
      This volume is not mounted and thus it is not writable.
      
      GuestDiskAddressList API is not used because operations are performed with
      volumes but no with disks. This means that spanned disk will
      be counted and handled as a single volume. It is worth mentioning
      that the information about every disk in the volume can be queried
      via IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS.
      Signed-off-by: NOlga Krishtal <okrishtal@virtuozzo.com>
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      CC: Eric Blake <eblake@redhat.com>
      CC: Michael Roth <mdroth@linux.vnet.ibm.com>
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      d2b3f390
    • O
      qga: added empty qmp_quest_get_fsinfo functionality. · ef0a03f2
      Olga Krishtal 提交于
      We need qmp_quest_get_fsinfo togather with vss-provider, which works with
      volumes. The call to this function is implemented via
      FindFirst/NextVolumes. Moreover, volumes in Windows OS are filesystem unit,
      so it will be more effective to work with them rather with devices.
      Signed-off-by: NOlga Krishtal <okrishtal@virtuozzo.com>
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      CC: Eric Blake <eblake@redhat.com>
      CC: Michael Roth <mdroth@linux.vnet.ibm.com>
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      ef0a03f2
    • K
      qga: win32 qmp_guest_network_get_interfaces implementation · d6c5528b
      Kirk Allan 提交于
      By default, IPv4 prefixes will be derived by matching the address
      to those returned by GetAdaptersInfo.  IPv6 prefixes can not be
      matched this way due to the unpredictable order of entries.
      
      In Windows Vista/2008 guests and newer, both IPv4 and IPv6 prefixes
      can be retrieved from OnLinkPrefixLength.  Setting --extra-cflags
      in the build configuration to "-D_WIN32_WINNT=0x600"
      or greater makes OnLinkPrefixLength available.  Setting --extra-cflags
      is not required and if not set, the default approach to get the prefix
      will be taken.
      Signed-off-by: NKirk Allan <kallan@suse.com>
      * drop ws2ipdef.h, it's missing on old mingw, and ws2tcpip.h already
        includes it automatically on new builds
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      d6c5528b
    • J
      qga/qmp_guest_fstrim: Return per path fstrim result · e82855d9
      Justin Ossevoort 提交于
      The current guest-fstrim support only returns an error if some
      mountpoint was unable to be trimmed, skipping any possible additional
      mountpoints. The result of the TRIM operation itself is also discarded.
      
      This change returns a per mountpoint result of the TRIM operation. If an
      error occurs on some mountpoints that error is returned and the
      guest-fstrim continue with any additional mountpoints.
      
      The returned values for errors, minimum and trimmed are dependant on the
      filesystem, storage stacks and kernel version.
      Signed-off-by: NJustin Ossevoort <justin@quarantainenet.nl>
      * s/type/struct/ in schema type definitions
      * moved version annotation for new guest-fstrim return field to
        the field itself rather than applying to the entire command
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      e82855d9
  7. 23 6月, 2015 1 次提交
  8. 17 6月, 2015 1 次提交
  9. 18 2月, 2015 3 次提交
  10. 17 2月, 2015 2 次提交
    • O
      qga: implement file commands for Windows guest · fa193594
      Olga Krishtal 提交于
      The following commands are implemented:
      - guest_file_open
      - guest_file_close
      - guest_file_write
      - guest_file_read
      - guest_file_seek
      - guest_file_flush
      
      Motivation is quite simple: Windows guests should be supported with the
      same set of features as Linux one. Also this patch is a prerequisite for
      Windows guest-exec command support.
      Signed-off-by: NOlga Krishtal <okrishtal@parallels.com>
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      CC: Michael Roth <mdroth@linux.vnet.ibm.com>
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      fa193594
    • D
      qga: add guest-set-user-password command · 215a2771
      Daniel P. Berrange 提交于
      Add a new 'guest-set-user-password' command for changing the password
      of guest OS user accounts. This command is needed to enable OpenStack
      to support its API for changing the admin password of guests running
      on KVM/QEMU. It is not practical to provide a command at the QEMU
      level explicitly targetting administrator account password change
      only, since different guest OS have different names for the admin
      account. While UNIX systems use 'root', Windows systems typically
      use 'Administrator' and even that can be renamed. Higher level apps
      like OpenStack have the ability to figure out the correct admin
      account name since they have info that QEMU/libvirt do not.
      
      The command accepts either the clear text password string, encoded
      in base64 to make it 8-bit safe in JSON:
      
      $ echo -n "123456" | base64
      MTIzNDU2
      $ virsh -c qemu:///system  qemu-agent-command f21x86_64 \
         '{ "execute": "guest-set-user-password",
            "arguments": { "crypted": false,
                           "username": "root",
                           "password": "MTIzNDU2" } }'
        {"return":{}}
      
      Or a password that has already been run though a crypt(3) like
      algorithm appropriate for the guest, again then base64 encoded:
      
      $ echo -n '$6$n01A2Tau$e...snip...DfMOP7of9AJ1I8q0' | base64
      JDYkb...snip...YT2Ey
      $ virsh -c qemu:///system  qemu-agent-command f21x86_64 \
         '{ "execute": "guest-set-user-password",
            "arguments": { "crypted": true,
                           "username": "root",
                           "password": "JDYkb...snip...YT2Ey" } }'
      
      NB windows support is desirable, but not implemented in this
      patch.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      215a2771
  11. 08 8月, 2014 3 次提交
    • T
      qga: Disable unsupported commands by default · 1281c08a
      Tomoki Sekiyama 提交于
      Currently management softwares cannot know whether a qemu-ga command is
      supported or not on the running platform until they actually execute it.
      This patch disables unsupported commands at launch time of qemu-ga, so that
      management softwares can check whether they are supported from 'enabled'
      property of the result from 'guest-info' command.
      Signed-off-by: NTomoki Sekiyama <tomoki.sekiyama@hds.com>
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      1281c08a
    • T
      qga: Add guest-get-fsinfo command · 46d4c572
      Tomoki Sekiyama 提交于
      Add command to get mounted filesystems information in the guest.
      The returned value contains a list of mountpoint paths and
      corresponding disks info such as disk bus type, drive address,
      and the disk controllers' PCI addresses, so that management layer
      such as libvirt can resolve the disk backends.
      
      For example, when `lsblk' result is:
      
          NAME           MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
          sdb              8:16   0    1G  0 disk
          `-sdb1           8:17   0 1024M  0 part
            `-vg0-lv0    253:1    0  1.4G  0 lvm  /mnt/test
          sdc              8:32   0    1G  0 disk
          `-sdc1           8:33   0  512M  0 part
            `-vg0-lv0    253:1    0  1.4G  0 lvm  /mnt/test
          vda            252:0    0   25G  0 disk
          `-vda1         252:1    0   25G  0 part /
      
      where sdb is a SCSI disk with PCI controller 0000:00:0a.0 and ID=1,
            sdc is an IDE disk with PCI controller 0000:00:01.1, and
            vda is a virtio-blk disk with PCI device 0000:00:06.0,
      
      guest-get-fsinfo command will return the following result:
      
          {"return":
           [{"name":"dm-1",
             "mountpoint":"/mnt/test",
             "disk":[
              {"bus-type":"scsi","bus":0,"unit":1,"target":0,
               "pci-controller":{"bus":0,"slot":10,"domain":0,"function":0}},
              {"bus-type":"ide","bus":0,"unit":0,"target":0,
               "pci-controller":{"bus":0,"slot":1,"domain":0,"function":1}}],
             "type":"xfs"},
            {"name":"vda1", "mountpoint":"/",
             "disk":[
              {"bus-type":"virtio","bus":0,"unit":0,"target":0,
               "pci-controller":{"bus":0,"slot":6,"domain":0,"function":0}}],
             "type":"ext4"}]}
      
      In Linux guest, the disk information is resolved from sysfs. So far,
      it only supports virtio-blk, virtio-scsi, IDE, SATA, SCSI disks on x86
      hosts, and "disk" parameter may be empty for unsupported disk types.
      Signed-off-by: NTomoki Sekiyama <tomoki.sekiyama@hds.com>
      
      *updated schema to report 2.2 as initial supported version
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      46d4c572
    • T
      qga: Add guest-fsfreeze-freeze-list command · e99bce20
      Tomoki Sekiyama 提交于
      If an array of mount point paths is specified as 'mountpoints' argument
      of guest-fsfreeze-freeze-list, qemu-ga will only freeze the file systems
      mounted on specified paths in Linux guests. Otherwise, it works as the
      same way as guest-fsfreeze-freeze.
      This would be useful when the host wants to create partial disk snapshots.
      Signed-off-by: NTomoki Sekiyama <tomoki.sekiyama@hds.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      
      *updated schema to report 2.2 as initial supported version
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      e99bce20
  12. 04 6月, 2014 1 次提交
  13. 09 5月, 2014 3 次提交
  14. 24 2月, 2014 1 次提交
  15. 18 2月, 2014 1 次提交
  16. 26 11月, 2013 1 次提交
  17. 10 9月, 2013 1 次提交
  18. 02 4月, 2013 2 次提交
  19. 12 3月, 2013 3 次提交
  20. 19 12月, 2012 1 次提交
  21. 05 10月, 2012 1 次提交
  22. 22 6月, 2012 1 次提交
    • P
      qemu-ga: add guest-fstrim command · eab5fd59
      Paolo Bonzini 提交于
      FITRIM is a mounted filesystem feature to discard (or "trim") blocks which
      are not in use by the filesystem. This is useful for solid-state drives
      (SSDs) and thinly-provisioned storage.  Provide access to the feature
      from the host so that filesystems can be trimmed periodically or before
      migration.
      
      Here is an example using scsi_debug:
      
          # modprobe scsi_debug lbpu=1 lbpws=1
          # sg_vpd -p0xb2 /dev/sdb
          Logical block provisioning VPD page (SBC):
            Unmap command supported (LBPU): 1
            Write same (16) with unmap bit supported (LBWS): 1
            Write same (10) with unmap bit supported (LBWS10): 0
          # mke2fs /dev/sdb
          # cat /sys/bus/pseudo/drivers/scsi_debug/map
          1-616,16257-16383
          # mount /dev/sdb /run/media/pbonzini/test
          # dd if=/dev/zero of=/run/media/pbonzini/test/file
          # cat map
          1-616,645-1588,1599-4026,4029-16383
          # rm /run/media/pbonzini/test/file
          # ./qemu-ga /dev/fd/0
          {"execute":"guest-fstrim"}
          {"return": {}}
          # cat map
          1-612
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NLuiz Capitulino <lcapitulino@redhat.com>
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      eab5fd59