mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-25 10:03:49 +03:00
Convert guestfwd to -device, and add -sdl explicit args
The old syntax was -chardev SOMECONFIG -nic user,guestfwd=tcp:IP:PORT-chardev:CHARDEV The new syntax is -chardev SOMECONFIG -netdev user,guestfwd=tcp:IP:PORT,chardev=ID,id=user-ID
This commit is contained in:
parent
16658da4e7
commit
d86c876a66
@ -3284,9 +3284,10 @@ int qemudBuildCommandLine(virConnectPtr conn,
|
|||||||
|
|
||||||
switch(channel->targetType) {
|
switch(channel->targetType) {
|
||||||
case VIR_DOMAIN_CHR_TARGET_TYPE_GUESTFWD:
|
case VIR_DOMAIN_CHR_TARGET_TYPE_GUESTFWD:
|
||||||
if (!(qemuCmdFlags & QEMUD_CMD_FLAG_CHARDEV)) {
|
if (!(qemuCmdFlags & QEMUD_CMD_FLAG_CHARDEV) ||
|
||||||
|
!(qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE)) {
|
||||||
qemudReportError(conn, NULL, NULL, VIR_ERR_NO_SUPPORT,
|
qemudReportError(conn, NULL, NULL, VIR_ERR_NO_SUPPORT,
|
||||||
"%s", _("guestfwd requires QEMU to support -chardev"));
|
"%s", _("guestfwd requires QEMU to support -chardev & -device"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3302,8 +3303,9 @@ int qemudBuildCommandLine(virConnectPtr conn,
|
|||||||
const char *addr = virSocketFormatAddr(channel->target.addr);
|
const char *addr = virSocketFormatAddr(channel->target.addr);
|
||||||
int port = virSocketGetPort(channel->target.addr);
|
int port = virSocketGetPort(channel->target.addr);
|
||||||
|
|
||||||
virBufferVSprintf(&buf, "user,guestfwd=tcp:%s:%i-chardev:%s",
|
ADD_ARG_LIT("-netdev");
|
||||||
addr, port, channel->info.alias);
|
virBufferVSprintf(&buf, "user,guestfwd=tcp:%s:%i,chardev=%s,id=user-%s",
|
||||||
|
addr, port, channel->info.alias, channel->info.alias);
|
||||||
|
|
||||||
VIR_FREE(addr);
|
VIR_FREE(addr);
|
||||||
|
|
||||||
@ -3312,7 +3314,6 @@ int qemudBuildCommandLine(virConnectPtr conn,
|
|||||||
goto no_memory;
|
goto no_memory;
|
||||||
}
|
}
|
||||||
|
|
||||||
ADD_ARG_LIT("-net");
|
|
||||||
ADD_ARG(virBufferContentAndReset(&buf));
|
ADD_ARG(virBufferContentAndReset(&buf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefaults -chardev socket,id=monitor,path=/tmp/test-monitor,server,nowait -mon chardev=monitor,mode=readline -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -chardev pipe,id=channel0,path=/tmp/guestfwd -net user,guestfwd=tcp:10.0.2.1:4600-chardev:channel0 -usb
|
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefaults -chardev socket,id=monitor,path=/tmp/test-monitor,server,nowait -mon chardev=monitor,mode=readline -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -chardev pipe,id=channel0,path=/tmp/guestfwd -netdev user,guestfwd=tcp:10.0.2.1:4600,chardev=channel0,id=user-channel0 -usb
|
||||||
|
Loading…
x
Reference in New Issue
Block a user