1. 30 4月, 2019 1 次提交
  2. 18 12月, 2018 2 次提交
  3. 18 7月, 2017 1 次提交
    • E
      nbd: Fix iotests failure due to changed client error message · 9a76bd78
      Eric Blake 提交于
      Commit 8ecaeae8 changed the way the client requests an NBD export,
      and in the process also changed the resulting error message when
      the export is not present, breaking a couple of iotests.  The error
      message is now directly given by the server (a failed NBD_OPT_GO)
      instead of implied by the client (after exhausting NBD_OPT_LIST),
      but looking at the testsuite changes, it proves worthwhile to
      reword the error message to be slightly less verbose (as this is
      one particular error message likely to be hit by a user).
      
      Note that the error message is now sensitive to which binary is
      running the server as well as the client (since the expected
      output is replaying a message received from the server - for that
      matter, it depends on a server new enough to understand NBD_OPT_GO);
      in general iotests are run on client and server from the same source
      code base so the default setup will pass; but if it proves
      problematic for people overriding QEMU_PROG, QEMU_IMG_PROG,
      QEMU_IO_PROG, and QEMU_NBD_PROG to point across multiple builds for
      cross-version integration testing, we may have to later tweak or
      sanitize the output somehow.
      Reported-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20170717142310.17048-1-eblake@redhat.com>
      Tested-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      9a76bd78
  4. 23 5月, 2017 1 次提交
    • E
      shutdown: Expose bool cause in SHUTDOWN and RESET events · 08fba7ac
      Eric Blake 提交于
      Libvirt would like to be able to distinguish between a SHUTDOWN
      event triggered solely by guest request and one triggered by a
      SIGTERM or other action on the host.  While qemu_kill_report() was
      already able to give different output to stderr based on whether a
      shutdown was triggered by a host signal (but NOT by a host UI event,
      such as clicking the X on the window), that information was then
      lost to management.  The previous patches improved things to use an
      enum throughout all callsites, so now we have something ready to
      expose through QMP.
      
      Note that for now, the decision was to expose ONLY a boolean,
      rather than promoting ShutdownCause to a QAPI enum; this is because
      libvirt has not expressed an interest in anything finer-grained.
      We can still add additional details, in a backwards-compatible
      manner, if a need later arises (if the addition happens before 2.10,
      we can replace the bool with an enum; otherwise, the enum will have
      to be in addition to the bool); this patch merely adds a helper
      shutdown_caused_by_guest() to map the internal enum into the
      external boolean.
      
      Update expected iotest outputs to match the new data (complete
      coverage of the affected tests is obtained by -raw, -qcow2, and -nbd).
      
      Here is output from 'virsh qemu-monitor-event --loop' with the
      patch installed:
      
      event SHUTDOWN at 1492639680.731251 for domain fedora_13: {"guest":true}
      event STOP at 1492639680.732116 for domain fedora_13: <null>
      event SHUTDOWN at 1492639680.732830 for domain fedora_13: {"guest":false}
      
      Note that libvirt runs qemu with -no-shutdown: the first SHUTDOWN event
      was triggered by an action I took directly in the guest (shutdown -h),
      at which point qemu stops the vcpus and waits for libvirt to do any
      final cleanups; the second SHUTDOWN event is the result of libvirt
      sending SIGTERM now that it has completed cleanup.  Libvirt is already
      smart enough to only feed the first qemu SHUTDOWN event to the end user
      (remember, virsh qemu-monitor-event is a low-level debugging interface
      that is explicitly unsupported by libvirt, so it sees things that normal
      end users do not); changing qemu to emit SHUTDOWN only once is outside
      the scope of this series.
      
      See also https://bugzilla.redhat.com/1384007Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20170515214114.15442-6-eblake@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      08fba7ac
  5. 12 2月, 2017 1 次提交
    • N
      qemu-io: Return non-zero exit code on failure · b7aa1315
      Nir Soffer 提交于
      The result of openfile was not checked, leading to failure deep in the
      actual command with confusing error message, and exiting with exit code 0.
      
      Here is a simple example - trying to read with the wrong format:
      
          $ touch file
          $ qemu-io -f qcow2 -c 'read -P 1 0 1024' file; echo $?
          can't open device file: Image is not in qcow2 format
          no file open, try 'help open'
          0
      
      With this patch, we fail earlier with exit code 1:
      
          $ ./qemu-io -f qcow2 -c 'read -P 1 0 1024' file; echo $?
          can't open device file: Image is not in qcow2 format
          1
      
      Failing earlier, we don't log this error now:
      
          no file open, try 'help open'
      
      But some tests expected it; the line was removed from the test output.
      Signed-off-by: NNir Soffer <nirsof@gmail.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-id: 20170201003120.23378-2-nirsof@gmail.com
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      b7aa1315
  6. 22 2月, 2016 1 次提交
  7. 17 2月, 2016 1 次提交
    • D
      nbd: always query export list in fixed new style protocol · 9344e5f5
      Daniel P. Berrange 提交于
      With the new style protocol, the NBD client will currenetly
      send NBD_OPT_EXPORT_NAME as the first (and indeed only)
      option it wants. The problem is that the NBD protocol spec
      does not allow for returning an error message with the
      NBD_OPT_EXPORT_NAME option. So if the server mandates use
      of TLS, the client will simply see an immediate connection
      close after issuing NBD_OPT_EXPORT_NAME which is not user
      friendly.
      
      To improve this situation, if we have the fixed new style
      protocol, we can sent NBD_OPT_LIST as the first option
      to query the list of server exports. We can check for our
      named export in this list and raise an error if it is not
      found, instead of going ahead and sending NBD_OPT_EXPORT_NAME
      with a name that we know will be rejected.
      
      This improves the error reporting both in the case that the
      server required TLS, and in the case that the client requested
      export name does not exist on the server.
      
      If the server does not support NBD_OPT_LIST, we just ignore
      that and carry on with NBD_OPT_EXPORT_NAME as before.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1455129674-17255-12-git-send-email-berrange@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      9344e5f5
  8. 03 2月, 2016 1 次提交