diff --git a/tests/cli-test-xml/compare/kvm-machine.xml b/tests/cli-test-xml/compare/kvm-machine.xml index 91b3df98b..ccd23ab95 100644 --- a/tests/cli-test-xml/compare/kvm-machine.xml +++ b/tests/cli-test-xml/compare/kvm-machine.xml @@ -54,5 +54,9 @@ + + + + diff --git a/tests/cli-test-xml/compare/kvm-win2k3-cdrom.xml b/tests/cli-test-xml/compare/kvm-win2k3-cdrom.xml index 23acf7d27..a6eeb7475 100644 --- a/tests/cli-test-xml/compare/kvm-win2k3-cdrom.xml +++ b/tests/cli-test-xml/compare/kvm-win2k3-cdrom.xml @@ -50,6 +50,10 @@ + + + + @@ -103,6 +107,10 @@ + + + + @@ -156,5 +164,9 @@ + + + + diff --git a/tests/cli-test-xml/compare/kvm-xenner.xml b/tests/cli-test-xml/compare/kvm-xenner.xml index 026598a5c..0b91a3e32 100644 --- a/tests/cli-test-xml/compare/kvm-xenner.xml +++ b/tests/cli-test-xml/compare/kvm-xenner.xml @@ -35,5 +35,9 @@ + + + + diff --git a/tests/cli-test-xml/compare/ppc64-pseries-f20.xml b/tests/cli-test-xml/compare/ppc64-pseries-f20.xml index 24a6c737b..74815c815 100644 --- a/tests/cli-test-xml/compare/ppc64-pseries-f20.xml +++ b/tests/cli-test-xml/compare/ppc64-pseries-f20.xml @@ -40,5 +40,9 @@ + + + + diff --git a/tests/cli-test-xml/compare/qemu-plain.xml b/tests/cli-test-xml/compare/qemu-plain.xml index 9ed969ee1..d76ef7c01 100644 --- a/tests/cli-test-xml/compare/qemu-plain.xml +++ b/tests/cli-test-xml/compare/qemu-plain.xml @@ -57,5 +57,9 @@ + + + + diff --git a/tests/clitest.py b/tests/clitest.py index 7740e3dd9..b50a5de8b 100644 --- a/tests/clitest.py +++ b/tests/clitest.py @@ -520,7 +520,7 @@ c.add_valid("--nodisks --boot hd --paravirt --arch i686") # 32 on 64 xen c = vinst.add_category("kvm", "--connect %(KVMURI)s --noautoconsole") -c.add_compare("--os-variant fedora20 --file %(EXISTIMG1)s --location %(TREEDIR)s --extra-args console=ttyS0 --cpu host --channel none --console none --sound none", "kvm-f14-url") # F14 Directory tree URL install with extra-args +c.add_compare("--os-variant fedora20 --file %(EXISTIMG1)s --location %(TREEDIR)s --extra-args console=ttyS0 --cpu host --channel none --console none --sound none --redirdev none", "kvm-f14-url") # F14 Directory tree URL install with extra-args c.add_compare("--os-variant fedora20 --disk %(NEWIMG1)s,size=.01 --location %(TREEDIR)s --extra-args console=ttyS0 --quiet", "quiet-url") # Quiet URL install should make no noise c.add_compare("--cdrom %(EXISTIMG2)s --file %(EXISTIMG1)s --os-variant win2k3 --wait 0 --sound --controller usb", "kvm-win2k3-cdrom") # HVM windows install with disk c.add_compare("--os-variant fedora20 --nodisks --boot hd --paravirt", "kvm-xenner") # xenner diff --git a/virtManager/create.py b/virtManager/create.py index c60a73306..e82dbb044 100644 --- a/virtManager/create.py +++ b/virtManager/create.py @@ -1389,21 +1389,15 @@ class vmmCreate(vmmGObjectUI): else: guest.skip_default_sound = True + guest.skip_default_usbredir = ( + self.config.get_add_spice_usbredir() == "no") + guest.add_default_video_device() guest.add_default_input_device() guest.add_default_console_device() guest.add_default_usb_controller() guest.add_default_channels() - if (gdev and - self.config.get_add_spice_usbredir() == "yes" and - self.conn.check_support(self.conn.SUPPORT_CONN_USBREDIR)): - for ignore in range(4): - dev = virtinst.VirtualRedirDevice(guest.conn) - dev.bus = "usb" - dev.type = "spicevmc" - guest.add_device(dev) - if (((guest.conn.is_qemu() and guest.type == "kvm") or guest.conn.is_test()) and guest.os.is_x86() and diff --git a/virtinst/cli.py b/virtinst/cli.py index 6798db3f8..31eebb9f7 100644 --- a/virtinst/cli.py +++ b/virtinst/cli.py @@ -1733,7 +1733,6 @@ class ParserRedir(VirtCLIParser): def _init_params(self): self.devclass = virtinst.VirtualRedirDevice self.remove_first = "bus" - self.check_none = True self.set_param("bus", "bus") self.set_param("type", "type") @@ -1744,6 +1743,12 @@ class ParserRedir(VirtCLIParser): self.set_param(None, "server", setter_cb=set_server_cb) + def _parse(self, opts, inst): + if opts.fullopts == "none": + self.guest.skip_default_usbredir = True + return + return VirtCLIParser._parse(self, opts, inst) + ################# # --tpm parsing # diff --git a/virtinst/guest.py b/virtinst/guest.py index de16c9cb1..1280bc788 100644 --- a/virtinst/guest.py +++ b/virtinst/guest.py @@ -107,6 +107,7 @@ class Guest(XMLBuilder): self.skip_default_console = False self.skip_default_channel = False self.skip_default_sound = False + self.skip_default_usbredir = False self._os_variant = None self._random_uuid = None @@ -875,6 +876,20 @@ class Guest(XMLBuilder): return self.add_default_sound_device() + def _add_spice_usbredir(self): + if self.skip_default_usbredir: + return + if self.get_devices("redirdev"): + return + if not self.conn.check_support(self.conn.SUPPORT_CONN_USBREDIR): + return + + for ignore in range(4): + dev = virtinst.VirtualRedirDevice(self.conn) + dev.bus = "usb" + dev.type = "spicevmc" + self.add_device(dev) + def _set_video_defaults(self): def has_spice(): for gfx in self.get_devices("graphics"): @@ -884,6 +899,7 @@ class Guest(XMLBuilder): if has_spice(): self._add_spice_channels() self._add_spice_sound() + self._add_spice_usbredir() if has_spice() and self.os.is_x86(): video_model = "qxl"