qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Antonio Apostoliu" <antonio.apostoliu@cestrin.ro>
To: <qemu-devel@nongnu.org>
Subject: Power shell with some problems.
Date: Mon, 20 Feb 2023 16:04:31 +0200	[thread overview]
Message-ID: <000001d94534$41461c30$c3d25490$@cestrin.ro> (raw)

[-- Attachment #1: Type: text/plain, Size: 3769 bytes --]

Hello

  You are so kind to look at next listing.

Where I wrong?

 

Best regards.

 

PS F:\step> $PSVersionTable

Name                           Value

----                           -----

PSVersion                      7.3.2

PSEdition                      Core

GitCommitId                    7.3.2

OS                             Microsoft Windows 10.0.19045

Platform                       Win32NT

PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0.}

PSRemotingProtocolVersion      2.3

SerializationVersion           1.1.0.1

WSManStackVersion              3.0

PS F:\step>dir

    Directory: F:\step

Mode                 LastWriteTime         Length Name

----                 -------------         ------ ----

d----           2/10/2023 12:00 PM                qemu

-a---           2/20/2023  3:05 PM      369754112 d.qcow2

-a---           2/20/2023  2:48 PM           1263 reset_vm.ps1

-a---           2/20/2023  3:23 PM            552 start.bat

PS F:\step> type .\start.bat

@echo off

set portqmp=4444

set em64w=qemu-system-x86_64w.exe

set "arg_c1=-accel whpx -k us -m 952 -M q35 -smp 1 -no-reboot -no-shutdown
-nographic"

set "arg_c2=-parallel none -serial none -rtc base=localtime,clock=host"

set "arg_c=%arg_c1% %arg_c2%"

set "arg_m=%arg_c% -nic user"

set "arg_u=-qmp tcp:localhost:%portqmp%,server,wait=off"

set "arg=%arg_m% %arg_u%"

for %%i in ("%~dp0.") do SET "mypath=%%~fi"

set "subdirector_qemu=qemu"

set "locatie_qemu=%mypath%\%subdirector_qemu%"

set "qm=%locatie_qemu%\%em64w%"

start "" %qm%  -hda d.qcow2 %arg%

PS F:\step> type .\reset_vm.ps1

$LoginParameters1 = @{

    Uri             = 'http://localhost:4444'

    SessionVariable = 'Session'

    Method          = 'POST'

    ContentType     = "application/json"

    Body            = @{

          "execute"= "qmp_capabilities"

        }

}

$LoginParameters2 = @{

    Method          = 'POST'

    ContentType     = "application/json"

    Body            = @{

         "execute"= "send-key"

         "arguments"= @{

                      "keys"= @(

                                 @{

                                   "type" = "qcode"

                                    "data" = "ctrl"

                                  }

                                @{

                                   "type" = "qcode"

                                   "data" = "alt"

                                 },

                               @{

                                   "type" = "qcode"

                                   "data" = "delete"

                                }

                             )

                    }

        }

}

$LoginResponse = Invoke-WebRequest @LoginParameters1

$ProfileResponse = Invoke-WebRequest 'http://localhost:4444' -WebSession
$Session @LoginParameters2

PS F:\step> .\start.bat

PS F:\step> Start-Sleep -Seconds 60

PS F:\step> .\reset_vm.ps1

Invoke-WebRequest: F:\step\reset_vm.ps1:40

Line |

  40 |  $LoginResponse = Invoke-WebRequest @LoginParameters1

     |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

     | Received an invalid status line: '{"QMP": {"version": {"qemu":
{"micro": 0, "minor": 2, "major": 7},

     | "package": "v7.2.0-11948-ge6523b71fc-dirty"}, "capabilities":
["oob"]}}'.

Invoke-WebRequest: F:\step\reset_vm.ps1:41

Line |

  41 |  . eResponse = Invoke-WebRequest 'http://localhost:4444' -WebSession
$Se .

     |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

     | Received an invalid status line: '{"QMP": {"version": {"qemu":
{"micro": 0, "minor": 2, "major": 7},

     | "package": "v7.2.0-11948-ge6523b71fc-dirty"}, "capabilities":
["oob"]}}'.

PS F:\step>



-- 
This email has been checked for viruses by Avast antivirus software.
www.avast.com

[-- Attachment #2: Type: text/html, Size: 14680 bytes --]

                 reply	other threads:[~2023-02-20 14:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000001d94534$41461c30$c3d25490$@cestrin.ro' \
    --to=antonio.apostoliu@cestrin.ro \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).